You can call this operation to query auto provisioning groups.

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
RegionId String Yes cn-hangzhou

The region ID of the auto provisioning group.

Action String No DescribeAutoProvisioningGroups

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

AutoProvisioningGroupId.N RepeatList No apg-sn54avj8htgvtyh8****

The ID of the auto provisioning group to be queried.

AutoProvisioningGroupName String No test

The name of the auto provisioning group to be queried.

AutoProvisioningGroupStatus.N RepeatList No active

The status of the auto provisioning group to be queried. Valid values:

  • submitted: The auto provisioning group has been created but has not started to execute scheduling tasks.
  • active: The auto provisioning group is executing scheduling tasks.
  • deleted: The auto provisioning group has been deleted.
  • deleted-running: The auto provisioning group is being deleted.
  • modifying: The auto provisioning group is being modified.
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
AutoProvisioningGroups

The information about queried auto provisioning groups.

  └AutoProvisioningGroupId String apg-sn54avj8htgvtyh8****

The ID of the auto provisioning group.

  └AutoProvisioningGroupName String apg-test

The name of the auto provisioning group.

  └AutoProvisioningGroupType String maintain

The type of the auto provisioning group. Valid values:

  • request: The one-time delivery type. After the auto provisioning group is started, it only attempts to create an instance cluster once. If the cluster fails to be created, the group does not try again.
  • maintain: The continuous delivery and maintain capacity type. After the auto provisioning group is started, it continuously attempts to create and maintain the instance cluster. The auto provisioning group compares the real-time and target capacity of the cluster. If the cluster does not meet the target capacity, the group will create instances until the cluster meets the target capacity.
  └CreationTime String 2019-04-01T15:10:20Z

The time when the auto provisioning group was created.

  └ExcessCapacityTerminationPolicy String termination

The shutdown policy of the auto provisioning group for excess preemptible instances when the target capacity has been exceeded. Valid values:

  • no-termination: Excess preemptible instances are not shut down.
  • termination: Excess preemptible instances are to be shut down. The action to be performed on these shutdown instances is specified by the SpotInstanceInterruptionBehavior parameter.
Note The SpotInstanceInterruptionBehavior parameter is set during the auto provisioning group creation process and cannot be modified. For more information, see CreateAutoProvisioningGroup.
  └LaunchTemplateConfigs

The extended configurations of the launch template for the auto provisioning group.

    └InstanceType String ecs.g5.large

The instance type specified in extended configurations.

    └MaxPrice Float 3

The maximum price of the instance type specified in extended configurations.

    └Priority Float 1

The priority of the instance type specified in extended configurations. A value of 0 indicates the highest priority.

    └VSwitchId String vsw-sn5bsitu4lfzgc5o7****

The ID of the VSwitch in extended configurations.

    └WeightedCapacity Float 2

The weight of the instance type specified in extended configurations.

  └LaunchTemplateId String lt-bp1fgzds4bdogu03****

The ID of the launch template associated with the auto provisioning group.

  └LaunchTemplateVersion String 1

The version of the launch template associated with the auto provisioning group.

  └MaxSpotPrice Float 2

The global maximum price for preemptible instances in the auto provisioning group. If both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the maximum price is the lower value of the two.

Note The LaunchTemplateConfig.N.MaxPrice parameter is set during the auto provisioning group creation process and cannot be modified. For more information, see CreateAutoProvisioningGroup.
  └PayAsYouGoOptions

The policies related with pay-as-you-go instances.

    └AllocationStrategy String prioritized

The scale-out policy for pay-as-you-go instances. Valid values:

  • lowest-price: The cost optimization policy the auto provisioning group follows to select instance types of the lowest cost to create instances.
  • prioritized: The priority-based policy the auto provisioning group follows to create instances. The priority of an instance type is specified by the LaunchTemplateConfig.N.Priority parameter.
Note The LaunchTemplateConfig.N.Priority parameter is set during the auto provisioning group creation process and cannot be modified. For more information, see CreateAutoProvisioningGroup.
  └RegionId String cn-hangzhou

The region ID of the auto provisioning group.

  └SpotOptions

The policy of preemptible instances.

    └AllocationStrategy String diversified

The scale-out policy for preemptible instances. Valid values:

  • lowest-price: The cost optimization policy the auto provisioning group follows to select instance types of the lowest cost to create instances.
  • diversified: The distribution balancing policy the auto provisioning group follows to create instances evenly across multiple zones specified in extended template configurations.
    └InstanceInterruptionBehavior String stop

The default behavior after preemptible instances are shut down. Value values:

  • stop: stops preemptible instances.
  • terminate: releases preemptible instances.
    └InstancePoolsToUseCount Integer 2

This parameter takes effect when the SpotAllocationStrategy parameter is set to lowest-price. The auto provisioning group selects the instance types of the lowest cost to create instances.

Note The SpotAllocationStrategy parameter is set during the auto provisioning group creation process and cannot be modified. For more information, see CreateAutoProvisioningGroup.
  └State String fulfilled

The overall status of instance scheduling of the auto provisioning group. Valid values:

  • fulfilled: Scheduling has been completed and the instance cluster has been delivered.
  • pending-fulfillment: The instances are being created.
  • pending-termination: The instances are being removed.
  • error: An exception has occurred during scheduling and the instance cluster was not delivered.
  └Status String submitted

The status of the auto provisioning group. Valid values:

  • submitted: The auto provisioning group has been created but has not started to execute scheduling tasks.
  • active: The auto provisioning group is executing scheduling tasks.
  • deleted: The auto provisioning group has been deleted.
  • deleted-running: The auto provisioning group is being deleted.
  • modifying: The auto provisioning group is being modified.
  └TargetCapacitySpecification

The settings of the target capacity of the auto provisioning group.

    └DefaultTargetCapacityType String Spot

The type of supplemental instances. When the total value of PayAsYouGoTargetCapacity and SpotTargetCapacity is smaller than the value of TotalTargetCapacity, the auto provisioning group will create instances of the specified type to meet the capacity requirements. Valid values:

  • PayAsYouGo: Pay-as-you-go instances.
  • Spot: Preemptible instances.
    └PayAsYouGoTargetCapacity Float 30

The target capacity of pay-as-you-go instances in the auto provisioning group.

    └SpotTargetCapacity Float 20

The target capacity of preemptible instances in the auto provisioning group.

    └TotalTargetCapacity Float 60

The total capacity of the auto provisioning group. The capacity consists of the following three parts:

  • The target capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity parameter
  • The target capacity of preemptible instances specified by the SpotTargetCapacity parameter
  • The supplemental capacity besides PayAsYouGoTargetCapacity and SpotTargetCapacity
  └TerminateInstances Boolean false

Indicates whether to release instances of the auto provisioning group. Valid values:

  • true
  • false
  └TerminateInstancesWithExpiration Boolean true

The shutdown policy for preemptible instances when the auto provisioning group expires. Valid values:

  • true: shuts down preemptible instances. The action to be performed on these shutdown instances is specified by the SpotInstanceInterruptionBehavior parameter.
  • false: does not shut down preemptible instances.
Note The SpotInstanceInterruptionBehavior parameter is set during the auto provisioning group creation process and cannot be modified. For more information, see CreateAutoProvisioningGroup.
  └ValidFrom String 2019-04-01T15:10:20Z

The time when the auto provisioning group was started. The period of time between this point in time and the point in time specified by the ValidUntil parameter is the effective time period of the auto provisioning group.

  └ValidUntil String 2019-06-01T15:10:20Z

The time when the auto provisioning group expires. The period of time between this point in time and the point in time specified by the ValidFrom parameter is the effective time period of the auto provisioning group.

PageNumber Integer 1

The number of the page returned.

PageSize Integer 10

The number of entries returned on each page.

RequestId String 745CEC9F-0DD7-4451-9FE7-8B752F39****

The ID of the request.

TotalCount Integer 10

The number of queried auto provisioning groups.

Examples

Sample requests


http(s)://ecs.aliyuncs.com/? Action=DescribeAutoProvisioningGroups
&AutoProvisioningGroupId. 1=apg-sn54avj8htgvtyh8****
&<Common request parameters>

Sample success responses

XML format

<DescribeAutoProvisioningGroups>
  <PageNumber>1</PageNumber>
  <TotalCount>1</TotalCount>
  <PageSize>10</PageSize>
  <RequestId>85331AC9-82C0-4604-9A14-048865BE****</RequestId>
  <AutoProvisioningGroups>
    <AutoProvisioningGroup>
      <TerminateInstancesWithExpiration>false</TerminateInstancesWithExpiration>
      <TerminateInstances>false</TerminateInstances>
      <ValidFrom>2019-06-17T15:22Z</ValidFrom>
      <AutoProvisioningGroupType>maintain</AutoProvisioningGroupType>
      <PayAsYouGoOptions>
        <AllocationStrategy>lowest-price</AllocationStrategy>
      </PayAsYouGoOptions>
      <AutoProvisioningGroupName>test61****</AutoProvisioningGroupName>
      <CreationTime/>
      <ExcessCapacityTerminationPolicy>no-termination</ExcessCapacityTerminationPolicy>
      <Status>active</Status>
      <MaxSpotPrice>5</MaxSpotPrice>
      <LaunchTemplateVersion>1</LaunchTemplateVersion>
      <ValidUntil>2100-01-01T07:59Z</ValidUntil>
      <TargetCapacitySpecification>
        <SpotTargetCapacity>180</SpotTargetCapacity>
        <TotalTargetCapacity>300</TotalTargetCapacity>
        <PayAsYouGoTargetCapacity>120</PayAsYouGoTargetCapacity>
        <DefaultTargetCapacityType>PayAsYouGo</DefaultTargetCapacityType>
      </TargetCapacitySpecification>
      <State>fulfilled</State>
      <LaunchTemplateId>lt-uf657o6auob6aivd****</LaunchTemplateId>
      <RegionId>cn-shanghai</RegionId>
      <AutoProvisioningGroupId>apg-uf6c7pl7b30t4m98****</AutoProvisioningGroupId>
      <SpotOptions>
        <InstancePoolsToUseCount>1</InstancePoolsToUseCount>
        <InstanceInterruptionBehavior>terminate</InstanceInterruptionBehavior>
        <AllocationStrategy>lowest-price</AllocationStrategy>
      </SpotOptions>
      <LaunchTemplateConfigs>
        <LaunchTemplateConfig>
          <MaxPrice>3</MaxPrice>
          <WeightedCapacity>1</WeightedCapacity>
          <VSwitchId>vsw-uf6qbjwokzl67uqqf****</VSwitchId>
          <Priority>1</Priority>
          <InstanceType>ecs.c5.xlarge</InstanceType>
        </LaunchTemplateConfig>
        <LaunchTemplateConfig>
          <MaxPrice>2</MaxPrice>
          <WeightedCapacity>2</WeightedCapacity>
          <VSwitchId>vsw-uf6n6iy1ib39eqvph****</VSwitchId>
          <Priority>1</Priority>
          <InstanceType>ecs.g5.large</InstanceType>
        </LaunchTemplateConfig>
        <LaunchTemplateConfig>
          <MaxPrice>1</MaxPrice>
          <WeightedCapacity>3</WeightedCapacity>
          <VSwitchId>vsw-uf6gs8uerj5osels4****</VSwitchId>
          <Priority>1</Priority>
          <InstanceType>ecs.hfc5.large</InstanceType>
        </LaunchTemplateConfig>
      </LaunchTemplateConfigs>
    </AutoProvisioningGroup>
  </AutoProvisioningGroups>
</DescribeAutoProvisioningGroups>

JSON format

{
	"PageNumber":1,
	"TotalCount":1,
	"PageSize":10,
	"RequestId":"85331AC9-82C0-4604-9A14-048865BE****",
	"AutoProvisioningGroups":{
		"AutoProvisioningGroup":[
			{
				"TerminateInstancesWithExpiration":false,
				"TerminateInstances":false,
				"ValidFrom":"2019-06-17T15:22Z",
				"AutoProvisioningGroupType":"maintain",
				"PayAsYouGoOptions":{
					"AllocationStrategy":"lowest-price"
				},
				"AutoProvisioningGroupName":"test61****",
				"CreationTime":"",
				"ExcessCapacityTerminationPolicy":"no-termination",
				"Status":"active",
				"MaxSpotPrice":5,
				"LaunchTemplateVersion":"1",
				"ValidUntil":"2100-01-01T07:59Z",
				"LaunchTemplateId":"lt-uf657o6auob6aivd****",
				"State":"fulfilled",
				"TargetCapacitySpecification":{
					"TotalTargetCapacity":300,
					"SpotTargetCapacity":180,
					"PayAsYouGoTargetCapacity":120,
					"DefaultTargetCapacityType":"PayAsYouGo"
				},
				"RegionId":"cn-shanghai",
				"AutoProvisioningGroupId":"apg-uf6c7pl7b30t4m98****",
				"SpotOptions":{
					"InstancePoolsToUseCount":1,
					"InstanceInterruptionBehavior":"terminate",
					"AllocationStrategy":"lowest-price"
				},
				"LaunchTemplateConfigs":{
					"LaunchTemplateConfig":[
						{
							"MaxPrice":3,
							"WeightedCapacity":1,
							"VSwitchId":"vsw-uf6qbjwokzl67uqqf****",
							"InstanceType":"ecs.c5.xlarge",
							"Priority":1
						},
						{
							"MaxPrice":2,
							"WeightedCapacity":2,
							"VSwitchId":"vsw-uf6n6iy1ib39eqvph****",
							"InstanceType":"ecs.g5.large",
							"Priority":1
						},
						{
							"MaxPrice":1,
							"WeightedCapacity":3,
							"VSwitchId":"vsw-uf6gs8uerj5osels4****",
							"InstanceType":"ecs.hfc5.large",
							"Priority":1
						}
					]
				}
			}
		]
	}
}

Error codes

HTTP status code Error code Error message Description
400 MissingParamter.RegionId The regionId should not be null. The error message returned because the RegionId parameter is not specified.

View error codes