Create Classiclinks

Last updated: 2018-08-24 09:59:18

1. API Description

This API (AttachClassicLinkVpc) is used to connect VPC and basic network devices.
Domain for API request: vpc.api.qcloud.com

1) VPC and basic network devices must be in the same region.
2) For the differences between VPCs and basic networks, see here.

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is AttachClassicLinkVpc.

Parameter Name Required Type Description
vpcId Yes String The Virtual Private Cloud ID assigned by the system. Both the vpcId before upgrading and the upgraded unVpcId are supported. For example: vpc-dgd44d.
instanceIds.n Yes Array Basic network CVM ID, for example: instanceIds.0=ins-5d8a23rs. It can be queried via API DescribeInstances.

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, please see Common Error Codes on the Error Code page.
message String Module error message description depending on API.
taskId Int Task ID. The operation result can be queried with taskId. For more information, refer to API for Querying Task Execution Result.

4. Error Codes

The following error code list only provides the business logic error codes for this API. For common error codes, refer to VPC Error Codes.

Error Code Description
InvalidInstance.NotFound The CVM does not exist. Please check the information you entered. To query the CVMs under the VPC, please see Query CVM Instance List.
InvalidVpc.NotFound The VPC does not exist. Please check the information you entered.
InstanceLimitExceeded Reached the upper limit of basic network devices linked to the VPC in the specified region. If you need more resources, please contact customer service. For more information, please see VPC Service Limits.
InstanceAlreadyLinked The basic network CVM has been bound to another VPC. For more information, please see VPC Service Limits.

5. Example

Input


  https://vpc.api.qcloud.com/v2/index.php?Action=AttachClassicLinkVpc
    &<Common request parameters>
    &vpcId=vpc-2ari9m7h
    &instanceIds.0=ins-df454d

Output


{
    "code": 0,
    "message": "",
        "taskId":135254
}