Help Center/ Enterprise Self-Service Management/ API Reference/ API/ Data Visualization/ Querying the Relationship Between Hosts and VMs
Updated on 2025-05-29 GMT+08:00

Querying the Relationship Between Hosts and VMs

Function

Query the relationship between hosts and VMs.

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

Path parameters

None

Query parameters

Parameter

Mandatory

Type

Value Range

Description

page_size

Yes

integer

Default value: 500

Page size: greater than or equal to 0

host_id

Yes

string

None

Host ID

offset_value

Yes

integer

None

Offset: 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 the HCS Online scenario.

    x-hcso-appcode

    Yes

    string

    None

    AppCode allocated by SRE

  • Request body parameters

    None

  • Sample request
    GET /rest/dataapi/homs/open-api/v1/host/vms?host_id=abfa96bc-29f6-4571-bfba-fcfdf6ad6ebb&offset_value=0&page_size=1
    Content-Type: application/json
    Accept: application/json
    X-Auth-Token: xxxxx
    x-hcso-appcode: xxxx

Response

  • Response parameters
  • Sample response
    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF8
    {
    	"total": 1,
    	"list": [
    		{
    			"region_id": "cn-north-7",
    			"host_name": "CN_NORTH_7_ECS",
                "vm_list": "[['', '', 'Euler', '[{"cores":"1","model":"","threads":"1","cpu":"16 * 1 * 1 * ","sockets":"16"}]']]",
                "host_id": "abfa96bc-29f6-4571-bfba-fcfdf6ad6ebb",
                "host_ip": "xx.xx.xx.xx",
                "last_update_time": "1726819320000"
    		}
    	]
    }

Status Codes

Status Code

Description

200

Query succeeded.

400

Parameter error.

401

Token authentication failed.

403

Authentication failed.

404

The API was not found.

Operation Severity

Minor