Skip to content

GET /api/capacity

Updated

Read the host capacity snapshot.

PropertyValue
Scoperead
Request bodynone
Success200 OK

Endpoint

GET ${baseUrl}/api/capacity
read

Read CPU, memory, VM count, and allocation totals for one Lite host.

Use your host URL and API key as shell variables:

baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"

cURL template

curl --request GET "${baseUrl}/api/capacity" \
  --header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
LocationNameTypeRequiredDescription
HeaderAuthorizationbearer tokenyesBearer ${VIRT_AGENT_API_KEY}.

Returns one JSON object.

FieldTypeDescription
host_vcpusintegerPhysical CPU count on this Lite host.
host_memory_mbintegerPhysical memory in MiB.
allocatable_vcpusintegerConfigured vCPU allocation threshold after overcommit policy.
allocatable_memory_mbintegerConfigured memory allocation threshold in MiB.
running_vcpusintegervCPUs currently used by running VMs.
running_memory_mbintegerMemory currently used by running VMs, in MiB.
committed_vcpusintegervCPUs committed by created, running, and stopped VMs. Failed VMs are excluded.
committed_memory_mbintegerMemory committed by created, running, and stopped VMs. Failed VMs are excluded.
vm_countintegerNumber of VMs known to this host.
running_countintegerNumber of VMs in running state.
Terminal window
baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"
curl "${baseUrl}/api/capacity" \
--header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
{
"host_vcpus": 16,
"host_memory_mb": 32768,
"allocatable_vcpus": 16,
"allocatable_memory_mb": 28672,
"running_vcpus": 4,
"running_memory_mb": 4096,
"committed_vcpus": 6,
"committed_memory_mb": 8192,
"vm_count": 3,
"running_count": 2
}
StatusCodeDescription
401UNAUTHORIZEDAPI key is missing or invalid.
403FORBIDDENAPI key is valid but not allowed to access the endpoint.