Description
You can call this operation to query regions.
Call description
Prerequisite
You have the HOST_VIEWER permissions.
Request path
GET /api/v2/compute/regions
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| page | Integer | No | 1 | The number of the page to return. Pages start from page 1. |
| size | Integer | No | 10 | The number of entries to return on each page. Maximum value: 2000. |
| sort | String | No | id,asc | The rule for sorting the requested data. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The array of the region information. For more information about the data structure, see the following table. |
| ├─ page | Object | The page information. |
| ├─ totalElements | Integer | The total number of entries. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The page number of the returned page. |
| ├─ size | Integer | The number of entries returned per page. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of the region information
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The ID of the region. |
| name | String | The name of the region. |
| description | String | The description of the region. |
| createTime | String | The time when the region information was created. |
| updateTime | String | The time when the region information was modified. |
Examples
Sample request
GET /api/v2/compute/regions?page=1&size=10
Sample response
{
"data": {
"contents": [
{
"createTime": "2021-07-22T20:04:15+08:00",
"id": 1000002,
"name": "testregion",
"updateTime": "2021-07-22T20:04:15+08:00"
},
{
"createTime": "2021-07-21T20:42:02+08:00",
"id": 1,
"name": "beijing",
"updateTime": "2021-07-21T20:42:02+08:00"
}
],
"page": {
"number": 1,
"size": 10,
"totalElements": 2,
"totalPages": 1
}
},
"duration": 29,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T15:54:02.484+08:00",
"traceId": "0aa496e9309747b2"
}