Skip to main content
System Global Type/Available Resource Query Operations
GETAvailable Resource Query OperationsSince 0.6SynchronousAuth Required

GetCpuMemoryCapacity

GetCpuMemoryCapacity

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Query Parameters

Request Inputs

Query Parameters

  • zoneUuidsList

    Optional. The zone UUID list.

  • clusterUuidsList

    Optional. The cluster UUID list used for attaching the network and the storage.

  • hostUuidsList

    Optional. The host UUID list used for adding and deleting the host.

  • allboolean

    Optional. Default value: false. When false, at least one of the zone UUID, cluster UUID, or host UUID is required, or all are required. When true, the zone UUID, cluster UUID, and host UUID are all optional.

  • hypervisorTypeString

    Optional. The hypervisor type.

Responses

200 OK

On success, this API returns the following response structure.

  • totalCpulongRequired

    The total CPU count.

  • availableCpulongRequired

    The available CPU count.

  • totalMemorylongRequired

    The total memory.

  • availableMemorylongRequired

    The available memory.

  • managedCpuNumlongRequired

    The number of managed host CPUs.

  • resourceTypeStringRequired

    The type of queried resources, such as the host, cluster, and zone.

  • successbooleanRequired

    Whether the API succeeds.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • capacityDataListRequired

    See capacityData.

    • resourceUuidStringRequired

      The resource UUID.

    • totalCpulongRequired

      The total CPU count.

    • availableCpulongRequired

      The available CPU count.

    • totalMemorylongRequired

      The total memory.

    • availableMemorylongRequired

      The available memory.

    • managedCpuNumlongRequired

      The number of managed host CPUs.

  • errorErrorCodeRequired

    See error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

Endpoint

GET/zstack/v1/hosts/capacities/cpu-memory

/zstack/v1/hosts/capacities/cpu-memory

Operation ID

GetCpuMemoryCapacity

Permalink

Request Example

curl -X GET 'http://{host}/zstack/v1/hosts/capacities/cpu-memory?zoneUuids=<zoneUuids>&clusterUuids=<clusterUuids>&hostUuids=<hostUuids>&all=True&hypervisorType=<hypervisorType>&systemTags=<systemTags>&userTags=<userTags>' -H 'Authorization: OAuth {sessionUuid}'

Response Example

200
{ "totalCpu": 4.0, "availableCpu": 2.0, "totalMemory": 8.0, "availableMemory": 4.0, "managedCpuNum": 4.0, "capacityData": [ { "resourceUuid": "db558260b0b53e36aa8ebf7e40c7c9c6", "totalCpu": 4.0, "availableCpu": 2.0, "totalMemory": 8.0, "availableMemory": 4.0, "managedCpuNum": 4.0 } ], "resourceType": "HostVO" }

Change History

This API has no change history records yet.

View all change history