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

Querying the BMS Capacity

Function

Query the allocated and remaining quantities of provisioned BMSs with different specifications.

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

    BMS

    Service type

    zone_type

    No

    string

    BMS_POD

    BMS pod

    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/CloudService/capacity?service_type=BMS 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

    service_type

    No

    String

    None

    Cloud service name, which identifies the cloud service to which resources belong. For this API, the value can be BMS.

    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

    How many BMSs have been allocated

    available

    Yes

    String

    None

    How many BMSs still remain

    total (in the list section)

    Yes

    String

    None

    How many BMSs are available

    metric_type

    No

    String

    None

    BMS specifications, for example, physical.kd1ne.2xlarge

  • 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": 1, 
        "list": [ 
                 { 
                 "service_type": "BMS", 
                 "total": "4", 
                 "available": "4", 
                 "metric_type": "physical.kd1ne.2xlarge", 
                 "zone_type": "POD", 
                 "used": "0", 
                 "free": "0", 
                 "used_ratio": "0", 
                 "region": "cn-east-264", 
                 "resource_count": "0", 
                 "allocated": "0", 
                 "timestamp": "1650211200000" 
                  } 
                 ] 
    }

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.