Domain name for API request: as.tencentcloudapi.com.
This API (ModifyAutoScalingGroup) is used to modify an auto scaling group.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: ModifyAutoScalingGroup. |
Version | Yes | String | Common Params. The value used for this API: 2018-04-19. |
Region | No | String | Common Params. This parameter is not required for this API. |
AutoScalingGroupId | Yes | String | Auto scaling group ID |
AutoScalingGroupName | No | String | Auto scaling group name, which can only contain letters, numbers, underscores, hyphens ("-"), and decimal points with a maximum length of 55 bytes and must be unique under your account. |
DefaultCooldown | No | Integer | Default cooldown period in seconds. Default value: 300 |
DesiredCapacity | No | Integer | Desired number of instances. The number should be no larger than the maximum and no smaller than minimum number of instances |
LaunchConfigurationId | No | String | Launch configuration ID |
MaxSize | No | Integer | Maximum number of instances. Value range: 0-2,000. |
MinSize | No | Integer | Minimum number of instances. Value range: 0-2,000. |
ProjectId | No | Integer | Project ID |
SubnetIds.N | No | Array of String | List of subnet IDs |
TerminationPolicies.N | No | Array of String | Termination policy. Currently, the maximum length is 1. Value range: OLDEST_INSTANCE, NEWEST_INSTANCE. |
VpcId | No | String | VPC ID. This field is left empty for basic networks. You need to specify SubnetIds when modifying the network of the auto scaling group to a VPC with a specified VPC ID. Specify Zones when modifying the network to a basic network. |
Zones.N | No | Array of String | List of availability zones |
RetryPolicy | No | String | Retry policy. Valid values: IMMEDIATE_RETRY (default), INCREMENTAL_INTERVALS , NO_RETRY . A partially successful scaling is judged as a failed one.IMMEDIATE_RETRY : Retrying immediately in a short period of time and stopping after five consecutive failures.INCREMENTAL_INTERVALS : Retrying at incremental intervals. As the number of consecutive failures increases, the retry interval gradually increases, ranging from seconds to one day.NO_RETRY : Do not retry. Actions are taken when the next call or alarm message comes. |
ZonesCheckPolicy | No | String | Availability zone verification policy. Value range: ALL, ANY. Default value: ANY. This will work when the resource-related fields (launch configuration, availability zone, or subnet) of the auto scaling group are actually modified. Common reasons why an availability zone or subnet is unavailable include stock-out of CVM instances or CBS cloud disks in the availability zone, insufficient quota in the availability zone, or insufficient IPs in the subnet. If an availability zone or subnet in Zones/SubnetIds does not exist, a verification error will be reported regardless of the value of ZonesCheckPolicy. |
ServiceSettings | No | ServiceSettings | Service settings such as unhealthy instance replacement. |
Ipv6AddressCount | No | Integer | The number of IPv6 addresses that an instance has. Valid values: 0 and 1. |
MultiZoneSubnetPolicy | No | String | Multi-availability zone/subnet policy. Valid values: PRIORITY and EQUALITY . Default value: PRIORITY .PRIORITY : When an instance is being created, the availability zone/subnet is chosen from top to bottom in the list. The first availability zone/subnet is always used as long as instances can be created.EQUALITY : Instances created for scaling out are distributed to multiple availability zones/subnets, so as to keep the number of instances in different availability zone/subnet in balance.Notes: PRIORITY policy is used, the multi-model policy prevails the multi-availability zones/subnet policy. For example, if you have Model A/B, and Subnet 1/2/3, the model-subnet combinations are tried in the following order: A1 -> A2 -> A3 -> B1 -> B2 -> B3. If A1 is sold out, A2 (not B1) is tried next. |
HealthCheckType | No | String | Health check type of instances in a scaling group. |
LoadBalancerHealthCheckGracePeriod | No | Integer | Grace period of the CLB health check |
InstanceAllocationPolicy | No | String | Specifies how to assign instances. Valid values: LAUNCH_CONFIGURATION and SPOT_MIXED .LAUNCH_CONFIGURATION : the launch configuration mode.SPOT_MIXED : a mixed instance mode. Currently, this mode is supported only when the launch configuration takes the pay-as-you-go billing mode. With this mode, the scaling group can provision a combination of pay-as-you-go instances and spot instances to meet the configured capacity. Note that the billing mode of the associated launch configuration cannot be modified when this mode is used. |
SpotMixedAllocationPolicy | No | SpotMixedAllocationPolicy | Specifies how to assign pay-as-you-go instances and spot instances. This parameter is valid only when InstanceAllocationPolicy is set to SPOT_MIXED . |
CapacityRebalance | No | Boolean | Indicates whether the capacity rebalancing feature is enabled. This parameter is only valid for spot instances in the scaling group. Valid values:TRUE : yes. Before the spot instances in the scaling group are about to be automatically repossessed, AS will terminate them. The scale-in hook (if configured) will take effect before the termination. After the termination process starts, AS will asynchronously initiate a scaling activity to meet the desired capacity.FALSE : no. In this case, AS will add instances to meet the desired capacity only after the spot instances are terminated. |
Parameter Name | Type | Description |
---|---|---|
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to modify the VpcId
and SubnetIds
of the specific scaling group.
POST / HTTP/1.1
Host: as.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyAutoScalingGroup
<Common request parameters>
{
"AutoScalingGroupId": "asg-ka0s0q80",
"SubnetIds": [
"subnet-b0vxjhot",
"subnet-3tmerl37"
],
"VpcId": "vpc-hy436tmc"
}
{
"Response": {
"RequestId": "c503ddc6-496c-44c9-8cec-e9f1c3f9c11c"
}
}
This example shows you how to modify the desired capacity of a scaling group to 3, the maximum capacity to 10, and the minimum capacity to 1.
POST / HTTP/1.1
Host: as.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyAutoScalingGroup
<Common request parameters>
{
"AutoScalingGroupId": "asg-ka0s0q80",
"MinSize": 1,
"MaxSize": 10,
"DesiredCapacity": 3
}
{
"Response": {
"RequestId": "b41d8d30-21d4-412c-b7f3-53041879968c"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError.CallVpcError | VPC API call failed. |
InternalError.RequestError | An internal request error occurred. |
InvalidParameter.ActionNotFound | Invalid Action request. |
InvalidParameter.Conflict | Multiple parameters specified conflict and cannot co-exist. |
InvalidParameter.InScenario | The parameter is invalid in a specific scenario. |
InvalidParameterValue.BaseCapacityTooLarge | The specified base capacity cannot exceed the max capacity. |
InvalidParameterValue.CvmError | Exception with CVM parameter validation. |
InvalidParameterValue.DuplicatedSubnet | Duplicated subnet. |
InvalidParameterValue.GroupNameDuplicated | The auto scaling group name already exists. |
InvalidParameterValue.InvalidAutoScalingGroupId | Invalid scaling group ID. |
InvalidParameterValue.InvalidLaunchConfigurationId | Invalid launch configuration ID. |
InvalidParameterValue.InvalidSubnetId | Invalid subnet ID. |
InvalidParameterValue.LaunchConfigurationNotFound | The specified launch configuration was not found. |
InvalidParameterValue.LbProjectInconsistent | The load balancer is in a different project. |
InvalidParameterValue.LimitExceeded | The value exceeds the limit. |
InvalidParameterValue.OnlyVpc | The account only supports VPCs. |
InvalidParameterValue.ProjectIdNotFound | The project ID does not exist. |
InvalidParameterValue.Range | The value is outside the specified range. |
InvalidParameterValue.Size | The value of maximum, minimum, or desired number of instances in the auto scaling group is invalid. |
InvalidParameterValue.SubnetIds | The subnet information is invalid. |
InvalidParameterValue.TooLong | Too many values. |
LimitExceeded | The quota limit is exceeded. |
LimitExceeded.MaxSizeLimitExceeded | The maximum number of instances exceeds the limit. |
LimitExceeded.MinSizeLimitExceeded | The minimum number of instances is below the limit. |
MissingParameter | Parameter missing. |
MissingParameter.InScenario | A parameter is missing in a specific scenario. |
ResourceNotFound.AutoScalingGroupNotFound | The scaling group does not exist. |
ResourceUnavailable.ForbiddenModifyVpc | You cannot modify the VPC of a scaling group bound with a load balancer. |
ResourceUnavailable.LaunchConfigurationStatusAbnormal | The launch configuration is exceptional. |
ResourceUnavailable.ProjectInconsistent | Project inconsistency. |
Was this page helpful?