ModifyAutoProvisioningGroup

更新时间:
复制 MD 格式

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.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ModifyAutoProvisioningGroup

update

*autoprovisioninggroup

acs:ecs:{#regionId}:{#accountId}:autoprovisioninggroup/{#autoprovisioninggroupId}

None
  • ram:CreateServiceLinkedRole

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

AutoProvisioningGroupId

string

No

The auto-provisioning group ID.

apg-bp67acfmxazb4ph****

ExcessCapacityTerminationPolicy

string

No

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

DefaultTargetCapacityType

string

No

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: spot instances

Spot

TerminateInstancesWithExpiration

boolean

No

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

MaxSpotPrice

number

No

The maximum price of spot 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

TotalTargetCapacity

string

No

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 spot instances specified by the SpotTargetCapacity parameter.

70

PayAsYouGoTargetCapacity

string

No

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

SpotTargetCapacity

string

No

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

30

AutoProvisioningGroupName

string

No

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

LaunchTemplateConfig

array<object>

No

The extended configurations of the launch template.

object

No

Extended configuration N.

VSwitchId

string

No

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****

MaxPrice

number

No

The maximum price of spot instances in extended configuration N.

3

Priority

integer

No

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

1

InstanceType

string

No

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

WeightedCapacity

number

No

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 elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter The specified parameter "AutoProvisioningGroupId" should not be null. Elastic Supply Group Id(AutoProvisioningGroupId) must be filled in.
400 NoPermission %s
400 InvalidLaunchTemplateConfigs.SizeExceed The size of LaunchTemplateConfigs exceeds limit. The number of LaunchTemplateConfig in the elastic supply group exceeds the limit.
400 QuotaExceed.LaunchTemplateConfigs %s
400 OperationDenied %s The operation is denied.
400 VpcMismatch.SecurityGroupAndVSwitch Specified security group and virtual switch are not in the same VPC. The specified security group is not in the same VPC as the VSwitch.
403 Forbidden.RAM User not authorized to operate on the specified resource, or this API doesn't support RAM.
403 InvalidName.Malformed The specified parameter "AutoProvisioningGroupName" is not valid.
403 AutoProvisioningGroup.Unauthorized Unauthorized to operate current action.
403 AutoProvisioningGroup.IncorrectStatus Current status of AutoProvisioningGroup does not support curren action.
403 InvalidParameter.TargetCapacity The 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.
404 InvalidAutoProvisioningGroupId.NotFound The specified AutoProvisioningGroupId does not exist. The specified elastic supply group does not exist.
404 InvalidParameter.MaxPrice The specified parameter "MaxSpotPrice" is not valid.
404 InvalidVSwitchId.NotFound The specified virtual switch %s does not exist. The specified switch does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.