All Products
Search
Document Center

Elastic Compute Service:ModifyAutoProvisioningGroup

Last Updated:Sep 29, 2024

Modifies the configurations of an auto-provisioning group.

Operation 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 executes a scheduling task after the group is modified.
  • 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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:ModifyAutoProvisioningGroupupdate
  • autoprovisioninggroup
    acs:ecs:{#regionId}:{#accountId}:autoprovisioninggroup/{#autoprovisioninggroupId}
    none
  • ram:CreateServiceLinkedRole

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the auto-provisioning group. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
AutoProvisioningGroupIdstringNo

The auto-provisioning group ID.

apg-bp67acfmxazb4ph****
ExcessCapacityTerminationPolicystringNo

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:

  • termination: releases the removed instances.
  • no-termination: removes the instances from the auto-provisioning group but does not release them.
no-termination
DefaultTargetCapacityTypestringNo

The type of supplemental instances. When the sum of the PayAsYouGoTargetCapacity and SpotTargetCapacity values is smaller than the TotalTargetCapacity value, the auto-provisioning group creates instances of the specified type to meet the target capacity. Valid values:

  • PayAsYouGo: pay-as-you-go instances
  • Spot: preemptible instances
Spot
TerminateInstancesWithExpirationbooleanNo

Specifies whether to release instances that are located in the auto-provisioning group after the group expires. Valid values:

  • true: releases instances that are located in the auto-provisioning group.
  • false: removes instances from the auto-provisioning group but does not release them.
false
MaxSpotPricefloatNo

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

Note When both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the smaller one of the two parameter values is used. The LaunchTemplateConfig.N.MaxPrice parameter is specified when the auto-provisioning group is created, and cannot be modified.
0.5
TotalTargetCapacitystringNo

The total target capacity of the auto-provisioning group. The value must be a positive integer.

The total target capacity of the auto-provisioning group must be greater than or equal to the sum of the target capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity parameter as well as the target capacity of preemptible instances specified by the SpotTargetCapacity parameter.

70
PayAsYouGoTargetCapacitystringNo

The target capacity of pay-as-you-go instances in the auto-provisioning group. Valid values: Set this parameter to a value smaller than the TotalTargetCapacity value.

30
SpotTargetCapacitystringNo

The target capacity of preemptible instances in the auto-provisioning group. Valid values: Set this parameter to a value smaller than the TotalTargetCapacity value.

30
AutoProvisioningGroupNamestringNo

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

apg-test
LaunchTemplateConfigarray<object>No

The extended configurations of the launch template.

objectNo

Extended configuration N.

VSwitchIdstringNo

The ID of the vSwitch in extended configuration N. The zone of the instances created from the extended configuration is determined by the vSwitch.

vsw-sn5bsitu4lfzgc5o7****
MaxPricedoubleNo

The maximum price of preemptible instances in extended configuration N.

3
PriorityintegerNo

The priority of extended configuration N. A value of 0 indicates the highest priority. The value must be greater than 0.

1
InstanceTypestringNo

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 Instance families.

ecs.g5.large
WeightedCapacitydoubleNo

The weight of the instance type specified in the extended configuration. 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 instance type and the minimum computing power of a single instance in the cluster that can 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.

  • For an instance type with 8 vCPUs and 60 GiB of memory, you can set the weight to 1.
  • For an instance type with 16 vCPUs and 120 GiB of memory, you can set the weight to 2.
2

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterThe specified parameter "AutoProvisioningGroupId" should not be null.-
400MissingParameterThe specified parameter "AutoProvisioningGroupConfig" should not be null.-
400NoPermission%s-
400InvalidLaunchTemplateConfigs.SizeExceedThe size of LaunchTemplateConfigs exceeds limit.-
400QuotaExceed.LaunchTemplateConfigs%s-
400OperationDenied%sThe operation is denied.
403Forbidden.RAMUser not authorized to operate on the specified resource, or this API doesn't support RAM.-
403InvalidName.MalformedThe specified parameter "AutoProvisioningGroupName" is not valid.-
403AutoProvisioningGroup.UnauthorizedUnauthorized to operate current action.-
403AutoProvisioningGroup.IncorrectStatusCurrent status of AutoProvisioningGroup does not support curren action.-
403InvalidParameter.TargetCapacityThe Capacity is illegal, TotalTargetCapacity, PayAsYouGoTargetCapacity, SpotTargetCapacity must be specified, meanwhile, the TargetCapacity must be larger than or equal to the sum of SpotCapacity and OnDemandCapacity.-
404InvalidAutoProvisioningGroupId.NotFoundThe specified AutoProvisioningGroupId does not exist.-
404InvalidParameter.MaxPriceThe specified parameter "MaxSpotPrice" is not valid.-

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