Query host types

2024-11-06 03:13:28  Updated

Description

You can call this operation to query host types.

Call description

Prerequisite

You have the HOST_VIEWER permissions.

Request path

GET /api/v2/compute/hostTypes

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 HostType array. 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 HostType

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 time when the host type was created.
updateTime String The time when the host type was modified.

Examples

Sample request

GET /api/v2/compute/hostTypes?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": "a83ad33525",
  "status": 200,
  "successful": true,
  "timestamp": "2021-08-25T16:24:52.687+08:00",
  "traceId": "1500d28ffdc84801"
}

Contact Us