CreateCloudRouter

1. API Description

This API is used to create a Layer 3 cloud router.

Prerequisites

Note

  • Only operations on pay-as-you-go cloud router are supported.

  • A cloud router can contains several VPCs, while a VPC can only be added into one cloud router.

  • This API is an async API. A cloud router ID is returned after the creation request is sent. However, it does not mean the creation has been completed. The status of the cloud router will be DEPLOYING during the creation. You can use DescribeCloudRouters to query the status of the cloud router. If cloudRouterStatus changes from DEPLOYING to RUNNING, it means that the cloud router has been created successfully; if no result has been queried, it means the cloud router has been created failed. Any operations on the cloud router are not allowed while creating.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

cloudRouterName

No

String

Cloud router name. Up to 255 characters in length are allowed. The default is cloud-router-{current time}.

cloudRouterDescription

No

String

Cloud router description. Up to 255 characters in length are allowed.

edgePoints

No

Access point information in cloud router.

resourceGroupId

No

String

Resource group ID.

If the value is null, the cloud router will be added into the default resource group.

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.

cloudRouterId

String

Cloud router ID.

4. Code Example

Create a Layer 3 cloud router with a port and a VPC as access points. The access bandwidth is 10 Mbps.

POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: CreateCloudRouter
<Common Request Params>

Request:
{
    "cloudRouterStatus":"RUNNING",
    "edgePoints":[
        {
            "ipAddress":"4.4.4.4/24",
            "vlanId": 1024,
            "portId":"your-portId",
            "bgpConnection":{
                "password":"",
                "peerIpAddress":"4.4.4.3",
                "localAsn":62610,
                "peerAsn":6543
            },
            "bandwidthMbps":1
        },
        {
            "vpcId":"your vpc id",
            "bandwidthMbps":1
        }
    ],
    "cloudRouterName":"Test",
    "cloudRouterDescription":"",
    "cloudRouterChargeType":"POSTPAID"
}

Response:
{   
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E"
     "cloudRouterId": "cloud router id"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated