Updated on 2025-05-29 GMT+08:00

Querying the DCC Capacity

Function

Query the total, allocated, and remaining quantities of DCC compute resources such as CPUs and memory.

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/CloudService/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

    begin_time

    Yes

    int

    None

    Start timestamp of the query, in milliseconds.

    end_time

    Yes

    int

    None

    End timestamp of the query, in milliseconds.

    service_type

    No

    String

    DCC

    Service type.

    zone_type

    No

    String

    DCC_POD

    DCC pod.

    page_size

    Yes

    int

    0~1000

    Page size.

    offset_value

    Yes

    int

    None

    Start value for the query.

  • Request body parameters

    None

  • Sample request
    GET /rest/dataapi/homs/open-api/v1/CloudService/capacity?service_type=DCC 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

    Response code.

    msg

    Yes

    String

    None

    Response message.

    total

    Yes

    Integer

    None

    Number of data records.

    service_type

    No

    String

    None

    Type of the cloud service to which the resource belongs. This parameter is fixed to DCC.

    timestamp

    Yes

    Long

    None

    Timestamp.

    region

    Yes

    String

    None

    Name of the region to which resources belong.

    zone_type

    No

    String

    None

    Region to which resources belong, which is fixed to DCC_POD (a tenant zone).

    total (in the list section)

    No

    String

    None

    How many CPU cores or what memory size in TB are available in total in the DCC resource pool.

    allocated

    Yes

    String

    None

    How many CPU cores or what memory size in TB have been allocated.

    metric_type

    No

    String

    None

    Capacity metrics including CPU and memory for the DCC resource pool.

    avaliable

    Yes

    String

    None

    How many CPU cores or what memory size in TB still remains.

  • 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 
    { 
        "total":33, 
        "list":[ 
                { 
                "service_type":"dcc", 
    "metric_type":"host/memory/vCPU",
    "total":"Total number of hosts, vCPU cores, or memory (TB)",
    "used":"Used capacity",
    "free":"Remaining capacity",
    "allocated":"Allocated capacity",
    "available":"Available capacity",
    "used_ratio":"Usage",
    "allocated_ratio":"Allocation rate",
                "resource_count":"null", 
                "zone_type":"DCC_POD", 
    "timestamp":"timestamp",
                "region":"cn-north-1" 
                 }
               ]
    }

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.