AttachInstances

Last updated: 2019-07-16 18:55:14

1. API Description

API request domain name: as.tencentcloudapi.com.

This API (AttachInstances) attaches one or more CVM instances to the specified scaling group.

Default API request frequency limit: 20 times/second.

Note: This API supports financial availability zones. Because financial availability zones and non-financial availability zones are isolated. When specifying a financial availability zone (e.g., ap-shanghai-fsi) in the Region (a common parameter), you should also choose the financial availability zone preferably in the same region as that one specified in Region for the domain, such as as.ap-shanghai-fsi.tencentcloudapi.com.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: AttachInstances
Version Yes String Common parameter; the version of this API: 2018-04-19
Region Yes String Common parameters; for details, see the Region List.
AutoScalingGroupId Yes String Scaling group ID
InstanceIds.N Yes Array of String List of CVM instance IDs

3. Output Parameters

Parameter name Type Description
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Adding an Instance to a Scaling Group

Input Sample Code

https://as.tencentcloudapi.com/?Action=AttachInstances
&AutoScalingGroupId=asg-boz1qhnk
&InstanceIds.0=ins-cri8d02t
&InstanceIds.1=ins-osckfnm7
&<Common request parameter>

Output Sample Code

{
    "Response": {
        "RequestId": "5b039ee6-e8ff-4605-bb24-b45337747431"
    }
}

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

SDK

TencentCloud API 3.0 integrates software development toolkits (SDKs) that support various programming languages to make it easier for you to call the APIs.

TCCLI

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error
InvalidParameterValue.LimitExceeded The value exceeds the limit.
ResourceInsufficient.AutoScalingGroupAboveMaxSize The maximum number of instances in the scaling group is exceeded.
ResourceNotFound.AutoScalingGroupIdNotFound The scaling group does not exist.
ResourceNotFound.InstancesNotFound The specified instance does not exist.
ResourceUnavailable.AutoScalingGroupInActivity The scaling group is active.
ResourceUnavailable.CvmVpcInconsistent The instance and the scaling group are in different VPCs.
ResourceUnavailable.InstancesAlreadyInAutoScalingGroup The instance already exists in the scaling group.