tencent cloud



Last updated: 2023-08-07 17:53:15

1. API Description

Domain name for API request: as.tencentcloudapi.com.

This API is used to create launch configurations and scaling groups based on an instance.

Note: for a scaling group that is created based on a monthly-subscribed instance, the instances added for scale-out are pay-as-you-go instance.

A maximum of 20 requests can be initiated per second for this API.

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 Params. The value used for this API: CreateAutoScalingGroupFromInstance.
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.
AutoScalingGroupName Yes String The scaling group name. It must be unique under your account. The name can only contain letters, numbers, underscore, hyphen “-” and periods. It cannot exceed 55 bytes.
InstanceId Yes String The instance ID.
MinSize Yes Integer The minimum number of instances. Value range: 0-2000.
MaxSize Yes Integer The maximum number of instances. Value range: 0-2000.
DesiredCapacity No Integer The desired capacity. Its value must be greater than the minimum and smaller than the maximum.
InheritInstanceTag No Boolean Whether to inherit the instance tag. Default value: False

3. Output Parameters

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

4. Example

Example1 Creating a launch configuration and scaling group based on an instance

Input Example

Host: as.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAutoScalingGroupFromInstance
<Common request parameters>

    "DesiredCapacity": 0,
    "InstanceId": "ins-19a14o9y",
    "AutoScalingGroupName": "as-test",
    "MinSize": 0,
    "MaxSize": 1,
    "InheritInstanceTag": false

Output Example

    "Response": {
        "AutoScalingGroupId": "asg-cqatht5b",
        "RequestId": "19c10733-d0e8-4f58-ac82-e1b1affb0bbb"

5. Developer Resources


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
AccountQualificationRestrictions The requesting account failed to pass the qualification review.
CallCvmError CVM API call failed.
InternalError An internal error occurred.
InternalError.CallVpcError VPC API call failed.
InternalError.CalleeError Exceptions occurred while invoking other services.
InvalidParameter.ActionNotFound Invalid Action request.
InvalidParameter.InScenario The parameter is invalid in a specific scenario.
InvalidParameterValue.CvmConfigurationError Exception with CVM parameter validation.
InvalidParameterValue.CvmError Exception with CVM parameter validation.
InvalidParameterValue.DuplicatedSubnet Duplicated subnet.
InvalidParameterValue.ForwardLb A CLB should be specified.
InvalidParameterValue.InvalidInstanceId Invalid instance ID.
InvalidParameterValue.LaunchConfigurationNameDuplicated The launch configuration name already exists.
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.TooLong Too many values.
LimitExceeded.AutoScalingGroupLimitExceeded The number of auto scaling groups exceeds the limit.
LimitExceeded.DesiredCapacityLimitExceeded The desired number of instances exceeds the limit.
LimitExceeded.LaunchConfigurationQuotaNotEnough You are short of the launch configuration quota.
LimitExceeded.MaxSizeLimitExceeded The maximum number of instances exceeds the limit.
LimitExceeded.MinSizeLimitExceeded The minimum number of instances is below the limit.
MissingParameter Parameter missing.
ResourceNotFound.InstancesNotFound The specified instance does not exist.
ResourceUnavailable.LaunchConfigurationStatusAbnormal The launch configuration is exceptional.
ResourceUnavailable.ProjectInconsistent Project inconsistency.
ResourceUnavailable.StoppedInstanceNotAllowAttach Unable to add instances to the scaling group when they are shut down.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support