Description
Queries host information based on the host type ID.
Call instructions
Interface constraints
The caller must have the HOST_VIEWER permission.
Request path
GET /api/v2/compute/hostTypes/{hostTypeId}
Request parameters
path:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| hostTypeId | Integer | Yes | 100 | Host type ID. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | An array of HostType objects. For more information, see HostType data structure. |
| ├─ page | Object | Paging information. For more information, see page data structure. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The server timestamp when the request was completed. |
| duration | Integer | The time taken by the server to process the request (in milliseconds). |
| status | Integer | An HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used for troubleshooting. |
| server | String | The IP address of the application service that responded to the request. |
HostType data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Long | Host type ID. |
| name | String | Host type name. |
| description | String | Description of the host type. |
| createTime | String | The time when the host type was created. |
| updateTime | String | The time when the host type was last modified. |
page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | Total number of records. |
| totalPages | Integer | Total number of pages. |
| number | Integer | Current page number. |
| size | Integer | The size of the current page. |
Examples
Request example
GET /api/v2/compute/hostTypes/100
Return example
{
"data": {
"contents": [
{
"createTime": "2024-12-31T18:01:34+08:00",
"description": null,
"id": 1,
"name": "ECS_8C64G",
"updateTime": "2024-12-31T18:01:34+08:00"
}
],
"page": {
"number": 1,
"size": 5000,
"totalElements": 1,
"totalPages": 1
}
},
"duration": 5823,
"server": "b3b6d90167",
"status": 200,
"successful": true,
"timestamp": "2025-04-27T11:01:59.503+08:00",
"traceId": "4ebe74db34f22716"
}
