CreateCloudRouter
1. API Description
This API is used to create a Layer 3 cloud router.
Prerequisites
Query available VPCs You can call
DescribeCloudRouterAvailableVpcsto query VPCs that can be added in to the Layer 3 cloud router.Query available border gateways You can call
DescribeBorderGatewaysto query border gateways that can be added in to the Layer 3 cloud router.Query available ports You can call
DescribeCloudRouterAvailablePortsto query ports that can be added in to the Layer 3 cloud router.Query available locations for public clouds
You can call
DescribeGoogleRegionsto query locations supporting for Google Cloud access point.You can call
DescribeAWSRegionsto query locations supporting for AWS access point.You can call
DescribeTencentRegionsto query locations supporting for Tencent Cloud access point.
Query available date centers for virtual edges
You can call
DescribeVirtualEdgeDatacentersto query date centers supporting virtual edges.
2. Input Parameters
The following request parameter list only provides API request parameters.
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
Yes
Array of CreateCloudRouterEdgePoint
Access point information in a cloud router. At least two access points must be added to a 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
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