Description
Queries the host type information list.
Call instructions
Interface constraints
The caller must have the HOST_VIEWER permission.
Request path
GET /api/v2/compute/hostTypes
Request parameters
body:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| page | Integer | No | 1 | The page number, which starts from 1. |
| size | Integer | No | 10 | The number of records per page. Default value: 10. Maximum value: 2000. |
| sort | String | No | id,asc | The sorting rule for the request data. |
Return results
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 | The pagination information. For more information, see page data structure. |
| successful | Boolean | Indicates whether the request succeeded. |
| timestamp | Datetime | The server timestamp when the request is completed. |
| duration | Integer | The time the server takes to process the request (in milliseconds). |
| status | Integer | The 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 address of the application service that responds to the request. |
HostType data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The ID of the host type. |
| name | String | The name of the host type. |
| description | String | The description of the host type. |
| createTime | String | The creation time of the host type. |
| updateTime | String | The modification time of the host type. |
page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | The total number of records. |
| totalPages | Integer | The total number of pages. |
| number | Integer | The current page number. |
| size | Integer | The number of records on the current page. |
Examples
Request example
GET /api/v2/compute/hostTypes?page=1&size=10
Return example
{
"data": {
"contents": [
{
"createTime": "2021-08-03T16:39:24+08:00",
"id": 1,
"name": "beijing",
"updateTime": "2021-08-03T16:39:24+08:00",
"descripiton":null
}
],
"page": {
"number": 1,
"size": 10,
"totalElements": 1,
"totalPages": 1
}
},
"duration": 14,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T16:24:52.687+08:00",
"traceId": "1500d28ffdc84801"
}
