You can call this operation to query instances in an auto provisioning group.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
AutoProvisioningGroupId String Yes apg-uf6jel2bbl62wh13****

The ID of the auto provisioning group for which to query instances.

RegionId String Yes cn-hangzhou

The region ID of the auto provisioning group.

Action String No DescribeAutoProvisioningGroupInstances

The operation that you want to perform. Set this parameter to DescribeAutoProvisioningGroupInstances.

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. Maximum value: 100. Default value: 10.

Response parameters

Parameter Type Example Description
Instances

The information about all the instances in the auto provisioning group.

  └CPU Integer 2

The number of vCPUs.

  └CreationTime String 2017-12-10T04:04Z

The time when the instance was created.

  └InstanceId String i-instanc****

The ID of the instance.

  └InstanceType String ecs.g5.large

The type of the instance.

  └IoOptimized Boolean true

Indicates whether the instance is I/O optimized.

  └IsSpot Boolean true

Indicates whether the instance is preemptible.

  └Memory Integer 1024

The memory size of the instance. Unit: MiB.

  └NetworkType String vpc

The network type of the instance. Valid values:

  • vpc
  • classic
  └OsType String linux

The operating system type of the instance. Valid values:

  • windows
  • linux
  └RegionId String cn-hangzhou

The region ID of the instance.

  └Status String Running

The status of the instance.

  └ZoneId String cn-hangzhou-g

The zone ID of the instance.

PageNumber Integer 1

The number of the page to return.

PageSize Integer 10

The number of entries to return on each page.

RequestId String B48A12CD-1295-4A38-A8F0-0E92C937****

The ID of the request.

TotalCount Integer 10

The number of queried instances in the auto provisioning group.

Examples

Sample requests


http(s)://ecs.aliyuncs.com/? Action=DescribeAutoProvisioningGroupInstances
$AutoProvisioningGroupId=apg-uf6jel2bbl62wh13****
&<Common request parameters>

Sample success responses

XML format

<DescribeAutoProvisioningGroupInstancesResponse>
  <PageNumber>1</PageNumber>
  <TotalCount>100</TotalCount>
  <PageSize>2</PageSize>
  <RequestId>A43735F7-30BD-4D89-AB8A-030EB24B****</RequestId>
  <Instances>
    <Instance>
      <CreationTime>2019-06-17T15:25Z</CreationTime>
      <IoOptimized>true</IoOptimized>
      <OsType>linux</OsType>
      <NetworkType>vpc</NetworkType>
      <Status>Running</Status>
      <Memory>8192</Memory>
      <RegionId>cn-shanghai</RegionId>
      <InstanceId>i-uf64neea72piruk0****</InstanceId>
      <CPU>2</CPU>
      <ZoneId>cn-shanghai-a</ZoneId>
      <InstanceType>ecs.g5.large</InstanceType>
    </Instance>
    <Instance>
      <CreationTime>2019-06-17T15:25Z</CreationTime>
      <IoOptimized>true</IoOptimized>
      <OsType>linux</OsType>
      <NetworkType>vpc</NetworkType>
      <Status>Running</Status>
      <Memory>8192</Memory>
      <RegionId>cn-shanghai</RegionId>
      <InstanceId>i-uf64neea72piruk0****</InstanceId>
      <CPU>2</CPU>
      <ZoneId>cn-shanghai-a</ZoneId>
      <InstanceType>ecs.g5.large</InstanceType>
    </Instance>
  </Instances>
</DescribeAutoProvisioningGroupInstancesResponse>

JSON format

{
	"PageNumber":1,
	"TotalCount":100,
	"PageSize":2,
	"RequestId":"A43735F7-30BD-4D89-AB8A-030EB24B****",
	"Instances":{
		"Instance":[
			{
				"IoOptimized":true,
				"CreationTime":"2019-06-17T15:25Z",
				"Status":"Running",
				"NetworkType":"vpc",
				"OsType":"linux",
				"Memory":8192,
				"InstanceId":"i-uf64neea72piruk0****",
				"RegionId":"cn-shanghai",
				"CPU":2,
				"ZoneId":"cn-shanghai-a",
				"InstanceType":"ecs.g5.large"
			},
			{
				"IoOptimized":true,
				"CreationTime":"2019-06-17T15:25Z",
				"Status":"Running",
				"NetworkType":"vpc",
				"OsType":"linux",
				"Memory":8192,
				"InstanceId":"i-uf64neea72piruk0****",
				"RegionId":"cn-shanghai",
				"CPU":2,
				"ZoneId":"cn-shanghai-a",
				"InstanceType":"ecs.g5.large"
			}
		]
	}
}

Error codes

HTTP status code Error code Error message  Description
403 Forbidden.RAM User not authorized to operate on the specified resource, or this API doesn't support RAM. The error message returned because the RAM user is not authorized.
400 MissingParamter.RegionId The regionId should not be null. The error message returned because the RegionId parameter is not specified.

View error codes