|
392 | 392 | "properties": { |
393 | 393 | "data": { |
394 | 394 | "properties": { |
| 395 | + "pagination": { |
| 396 | + "properties": { |
| 397 | + "current_page": { "type": "integer" }, |
| 398 | + "next_page": { |
| 399 | + "description": "The number of the next page, if any. If `null`, the current page is the last page of records.", |
| 400 | + "nullable": true, |
| 401 | + "type": "integer" |
| 402 | + }, |
| 403 | + "total_records": { "type": "integer" } |
| 404 | + }, |
| 405 | + "required": ["total_records", "current_page", "next_page"], |
| 406 | + "type": "object" |
| 407 | + }, |
395 | 408 | "sandboxes": { |
396 | 409 | "items": { |
397 | 410 | "properties": { |
|
426 | 439 | "type": "array" |
427 | 440 | } |
428 | 441 | }, |
429 | | - "required": ["sandboxes"], |
| 442 | + "required": ["sandboxes", "pagination"], |
430 | 443 | "type": "object" |
431 | 444 | } |
432 | 445 | }, |
|
610 | 623 | "session_id": { |
611 | 624 | "description": "Unique identifier for the session", |
612 | 625 | "example": "my-session-1", |
| 626 | + "pattern": "^[a-zA-Z0-9_-]+$", |
613 | 627 | "type": "string" |
614 | 628 | } |
615 | 629 | }, |
|
643 | 657 | "data": { |
644 | 658 | "properties": { |
645 | 659 | "capabilities": { |
646 | | - "description": "List of capabilities granted to this session", |
| 660 | + "description": "List of capabilities that Pitcher has", |
647 | 661 | "items": { "type": "string" }, |
648 | 662 | "type": "array" |
649 | 663 | }, |
650 | 664 | "permissions": { |
651 | | - "description": "Detailed permissions for this session", |
| 665 | + "description": "The permissions of the current session", |
652 | 666 | "type": "object" |
653 | 667 | }, |
654 | 668 | "pitcher_token": { |
655 | | - "description": "Token to authenticate with Pitcher", |
| 669 | + "description": "Token to authenticate with Pitcher (the agent running inside the VM)", |
656 | 670 | "type": "string" |
657 | 671 | }, |
658 | 672 | "pitcher_url": { |
|
1162 | 1176 | "name": "page", |
1163 | 1177 | "required": false, |
1164 | 1178 | "schema": { "default": 1, "minimum": 1, "type": "integer" } |
| 1179 | + }, |
| 1180 | + { |
| 1181 | + "description": "If true, only returns VMs for which a heartbeat was received in the last 30 seconds.", |
| 1182 | + "in": "query", |
| 1183 | + "name": "status", |
| 1184 | + "required": false, |
| 1185 | + "schema": { "enum": ["running"] } |
1165 | 1186 | } |
1166 | 1187 | ], |
1167 | 1188 | "responses": { |
|
1363 | 1384 | "/vm/{id}/sessions": { |
1364 | 1385 | "post": { |
1365 | 1386 | "callbacks": {}, |
1366 | | - "description": "Creates a new session on a running VM. A session represents an isolated Linux user, with their own container\nwhile their API token has specific permissions (currently, read or write).\nThe session is identified by a unique session ID, and the username is based on the session ID.\n\nThis endpoint requires the VM to be running. If the VM is not running, it will return a 404 error.\n", |
| 1387 | + "description": "Creates a new session on a running VM. A session represents an isolated Linux user, with their own container.\nA session has a single use token that the user can use to connect to the VM. This token has specific permissions (currently, read or write).\nThe session is identified by a unique session ID, and the Linux username is based on the session ID.\n\nThis endpoint requires the VM to be running. If the VM is not running, it will return a 404 error.\n", |
1367 | 1388 | "operationId": "vm/create_session", |
1368 | 1389 | "parameters": [ |
1369 | 1390 | { |
|
1398 | 1419 | "description": "VM Create Session Response" |
1399 | 1420 | } |
1400 | 1421 | }, |
1401 | | - "security": [{ "authorization": ["sandbox:read", "vm:manage"] }], |
| 1422 | + "security": [{ "authorization": ["vm:manage"] }], |
1402 | 1423 | "summary": "Create a new session on a VM", |
1403 | 1424 | "tags": ["vm"] |
1404 | 1425 | } |
|
1565 | 1586 | } |
1566 | 1587 | }, |
1567 | 1588 | "security": [], |
1568 | | - "servers": [{ "url": "https://api.codesandbox.stream", "variables": {} }], |
| 1589 | + "servers": [{ "url": "https://api.codesandbox.io", "variables": {} }], |
1569 | 1590 | "tags": [] |
1570 | 1591 | } |
0 commit comments