Modifies the configurations of an auto provisioning group.
Usage notes
Take note of the following items:
- If you modify the capacity or capacity-related settings of an auto provisioning group, the group executes a scheduling task after the group is modified.
- You cannot modify an auto provisioning group when the group is being deleted.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | ModifyAutoProvisioningGroup | The operation that you want to perform. Set the value to ModifyAutoProvisioningGroup. |
RegionId | String | Yes | cn-hangzhou | The region ID of the auto provisioning group. You can call the DescribeRegions operation to query the most recent region list. |
AutoProvisioningGroupId | String | No | apg-bp67acfmxazb4ph**** | The ID of the auto provisioning group. |
ExcessCapacityTerminationPolicy | String | No | no-termination | Specifies whether to release the removed instances when the real-time capacity of the auto provisioning group exceeds the target capacity and a scale-in event is triggered. Valid values:
|
DefaultTargetCapacityType | String | No | Spot | The type of supplemental instances. When the sum of the PayAsYouGoTargetCapacity and SpotTargetCapacity values is less than the TotalTargetCapacity value, the auto provisioning group creates instances of the specified billing method to meet the target capacity. Valid values:
|
TerminateInstancesWithExpiration | Boolean | No | false | Specifies whether to release instances in the auto provisioning group when the auto provisioning group expires. Valid values:
|
MaxSpotPrice | Float | No | 0.5 | The maximum price of preemptible instances in the auto provisioning group. Note If both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the maximum price is the lower value of the two parameters. The LaunchTemplateConfig.N.MaxPrice parameter is set when the auto provisioning group is created, and cannot be modified. |
TotalTargetCapacity | String | No | 70 | The total target capacity of the auto provisioning group. The value must be a positive integer. The target capacity of the auto provisioning group must be at least the sum of the capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity parameter and the capacity of preemptible instances specified by the SpotTargetCapacity parameter. |
PayAsYouGoTargetCapacity | String | No | 30 | The target capacity of pay-as-you-go instances in the auto provisioning group. Valid values: less than or equal to the |
SpotTargetCapacity | String | No | 30 | The target capacity of preemptible instances in the auto provisioning group. Valid values: less than or equal to the |
AutoProvisioningGroupName | String | No | apg-test | The name of the auto provisioning group. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-). |
LaunchTemplateConfig.N.VSwitchId | String | No | vsw-sn5bsitu4lfzgc5o7**** | The ID of the vSwitch in extended configuration N. The zone of the Elastic Compute Service (ECS) instances created from the extended configuration is determined by the vSwitch. |
LaunchTemplateConfig.N.MaxPrice | double | No | 3 | The maximum price of preemptible instances in extended configuration N. |
LaunchTemplateConfig.N.Priority | Integer | No | 1 | The priority of extended configuration N. A value of 0 indicates the highest priority. The value must be greater than 0. |
LaunchTemplateConfig.N.InstanceType | String | No | ecs.g5.large | The instance type in extended configuration N. Valid values of N: 1 to 20. For more information about the valid values of this parameter, see Overview of instance families. |
LaunchTemplateConfig.N.WeightedCapacity | double | No | 2 | The weight of the instance type in extended configuration N. A greater weight indicates that a single instance has more computing power and fewer instances are required. The value must be greater than 0. The weight is calculated based on the computing power of the specified instance type and the minimum computing power of a single instance in the cluster to be created by the auto provisioning group. For example, assume that the minimum computing power of a single instance is 8 vCPUs and 60 GiB of memory.
|
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | B48A12CD-1295-4A38-A8F0-0E92C937**** | The ID of the request. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=ModifyAutoProvisioningGroup
&RegionId=cn-hangzhou
&AutoProvisioningGroupId=apg-bp67acfmxazb4ph****
&TotalTargetCapacity=70
&MaxSpotPrice=0.5
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyAutoProvisioningGroupResponse>
<RequestId>928E2273-5715-46B9-A730-238DC996****</RequestId>
</ModifyAutoProvisioningGroupResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B48A12CD-1295-4A38-A8F0-0E92C937****"
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | OperationDenied | %s | The operation is denied. |
403 | AutoProvisioningGroup.IncorrectStatus | Current status of AutoProvisioningGroup does not support current action. | This operation cannot be performed on the auto provisioning group in the current state. |
For a list of error codes, see Service error codes.