curl -sS "$BMA_BASE_URL/v1/machines/<machine_id>" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"type": "machine",
"id": "<string>",
"org_id": "<string>",
"source_kind": "byo",
"agent_ids": [
"<string>"
],
"machine_pool_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"provider": "<string>",
"lifecycle_state": "provisioning",
"connection_state": "online",
"connection_state_reason": "<string>",
"power_state": "running",
"last_observed_at": "2023-11-07T05:31:56Z",
"cwd": "<string>",
"env": {},
"secret_env": {},
"lifecycle_reason_code": "<string>",
"lifecycle_reason_message": "<string>",
"failure_report": {
"stage": "startup_script",
"output_tail": "<string>",
"output_truncated": true,
"reported_at": "2023-11-07T05:31:56Z",
"exit_status": 123,
"daemon_version": "<string>",
"target_version": "<string>"
},
"next_reconcile_after": "2023-11-07T05:31:56Z",
"provision_attempts": 123,
"delete_attempts": 123,
"metadata": {},
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"kind": "persistent",
"machine_pool_name": "<string>",
"cpu": 2,
"memory_mb": 2,
"agent_id": "<string>",
"capabilities": {
"machine_id": "<string>",
"terminal": {
"supported": true,
"reason": "<string>"
},
"session_files": {
"declared": true
},
"desktop": {
"supported": true,
"webrtc": true,
"rfb": true,
"livekit": true,
"control": true,
"native_webrtc": true,
"reason": "<string>"
},
"permissions": {
"terminal": true,
"desktop_watch": true,
"desktop_control": true
},
"protocol_versions": {
"terminal": 123,
"desktop": 123
},
"harnesses": [
"<string>"
]
},
"token": "<string>",
"token_record": {
"id": "<string>",
"org_id": "<string>",
"machine_id": "<string>",
"name": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"revoke_reason": "<string>"
},
"project_grants": [
{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"source_kind": "explicit",
"description": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"project_machine_pool_grant_id": "<string>"
}
]
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Machines
Retrieve a machine
Adds capabilities (getMachineCapabilities), null when the project cannot use the machine.
GET
/
v1
/
machines
/
{machine_id}
curl -sS "$BMA_BASE_URL/v1/machines/<machine_id>" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"type": "machine",
"id": "<string>",
"org_id": "<string>",
"source_kind": "byo",
"agent_ids": [
"<string>"
],
"machine_pool_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"provider": "<string>",
"lifecycle_state": "provisioning",
"connection_state": "online",
"connection_state_reason": "<string>",
"power_state": "running",
"last_observed_at": "2023-11-07T05:31:56Z",
"cwd": "<string>",
"env": {},
"secret_env": {},
"lifecycle_reason_code": "<string>",
"lifecycle_reason_message": "<string>",
"failure_report": {
"stage": "startup_script",
"output_tail": "<string>",
"output_truncated": true,
"reported_at": "2023-11-07T05:31:56Z",
"exit_status": 123,
"daemon_version": "<string>",
"target_version": "<string>"
},
"next_reconcile_after": "2023-11-07T05:31:56Z",
"provision_attempts": 123,
"delete_attempts": 123,
"metadata": {},
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"kind": "persistent",
"machine_pool_name": "<string>",
"cpu": 2,
"memory_mb": 2,
"agent_id": "<string>",
"capabilities": {
"machine_id": "<string>",
"terminal": {
"supported": true,
"reason": "<string>"
},
"session_files": {
"declared": true
},
"desktop": {
"supported": true,
"webrtc": true,
"rfb": true,
"livekit": true,
"control": true,
"native_webrtc": true,
"reason": "<string>"
},
"permissions": {
"terminal": true,
"desktop_watch": true,
"desktop_control": true
},
"protocol_versions": {
"terminal": 123,
"desktop": 123
},
"harnesses": [
"<string>"
]
},
"token": "<string>",
"token_record": {
"id": "<string>",
"org_id": "<string>",
"machine_id": "<string>",
"name": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"revoke_reason": "<string>"
},
"project_grants": [
{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"source_kind": "explicit",
"description": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"project_machine_pool_grant_id": "<string>"
}
]
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}回應
Success.
A machine (a workspace persistent machine, an org machine or a connected BYO machine with its one-time token) or a deprecated agent machine (kind, machine_pool_name, cpu, memory_mb, agent_id); the fields of the other families are absent.
Compute state of a pool machine. paused keeps the disk (and memory when the provider supports it) without compute; resuming means a resume or restore is in flight; archived means the machine image is stored durably and is restored on the next access.
可用選項:
running, pausing, paused, resuming, archiving, archived