Aliyun How to use the Query instance state interface

Source: Internet
Author: User
Tags error code aliyun

Query instance Status

Describe

To obtain the status information of all instances of the current user in batches, and also to obtain the instance list, see the Instance state table.

Special restrictions on the use of RAM for authorized access to resource operations

Only the state of the first 100 instances is allowed, and if the value of the combination of pagenumber and PageSize exceeds this limit, the request is rejected with the error code: Forbidden.accesstoomanyothersresource.

In response, TotalCount says: In all instances of Resourceowner, how many instances have been granted to the caller for that operation. When the number exceeds 100, the TotalCount value is 100.

Request parameters

name type must describe
action operation interface name, system specified parameters, values: Describeinstancestatus
string style= border:0;padding:0 "Region;" /tr>
string no The available zone for instance
pagenumb Er integer instance status list, with a starting value of 1 and a default value of1
pagesize integer< /td>

return parameters

name type Description
TotalCount Integer Total number of instances
PageNumber Integer Number of instance List
PageSize Integer Number of rows per page set when entering
Instancestatuses Instancestatussettype An array format consisting of Instancestatusitemtype that returns the state information of an instance

Error code

TD style= "BORDER:0;PADDING:0;" >invalidparameter
error code Description Http status code semantics
missingparameter the input parameter "RegionID" that are mandatory for processi Ng this request are not supplied. 400 missing RegionID value
400
invalidparameter the specified Meter "PageSize" is not valid. 400 PageSize >

Example

Request sample

Https://ecs.aliyuncs.com/?Action=DescribeInstanceStatus

&regionid=cn-hangzhou

&< Public Request Parameters >

Return sample

XML format

  

6ef60bec-0242-43af-bb20-270359fb54a7

2

1

10

  

  

I-instance1

Running

  

  

i-ae4r89pp

Stopped

  

  

  

JSON format

{

"RequestID": "6ef60bec-0242-43af-bb20-270359fb54a7",

"TotalCount": 2,

"PageNumber": 1,

"PageSize": 10,

"Instancestatuses": {

"Instancestatus": [{

"Instanceid": "I-instance1",

"Status": "Running"

},

{

"Instanceid": "i-ae4r89pp",

"Status": "Stopped"

}]

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.