Get running containers for workspace agent
GET
CoderSessionTokenheader
Coder-Session-Token<token>workspaceagent*stringWorkspace agent ID
Format
uuidlabel*stringLabels
Format
key=valueOK
application/json- response
containers?array<>Containers is a list of containers visible to the workspace agent.
devcontainers?array<>Devcontainers is a list of devcontainers visible to the workspace agent.
warnings?array<string>Warnings is a list of warnings that may have occurred during the process of listing containers. This should not include fatal errors.
The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/workspaceagents/{workspaceagent}/containers?label={label}" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"Example Response200
{ "containers": [ { "created_at": "2019-08-24T14:15:22Z", "id": "string", "image": "string", "labels": { "property1": "string", "property2": "string" }, "name": "string", "ports": [ { "host_ip": "string", "host_port": 0, "network": "string", "port": 0 } ], "running": true, "status": "string", "volumes": { "property1": "string", "property2": "string" } } ], "devcontainers": [ { "agent": { "directory": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "config_path": "string", "container": { "created_at": "2019-08-24T14:15:22Z", "id": "string", "image": "string", "labels": { "property1": "string", "property2": "string" }, "name": "string", "ports": [ { "host_ip": "string", "host_port": 0, "network": "string", "port": 0 } ], "running": true, "status": "string", "volumes": { "property1": "string", "property2": "string" } }, "dirty": true, "error": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "status": "running", "subagent_id": "7b85d465-b649-4b8b-9da8-5f731c1d294d", "workspace_folder": "string" } ], "warnings": [ "string" ]}