Get VM State Counts
/projects/:projectId/vms/state-countsReturns the number of virtual machines in the project, broken down by lifecycle status and by power state.
Use this instead of counting a paged VM list on the client: the counts are computed server-side
and stay accurate no matter how many VMs the project has. total is the number of VMs in
the project. The response also has two breakdowns.
byStatus reports the number of VMs in each lifecycle status; every status is always
present (a status with no VMs is 0), the fields sum to the project's total VM count, and
each field equals the number of VMs the list endpoint returns for the matching status==
filter on the same data. byPowerState reports running/stopped counts; VMs
that do not have a power state yet (still being created) are excluded, so its fields can sum to
less than the total. The counts are not cached, so two calls made while VMs are changing may
differ.
Request
Responses
- 200
- 404
The VM state counts for the project.
The project was not found.