Help & DocumentationVirtual Private CloudAPI DocumentationVPC API 2017APIs for VPCCreate a Classiclink Between a VPC and Basic Network Devices

Create a Classiclink Between a VPC and Basic Network Devices

Last updated: 2019-11-29 15:25:39

PDF

1. API Description

This API (AttachClassicLinkVpc) is used to create a classiclink.
API request domain name: vpc.api.qcloud.com

(1) The VPC and basic network devices must be in the same region.
(2) For the differences between VPCs and basic networks, see VPC Product Documentation - VPCs and Basic Networks.

2. Input Parameters

Below is a list of API request parameters. You need to add common request parameters to your request when calling this API. For more information, see the Common Request Parameters page. The Action field for this API is AttachClassicLinkVpc.

Parameter name Required Type Description
vpcId Yes String VPC ID assigned by the system, for example: vpc-dgd44d. Both the vpcId before upgrade and the upgraded unVpcId are supported.
instanceIds.n Yes Array ID of the basic network CVM, for example: instanceIds.0=ins-5d8a23rs. You can query this ID through the cloud API DescribeInstances.

3. Output Parameters

Parameter name Type Description
code Int Common error code. 0: Successful; other values: Failed. For more information, see Common Error Codes.
message String Module error message, which depends on the API.
taskId Int Task ID. You can query the execution result by using taskId. For more information, see the API for Querying Task Execution Results.

4. Error Codes

The following error codes only include business logic error codes for this API. For additional common error codes, see VPC Error Codes.

Error code Description
InvalidInstance.NotFound The CVM does not exist. In this case, verify that the instanceId that you entered is correct. To query the CVMs under the VPC, see View the List of CVM Instances.
InvalidVpc.NotFound Invalid VPC. This error code indicates that the VPC does not exist. In this case, verify whether the resource information that you entered is correct.
InstanceLimitExceeded The number of basic network devices interconnected with a VPC in the specified region exceeds the limit. To bind more basic network devices, contact customer service. For more information about VPC resource limits, see VPC Use Limits.
InvalidVpc.NotFound Invalid VPC. This error code indicates that the VPC does not exist. In this case, verify whether the resource information that you entered is correct.
InstanceAlreadyLinked The basic network CVM has been bound to another VPC, and one basic network CVM can only be interconnected with one VPC. For more information about VPC resource limits, see VPC Use Limits.

5. Sample

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
}