All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceStatus

Last Updated:Oct 21, 2024

Queries the status of one or more Elastic Compute Service (ECS) instances.

Operation 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

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

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
ZoneIdstringNo

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

cn-hangzhou-d
ClusterIdstringNo

The cluster ID of the instances.

cls-bp67acfmxazb4p****
PageNumberintegerNo

The page number.

Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Valid values: 1 to 50.

Default value: 10.

10
InstanceIdarrayNo

The IDs of the instances. When you use this parameter to specify multiple instance IDs, separate the IDs with commas(,). Example: InstanceId.1=i-bp1j4i2jdf3owlhe****, InstanceId.2=i-bp1j4i2jdf3o1234****.

stringNo

The IDs of the instances. When you use this parameter to specify multiple instance IDs, separate the IDs with commas(,). Example: InstanceId.1=i-bp1j4i2jdf3owlhe****, InstanceId.2=i-bp1j4i2jdf3o1234****.

i-bp1j4i2jdf3owlhe****

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries per page.

1
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberinteger

The page number.

1
TotalCountinteger

The total number of instances.

58
InstanceStatusesarray<object>

The status information of the instances.

InstanceStatusobject
Statusstring

The status 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.
Running
InstanceIdstring

The ID of the instance.

i-bp1j4i2jdf3owlhe****

Examples

Sample success responses

JSONformat

{
  "PageSize": 1,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "TotalCount": 58,
  "InstanceStatuses": {
    "InstanceStatus": [
      {
        "Status": "Running",
        "InstanceId": "i-bp1j4i2jdf3owlhe****"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
403InvalidParameter.TooManyInstanceIdsInstance ids cannot be more than 100.-
403Abs.InvalidInstanceIds.MalFormedThe specified instanceIds is not valid.-
404InvalidZoneId.NotFoundThe ZoneId provided does not exist in our records.The specified zone ID does not exist.

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