ModifyAutoScalingGroup

Last updated: 2020-09-04 09:46:46

1. API Description

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.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: as.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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 parameter. The value used for this API: ModifyAutoScalingGroup.
Version Yes String Common parameter. The value used for this API: 2018-04-19.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
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.

  • OLDEST_INSTANCE: The oldest instance in the auto scaling group will be terminated first.

  • NEWEST_INSTANCE: The newest instance in the auto scaling group will be terminated first.
  • 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. Value range: IMMEDIATE_RETRY, INCREMENTAL_INTERVALS, and NO_RETRY. Default value: IMMEDIATE_RETRY.

  • IMMEDIATE_RETRY: Retrying immediately in a short period of time and stopping after a number of consecutive failures (5).

  • INCREMENTAL_INTERVALS: Retrying at incremental intervals, i.e., as the number of consecutive failures increases, the retry interval gradually increases, ranging from one second to one day.

  • NO_RETRY: No retry until a user call or alarm message is received again.
  • 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.

  • ALL: The verification will succeed only if all availability zones (Zone) or subnets (SubnetId) are available; otherwise, an error will be reported.

  • ANY: The verification will success if any availability zone (Zone) or subnet (SubnetId) is available; otherwise, an error will be reported.

    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.

  • PRIORITY: creates instances based on the priority determined by the order in the availability zone/subnet list. If an instance can be successfully created in the availability zone/subnet of the highest priority, all instances will be created in the availability zone/subnet.

  • EQUALITY: scales out the availability zone/subnet with the least instances each time. This gives each availability zone/subnet an opportunity for scale-out and disperses the instances created during multiple scale-out operations across different availability zones/subnets.

    Notes about this policy:

  • When the scaling group is a basic network, this policy applies to multiple availability zones. When the scaling group is a VPC, this policy applies to multiple subnets, and you do not need to consider availability zones. For example, if you have four subnets (A, B, C, and D) and A, B, and C are in availability zone 1 and D is in availability zone 2, you do not need to consider the availability zones when determining the order of the subnets.

  • This policy is applicable to multiple availability zones/subnets, but is not applicable to multiple models with launch configurations. When there are multiple models, the PRIORITY policy is applied.

  • During instance creation, apply the multi-model policy and then apply the multi-availability zones/subnet policy. For example, if you have models A and B and subnets 1, 2, and 3 (based on the PRIORITY policy), creation will be attempted in the following order: A1, A2, A3, B1, B2, and B3. If A1 is sold out, A2 (not B1) is tried next.

  • No matter what policy is used, a single scaling event always uses a specific configuration at priority (model * availability zone/subnet).
  • 3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Modifying the VPC subnet information of a scaling group

    Input Example

    https://as.tencentcloudapi.com/?Action=ModifyAutoScalingGroup
    &AutoScalingGroupId=asg-ka0s0q80
    &VpcId=vpc-hy436tmc
    &SubnetIds.0=subnet-3tmerl37
    &SubnetIds.1=subnet-b0vxjhot
    &<common request parameters>

    Output Example

    {
      "Response": {
        "RequestId": "c503ddc6-496c-44c9-8cec-e9f1c3f9c11c"
      }
    }

    Example2 Modifying the desired, maximum, and minimum capacity of a scaling group

    Input Example

    https://as.tencentcloudapi.com/?Action=ModifyAutoScalingGroup
    &AutoScalingGroupId=asg-ka0s0q80
    &DesiredCapacity=3
    &MaxSize=10
    &MinSize=1
    &<common request parameters>

    Output Example

    {
      "Response": {
        "RequestId": "b41d8d30-21d4-412c-b7f3-53041879968c"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameter.InScenario The parameter is invalid in a specific scenario.
    InvalidParameterValue.CvmError Exception with CVM parameter validation.
    InvalidParameterValue.GroupNameDuplicated The auto scaling group name already exists.
    InvalidParameterValue.LaunchConfigurationNotFound The specified launch configuration was not found.
    InvalidParameterValue.LbProjectInconsistent The load balancer is in a different project.
    InvalidParameterValue.LbVpcInconsistent The load balancer and the auto scaling group are in different VPCs.
    InvalidParameterValue.LimitExceeded The value exceeds the limit.
    InvalidParameterValue.OnlyVpc The account only supports VPCs.
    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 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 Missing parameter.
    MissingParameter.InScenario A parameter is missing in a specific scenario.
    ResourceNotFound.AutoScalingGroupIdNotFound The auto scaling group does not exist.
    ResourceUnavailable.LaunchConfigurationStatusAbnormal The launch configuration is exceptional.
    ResourceUnavailable.ProjectInconsistent Project inconsistency.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help