All Products
Search
Document Center

OpenSearch:ListInstances

Last Updated:Oct 16, 2024

Queries a list of instances.

Operation description

Method

GET

URI

/openapi/ha3/instances

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
searchengine:ListInstancesget
  • Instance
    acs:searchengine:{#regionId}:{#accountId}:instance/*
    none
none

Request syntax

GET /openapi/ha3/instances HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
pageNumberintegerNo

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

1
pageSizeintegerNo

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

10
instanceIdstringNo

The instance ID.

ha-cn-83570439y0n
descriptionstringNo

The description of the instance. You can use this description to filter instances. Fuzzy match is supported.

Havenask instance
resourceGroupIdstringNo

The ID of the resource group to which the instance belongs.

rg-aekzgpiswzbksdi
editionstringNo

The instance type. Valid values: vector: OpenSearch Vector Search Edition instance. engine: OpenSearch Retrieval Engine Edition instance.

vector
tagsarray<object>No

The tags of the instance.

objectNo
keystringNo

The tag key.

backup
valuestringNo

The tag value.

oboms-disk
ParameterTypeRequiredDescription
statusStringNoThe status of the instance. You can filter instances by status. Valid values: Running, Ready, Initializing,Starting
expiredTimeLongNoThe 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. The instances that have already expired will not be returned.

Example

Sample requests

GET /openapi/ha3/instances?name=test&#x26;instanceId=abc&#x26;page=1&#x26;size=10

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

resultarray<object>

The results returned.

resultobject

InstanceItemType

descriptionstring

The description of the instance.

Emergency test
resourceGroupIdstring

The ID of the resource group.

rg-aekzgpiswzbksdi
expiredTimestring

The time when the instance expires.

1634885083
commodityCodestring

The commodity code of the instance.

""
statusstring

The instance status.

2
instanceIdstring

The instance ID.

ha-cn-2r42n8oh001
createTimestring

The time when the instance was created.

2022-06-04T02:03:21Z
lockModestring

The lock state of the instance.

Unlock
chargeTypestring

The billing method.

PrePaid
updateTimestring

The time when the instance was updated.

2018-12-06T11:17:49.0
inDebtboolean

Indicates whether an overdue payment is involved.

false
networkobject

The network information of the instance.

vSwitchIdstring

The vSwitch ID.

vsw-bp11ldcf59q2nbwkqgj6z
vpcIdstring

The ID of the virtual private cloud (VPC) in which the instance is deployed.

vpc-wz9axk41d9vffoc79x0oe
endpointstring

The instance endpoint.

""
tagsarray<object>

The tags of the instance.

tagsobject
keystring

The tag key.

env
valuestring

The tag value.

oboms-disk
totalCountinteger

The total number of entries returned

5
requestIdstring

The ID of the request

89B968E6-1E41-58DF-BB25-5F98ECC759CE

Sample responses

Sample success responses

{
    "requestId": "90D6B8F5-FE97-4509-9AAB-367836C51818",
    "result": [
        {
            "instanceId": "igraph-cn-xxxxxx1",
            "spec": {
                "password": "passwd",
                "searchResource": {
                    "disk": 50,
                    "mem": 8,
                    "cpu": 2,
                    "nodeCount": 2
                },
                "instanceName": "testInstance",
                "vSwitchId": "vswitch_id_xxx",
                "vpcId": "vpc_id_xxx",
                "qrsResource": {
                    "disk": 50,
                    "mem": 8,
                    "cpu": 2,
                    "nodeCount": 2
                },
                "region": "cn-hangzhou",
                "userName": "user"
            },
            "status": {
                "phase": "PENDING",
                "instancePhase": "INIT",
                "createSuccess": false
            }
        },
        {
            "instanceId": "igraph-cn-xxxxxx2",
            "spec": {
                "password": "passwd",
                "searchResource": {
                    "disk": 50,
                    "mem": 8,
                    "cpu": 2,
                    "nodeCount": 2
                },
                "instanceName": "testInstance",
                "vSwitchId": "vswitch_id_xxx",
                "vpcId": "vpc_id_xxx",
                "qrsResource": {
                    "disk": 50,
                    "mem": 8,
                    "cpu": 2,
                    "nodeCount": 2
                },
                "region": "cn-hangzhou",
                "userName": "user"
            },
            "status": {
                "phase": "PENDING",
                "instancePhase": "INIT",
                "createSuccess": false
            }
        }
    ],
    "totalCount": 20
}

Sample error responses

{
  "requestId": "BD1EA715-DF6F-06C2-004C-C1FA0D3A9820",
  "httpCode": 404,
  "code": "App.NotFound",
  "message": "App not found"
}

Examples

Sample success responses

JSONformat

{
  "result": [
    {
      "description": "Emergency test\n",
      "resourceGroupId": "rg-aekzgpiswzbksdi",
      "expiredTime": "1634885083",
      "commodityCode": "\"\"",
      "status": "2",
      "instanceId": "ha-cn-2r42n8oh001",
      "createTime": "2022-06-04T02:03:21Z",
      "lockMode": "Unlock",
      "chargeType": "PrePaid",
      "updateTime": "2018-12-06T11:17:49.0",
      "inDebt": false,
      "network": {
        "vSwitchId": "vsw-bp11ldcf59q2nbwkqgj6z",
        "vpcId": "vpc-wz9axk41d9vffoc79x0oe",
        "endpoint": "\"\""
      },
      "tags": [
        {
          "key": "env",
          "value": "oboms-disk"
        }
      ]
    }
  ],
  "totalCount": 5,
  "requestId": "89B968E6-1E41-58DF-BB25-5F98ECC759CE"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-17The response structure of the API has changedView Change Details
2024-06-28The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-01-12Add OperationView Change Details