Help Center/ Enterprise Self-Service Management/ API Reference/ API/ Data Visualization/ Querying Capacities of Physical Resources
Updated on 2025-05-29 GMT+08:00

Querying Capacities of Physical Resources

Query the following available resource capacities of compute and storage resource pools:

  • Compute resource pools (physical compute clusters used to build resource pools): total capacities (vCPU cores/memory), allocated capacities (vCPU cores/memory), and remaining capacities (vCPUs/memory)
  • Storage resource pools (physical storage clusters used to build resource pools): total capacities (resource capacities of storage server clusters of different models such as SSD and SAS, in TB), allocated capacities, and remaining capacities

Function

Query the resource capacity of physical devices.

SLA Item

Definition

Request success rate

≥ 99%

Availability

Tier 2

Data consistency

Strongly consistent

Throughput

60 times/minute

TP50 request latency

200 ms

TP99.9 request latency

300 ms

Precautions

None

Calling Method

GET

URI

/rest/dataapi/homs/open-api/v1/host-physical/capacity

Path parameters

None

Query parameters

None

Request

  • Request header parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    X-APIG-Appcode

    Yes

    string

    None

    AppCode allocated by SRE

    x-auth-token

    Yes

    string

    None

    IAM authentication token for the calling party APIG

    x-hcso-domainid

    Yes (HCS Online scenario)

    No (other scenarios)

    string

    None

    ID of the accessed tenant.

    x-hcso-appcode

    Yes

    string

    None

    AppCode allocated by SRE

  • Query parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    device_type

    No

    string

    ECS/EVS

    Device type. Value ECS indicates the compute type (physical compute resources). Value EVS indicates the storage type (physical storage resources).

    zone_type

    No

    string

    manage/pod

    Zone type. Value manage indicates a management zone. Value pod indicates a tenant zone.

    begin_time

    Yes

    int

    None

    Start timestamp of the query, in milliseconds

    end_time

    Yes

    int

    None

    End timestamp of the query, in milliseconds

    page_size

    Yes

    int

    0~1000

    Page size

    offset_value

    Yes

    int

    None

    Query start value

  • Request body parameters

    None

  • Sample request
    GET /rest/dataapi/homs/open-api/v1/host-physical/capacity HTTP/1.1 
    Host: example.com
    Content-Type: application/json 
    Accept: application/json
    X-APIG-Appcode: xxx 
    x-auth-token: xxx 
    x-hcso-domainid: xxx
    x-hcso-appcode: xxx

Response

  • Response parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    code

    Yes

    String

    None

    Return code

    msg

    Yes

    String

    None

    Returned message

    total

    Yes

    Integer

    None

    Data records

    device_type

    No

    String

    None

    Physical device type. Value ECS indicates the compute type (physical compute servers). Value EVS indicates the storage type (physical storage servers).

    timestamp

    Yes

    Long

    None

    Timestamp

    region

    Yes

    String

    None

    Name of the region to which resources belong

    zone_type

    No

    String

    None

    Type of the region to which the resource belongs. The value can be MANAGE, POD, or KVM_POD.

    allocated

    Yes

    String

    None

    Allocated capacity. The vCPU unit is core, the memory unit is TB, and the storage unit is TB.

    avaliable

    Yes

    String

    None

    Remaining capacity. The vCPU unit is core, the memory unit is TB, and the storage unit is TB.

    resource_type

    No

    String

    None

    Specifications and model of a physical server, for example, C6XLarge physical compute server or SSD physical storage servers

    metric_type

    No

    String

    None

    Capacity metric type. The value varies depending on the value of device_type, the physical resource type (compute or storage).

  • Sample response
    HTTP/1.1 200 OK 
    Date:Tue,18 Jul 2023 09:58:01 GMT
    Server: example.com
    Content-Type: application/json;charset=UTF8 
    Storage
    { 
        "total": 2, 
        "list": [ 
                 { 
                  "available": "94.5693359375", 
                  "metric_type": "SAS", 
                  "device_type": "EVS", 
                  "zone_type": "MANAGE", 
                  "region": "cn-central-229", 
                  "allocated": "112.2265625", 
                  "resource_type": "SAS", 
                  "timestamp": "1649692800000" 
                  }, 
                 { 
                  "available": "102.4052734375", 
                  "metric_type": "SAS", 
                  "device_type": "EVS", 
                  "zone_type": "MANAGE", 
                  "region": "cn-east-264", 
                  "allocated": "173.3232421875", 
                  "resource_type": "SAS", 
                  "timestamp": "1649692800000" 
                  } 
                  ] 
    } 
    Compute
    { 
        "service_type": "ECS", 
        "total": "44.072265625", 
        "available": "26.486328125", 
        "metric_type": "memory", 
        "zone_type": "KVM_POD", 
        "used": "0", 
        "free": "44.072265625", 
        "used_ratio": "0", 
        "region": "cn-east-264", 
        "resource_count": "0", 
        "allocated": "15.2578125", 
        "resource_type": "C6xLarge", 
        "timestamp": "1649865600000" 
    }, 
    { 
        "service_type": "ECS", 
        "total": "10792", 
        "available": "5408", 
        "metric_type": "vCpu", 
        "zone_type": "KVM_POD", 
        "used": "0", 
        "free": "10792", 
        "used_ratio": "0", 
        "region": "cn-east-264", 
        "resource_count": "0", 
        "allocated": "4964", 
        "resource_type": "M6xLarge", 
        "timestamp": "1649865600000" 
    }

Status Codes

Status Code

Description

200

Operation successful.

400

Parameter error.

401

Token authentication failed.

403

Authentication failed.

404

The REST API was not found.

500

An internal application error occurred.

Operation Severity

Minor