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

Querying Host Metric Data

Function

Query host metric data.

SLA Item

Definition

Request success rate

≥ 99.9%

Availability

Tier 1

Data consistency

Eventual consistency can be achieved. The duration of inconsistency is less than 1 minute.

Throughput

4000 TPS

TP50 request latency

2 ms

TP99.9 request latency

5 ms

Precautions

None

Calling Method

GET

URI

/rest/dataapi/homs/open-api/v1/host/metricdata

Path parameters

None

Query parameters

Parameter

Mandatory

Type

Value Range

Description

host_id

Yes

string

None

Host ID

begin_time

Yes

integer

None

Start time

end_time

Yes

integer

None

End time

offset_value

No

integer

None

Offset: greater than or equal to 0

page_size

No

integer

0–1000

Page size: greater than or equal to 0

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

    No

    string

    None

    ID of the accessed tenant. This parameter is mandatory only in HCS Online scenarios.

    x-hcso-appcode

    Yes

    string

    None

    AppCode allocated by SRE

  • Request body parameters

    None

  • Sample request
    GET /rest/dataapi/homs/open-api/v1/host/metricdata 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
    • Response status code 200: The Data object is returned. The Data object has the following attributes.

      Parameter

      Mandatory

      Type

      Value Range

      Description

      total

      Yes

      int32

      None

      Total number of data records

      list

      Yes

      List<Item>

      None

      Process object information

      The Item object has the following attributes.

      Parameter

      Mandatory

      Type

      Value Range

      Description

      time_stamp

      Yes

      Int64

      None

      Timestamp

      monitor_item

      Yes

      string

      None

      Monitor ID

      region_id

      Yes

      String

      None

      Region ID

      az_name

      No

      string

      None

      AZ name

      metrics_name

      Yes

      string

      None

      Metric name

      The involved 19 metrics are as follows:

      CPU usage

      Memory usage

      Disk usage

      Average system load

      System uptime

      Disk I/O read requests per second

      Disk write I/O requests per second

      Disk I/O usage

      Average time consumed by disk I/O read requests

      Average time consumed by disk I/O write requests

      Disk I/O access duration

      Bytes received by a NIC

      Bytes sent by a NIC

      NIC speed

      Error rate of packets received by NIC

      Loss rate of packets received by NIC

      Loss rate of packets sent by NIC

      Error rate of packets sent by NIC

      NIC status

      operator

      No

      string

      None

      Operator

      host_id

      Yes

      string

      None

      Host ID

      az_id

      No

      string

      None

      AZ ID

      unit

      No

      string

      None

      Metric unit

      region_name

      No

      string

      None

      Region name

      data_item

      Yes

      string

      None

      Data item

      metrics_value

      No

      Float64

      None

      Metric value

  • 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": Total number",
        "list": [
                 {
                 "time_stamp": "Timestamp",
                 "monitor_item": "Monitor project",
                 "region_id": "Region ID",
                 "az_name": "AZ name",
                 "metrics_name": "Metric name",
                 "operator": "Operator",
                 "host_id": "Host ID",
                 "az_id": "AZ ID",
                 "unit": "Metric unit",
                 "region_name": "Region name",
                 "data_item": "Data item",
                 "value": "Metric value"
                  }
                ]
    }

Status code

Status code

Description

200

Operation successful.

400

Parameter error.

401

Token authentication failed.

403

Authentication failed.

404

The API was not found.

Operation Severity

Minor