Skip to main content
System Global Type/Available Resource Query Operations

GetCpuMemoryCapacity

GetCpuMemoryCapacity

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

Operation ID

GetCpuMemoryCapacity

Since

0.6

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

Query Parameters

  • zoneUuids
    List

    Optional. The zone UUID list.

  • clusterUuids
    List

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

  • hostUuids
    List

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

  • all
    boolean

    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.

  • hypervisorType
    String

    Optional. The hypervisor type.

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • totalCpu
    longRequired

    The total CPU count.

  • availableCpu
    longRequired

    The available CPU count.

  • totalMemory
    longRequired

    The total memory.

  • availableMemory
    longRequired

    The available memory.

  • managedCpuNum
    longRequired

    The number of managed host CPUs.

  • resourceType
    StringRequired

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

  • success
    booleanRequired

    Whether the API succeeds.

  • error
    ErrorCodeRequired

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

    • code
      StringRequired

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

    • description
      StringRequired

      The brief description of the error.

    • details
      StringRequired

      The details about the error.

    • elaboration
      StringRequired

      The reserved field. Default value: null.

    • opaque
      LinkedHashMapRequired

      The reserved field. Default value: null.

    • cause
      ErrorCodeRequired

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

  • capacityData
    ListRequired

    See capacityData.

    • resourceUuid
      StringRequired

      The resource UUID.

    • totalCpu
      longRequired

      The total CPU count.

    • availableCpu
      longRequired

      The available CPU count.

    • totalMemory
      longRequired

      The total memory.

    • availableMemory
      longRequired

      The available memory.

    • managedCpuNum
      longRequired

      The number of managed host CPUs.

  • error
    ErrorCodeRequired

    See error.

    • code
      StringRequired

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

    • description
      StringRequired

      The brief description of the error.

    • details
      StringRequired

      The details about the error.

    • elaboration
      StringRequired

      The reserved field. Default value: null.

    • opaque
      LinkedHashMapRequired

      The reserved field. Default value: null.

    • cause
      ErrorCodeRequired

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