Query IDCs

2023-08-15 11:20:59  Updated

Description

You can call this operation to query IDCs.

Call description

Prerequisite

You have the HOST_VIEWER permissions.

Request path

GET /api/v2/compute/idcs

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 IDC information. For more information about the data structure, see the following table.
├─ page Object The page information.
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.

Page parameters

Parameter Type Description
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.

Data structure of the IDC information

Parameter Type Description
id Long The ID of the IDC.
name String The name of the IDC.
description String The description of the IDC.
regionId Long The ID of the region associated with the IDC.
regionName String The name of the region associated with the IDC.
createTime String The time when the IDC was created.
updateTime String The time when the IDC was modified.

Examples

Sample request

GET /api/v2/compute/idcs?page=1&size=10

Sample response

{
  "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": "xx.xx.xx.xx",
  "status": 200,
  "successful": true,
  "timestamp": "2021-08-25T16:24:52.687+08:00",
  "traceId": "1500d28ffdc84801"
}

Contact Us