Query instance status

Last Updated: Jul 25, 2017

Description

Obtain the list of all the instances of the current user in batches with status information. For details, see Instance Status List.

Special limitations on RAM-assisted cross-account resource operations

The status of only the first 100 instances can be queried. If a combination of PageNumber and PageSize exceeds this limit, the request is denied, and the error code is Forbidden.AccessTooManyOthersResource.

In a response, TotalCount indicates how many instances out of all the instances of ResourceOwner grant the caller permission to perform this operation. When the number of instances is more than 100, TotalCount is set to 100.

Request Parameters

Name Type Required Description
Action String Yes Operation interface name, required parameter, with a value: DescribeInstanceStatus.
RegionId String Yes The Region ID of instance.See Regions and zones for region IDs.
ZoneId String No ID of the zone to which an instance belongs.
PageNumber Integer No Page number of the instance status list. The start value is 1. The default value is 1.
PageSize Integer No Sets the number of lines per page for queries per page. The maximum value is 50. The default value is 10.

Return Parameters

Name Type Description
TotalCount Integer The total number of instances.
PageNumber Integer The page number of the instance list.
PageSize Integer The number of lines per page set during input.
InstanceStatuses InstanceStatusSetType An array format composed of InstanceStatusItemType. It returns the status information of an instance.

Error Code

Error Code Description Http status code Meaning
MissingParameter The input parameter RegionId that is mandatory for processing this request is not supplied. 400 RegionId value missing. See Regions and zones for region IDs.
InvalidParameter The specified parameter PageNumber is not valid. 400 The specified PageNumber is invalid (not a numeral).
InvalidParameter The specified parameter PageSize is not valid. 400 The specified PageSize is invalid (not a numeral or beyond permitted range).

Examples

Request Example

  1. https://ecs.aliyuncs.com/?Action=DescribeInstanceStatus
  2. &RegionId=cn-hangzhou
  3. &<Public Request Parameters>

Return Example

XML format

  1. <DescribeInstanceStatusResponse>
  2. <RequestId>6EF60BEC-0242-43AF-BB20-270359FB54A7</RequestId>
  3. <TotalCount>2</TotalCount>
  4. <PageNumber>1</PageNumber>
  5. <PageSize>10</PageSize>
  6. <InstanceStatuses>
  7. <InstanceStatus>
  8. <InstanceId>i-instance1</InstanceId>
  9. <Status>Running</Status>
  10. </InstanceStatus>
  11. <InstanceStatus>
  12. <InstanceId>i-ae4r89pp</InstanceId>
  13. <Status>Stopped</Status>
  14. </InstanceStatus>
  15. </InstanceStatuses>
  16. </DescribeInstanceStatusResponse>

JSON format

  1. {
  2. "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
  3. "TotalCount": 2,
  4. "PageNumber": 1,
  5. "PageSize": 10,
  6. "InstanceStatuses": {
  7. "InstanceStatus": [{
  8. "InstanceId": "i-instance1",
  9. "Status": "Running"
  10. },
  11. {
  12. "InstanceId": "i-ae4r89pp",
  13. "Status": "Stopped"
  14. }]
  15. }
  16. }
Thank you! We've received your feedback.