You can call this operation to modify the configurations of an auto provisioning group.

Description

Before you call this operation, take note of the following items:

  • If you modify the capacity or capacity-related settings of an auto provisioning group, the group will execute scheduling tasks once after modification.
  • You cannot modify an auto provisioning group when the group is being deleted.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 to be modified. 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 terminate excess preemptible instances when the target total capacity of the specified auto provisioning group is reached. Valid values:

  • no-termination: The system continues to run excess preemptible instances.
  • termination: The system terminates excess preemptible instances. The next action after termination is specified by the SpotInstanceInterruptionBehavior parameter.
Note You must specify the SpotInstanceInterruptionBehavior parameter when you create the auto provisioning group and cannot change the parameter value later.
DefaultTargetCapacityType String No Spot

Specifies the billing method of the capacity difference when the sum of the values of the PayAsYouGoTargetCapacity and SpotTargetCapacity parameters is less than the value of the TotalTargetCapacity parameter. Valid values:

  • PayAsYouGo: bill based on pay-as-you-go instances.
  • Spot: bill based on preemptible instances.
TerminateInstancesWithExpiration Boolean No false

Specifies whether to terminate preemptible instances when the auto provisioning group expires. Valid values:

  • true: The system terminates preemptible instances. The next action after termination is specified by the SpotInstanceInterruptionBehavior parameter.
  • false: The system continues running preemptible instances.
Note You must specify the SpotInstanceInterruptionBehavior parameter when you create the auto provisioning group and cannot change the parameter value later.
MaxSpotPrice Float No 0.5

The maximum price of preemptible instances in the auto provisioning group.

Note When both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the maximum price is the lower value of the two parameters. You must specify the LaunchTemplateConfig.N.MaxPrice parameter when you create the auto provisioning group and cannot change the parameter value later.
TotalTargetCapacity String No 70

The total target capacity of the auto provisioning group. The parameter value is a positive integer.

The total target capacity of the auto provisioning group must be at least the sum of the target capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity parameter and target 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 the value of the TotalTargetCapacity parameter.

SpotTargetCapacity String No 30

The target capacity of preemptible instances in the auto provisioning group. Valid values: less than the value of the TotalTargetCapacity parameter.

AutoProvisioningGroupName String No apg-test

The name of the auto provisioning group to be created. The name must be 2 to 128 characters in length. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter but cannot start with http:// or https://.

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

<ModifyAutoProvisioningGroupResponse>
    <RequestId>928E2273-5715-46B9-A730-238DC996****</RequestId>
</ModifyAutoProvisioningGroupResponse>

JSON format

{
    "RequestId": "B48A12CD-1295-4A38-A8F0-0E92C937****"
}

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 you are not authorized to operate this resource, or this API does not support RAM roles.

For a list of error codes, visit the API Error Center.