Queries the status information of multiple Elastic Compute Service (ECS) instances.

Description

  • For information about the lifecycle states of an ECS instance, see Instance states.
  • You can also call this operation to query the list of ECS instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeInstanceStatus

The operation that you want to perform. Set the value to DescribeInstanceStatus.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

ZoneId String No cn-hangzhou-d

The zone ID of the instance. You can call the DescribeZones operation to query the most recent zone list.

ClusterId String No cls-bp67acfmxazb4p****

The cluster ID of the instance.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

PageSize Integer No 10

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

Default value: 10.

InstanceId.N String No i-bp1j4i2jdf3owlhe****

The ID of instance N. Valid values of N: 1 to 100. When you specify multiple instance IDs, separate the IDs with commas (,). Example: ["bp1j4i2jdf3owlhe****","i-bp1j4i2jdf3o1234****"].

Response parameters

Parameter Type Example Description
PageSize Integer 1

The number of entries returned per page.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 58

The total number of instances.

InstanceStatuses Array of InstanceStatus

The status information of the instances.

InstanceStatus
Status String Running

The state of the instance. Valid values:

  • Pending: The instance is being created.
  • Running: The instance is running.
  • Starting: The instance is being started.
  • Stopping: The instance is being stopped.
  • Stopped: The instance is stopped.
InstanceId String i-bp1j4i2jdf3owlhe****

The ID of the instance.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=DescribeInstanceStatus
&ResourceOwnerId=155780923770
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-d
&ClusterId=cls-bp67acfmxazb4p****
&PageNumber=1
&PageSize=10
&InstanceId=["i-bp1j4i2jdf3owlhe****"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeInstanceStatusResponse>
    <PageNumber>1</PageNumber>
    <InstanceStatuses>
        <InstanceStatus>
            <Status>Running</Status>
            <InstanceId>i-bp1j4i2jdf3owlhe****</InstanceId>
        </InstanceStatus>
    </InstanceStatuses>
    <TotalCount>58</TotalCount>
    <PageSize>1</PageSize>
    <RequestId>746C3444-9A24-4D7D-B8A8-DCBF7AC8BD66</RequestId>
</DescribeInstanceStatusResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageNumber" : 1,
  "InstanceStatuses" : {
    "InstanceStatus" : [ {
      "Status" : "Running",
      "InstanceId" : "i-bp1j4i2jdf3owlhe****"
    } ]
  },
  "TotalCount" : 58,
  "PageSize" : 1,
  "RequestId" : "746C3444-9A24-4D7D-B8A8-DCBF7AC8BD66"
}

Error codes

For a list of error codes, visit the API Error Center.