All Products
Search
Document Center

ListInstance

Last Updated: Apr 01, 2021

Description

Queries the details of one or more instances. The returned instances are arranged in descending order based on the values of the GmtCreate parameter. You can specify multiple request parameters. These request parameters can be used to filter query results. The request parameters that you specify have logical AND relations. Only the specified parameters can be used to filter query results.

Method

GET

URI

/openapi/instances

Request parameters

Parameter

Type

Required

Description

Name

String

No

The name of the instance. Fuzzy match is supported.

InstanceId

String

No

The ID of the instance. Fuzzy match is supported.

status

String

No

The status of the instance. Valid values: Running, Ready, Initializing, and Starting.

expiredTime

Long

No

The time when the instance expires. The value of this parameter must be accurate to the second. Only instances whose expiration time is greater than the value of this parameter will be returned.

Page

Integer

No

The number of the page to return. Default value: 1.

Size

Integer

No

The number of entries to return on each page. Valid values: 1 to 50. Default value: 10.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request.

Result

List<Instance>

The instances returned.

Headers

Map

Details about the headers.

X-Total-Count

Integer

The total number of instances returned.

Examples

Sample requests

GET /openapi/instances?name=test&instanceId=abc&page=1&size=10

Sample success responses

JSON format

{
  "Result": [
    {
      "InstanceId": "airec-cn-xxxxxx",
      "Name": "airec-cn-xxxxxx",
      "Type": "Standard",
      "Status": "Running",
      "Industry": "content",
      "Scene": "gul",
      "RegionId": "cn-hangzhou",
      "ChargeType": "PrePaid",
      "CommodityCode": "airecpre",
      "GmtCreate": "2018-11-24T01:42:03.000Z",
      "GmtModified": "2018-11-24T01:45:09.000Z",
      "ExpiredTime": "2018-11-25T01:42:00.000Z",
      "LockMode": "Unlock"
    },
    {
      "InstanceId": "airec-cn-xxxxxx",
      "Name": "xxxxxx",
      "Type": "Standard",
      "Status": "Running",
      "Industry": "news",
      "Scene": "gul",
      "RegionId": "cn-hangzhou",
      "ChargeType": "PrePaid",
      "DataSetVersion": "20181122115505",
      "CommodityCode": "airecpre",
      "GmtCreate": "2018-11-22T03:51:46.000Z",
      "GmtModified": "2018-11-22T09:50:36.000Z",
      "ExpiredTime": "2018-11-23T03:51:44.000Z",
      "LockMode": "Unlock"
    }
  ],
  "RequestId": "76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF",
  "Headers": {
    "X-Total-Count": 19
  }
}

Sample success responses with no results

{
    "RequestId":"8F81A922-6C81-46D6-B78C-CC35E16B1691",
    "Result":[]
}

Sample error responses

JSON format

{
    "Code": "InstanceNotFound",
    "Message": "The specified instance does not exist. Check the instanceId please.",
    "RequestId": "829F38F6-E2D6-4109-90A6-888160BD16C2"
}