curl -sS -X DELETE "$BMA_BASE_URL/v1/machines/<machine_id>/agents/<agent_id>" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"from bma_sdk import Bma
client = Bma() # BMA_API_KEY, BMA_BASE_URL, BMA_PROJECT_ID
result = client.delete("/v1/machines/<machine_id>/agents/<agent_id>", cast_to=object)
print(result)
const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.beeos.ai/v1/machines/{machine_id}/agents/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import (
"context"
"fmt"
"log"
"net/http"
bmasdk "github.com/beeos-ai/bma-sdk/v4"
)
client := bmasdk.NewClient() // BMA_API_KEY, BMA_BASE_URL, BMA_PROJECT_ID
var res map[string]any
err := client.Execute(context.TODO(), http.MethodDelete, "v1/machines/<machine_id>/agents/<agent_id>", nil, &res)
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
{
"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>"
}Unbind an agent from a machine
Removes one agent from a machine’s agent_ids, atomically against concurrent agent changes of the machine; an agent not bound is a no-op (200). Removing the last agent is refused with 400 validation_failed: an empty agent_ids opens the machine to every agent of its workspace, which only an explicit agent_ids: [] (updateMachine) does. The managers of the workspace that owns the machine may change it.
curl -sS -X DELETE "$BMA_BASE_URL/v1/machines/<machine_id>/agents/<agent_id>" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"from bma_sdk import Bma
client = Bma() # BMA_API_KEY, BMA_BASE_URL, BMA_PROJECT_ID
result = client.delete("/v1/machines/<machine_id>/agents/<agent_id>", cast_to=object)
print(result)
const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.beeos.ai/v1/machines/{machine_id}/agents/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import (
"context"
"fmt"
"log"
"net/http"
bmasdk "github.com/beeos-ai/bma-sdk/v4"
)
client := bmasdk.NewClient() // BMA_API_KEY, BMA_BASE_URL, BMA_PROJECT_ID
var res map[string]any
err := client.Execute(context.TODO(), http.MethodDelete, "v1/machines/<machine_id>/agents/<agent_id>", nil, &res)
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
{
"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>"
}响应
The machine after the change.
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