CreateVpc

CreateVpc

1. API Description

This API is used to create a global VPC.

Note

The quantity of global VPCs you can create in one team is limited. If you need more, please contact Zenlayer Support.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

name

Yes

String

Global VPC name to be displayed.

This parameter must start and end with a number or a letter, containing 2 to 63 characters. Only letters, numbers, - and periods (.) are supported.

cidrBlock

Yes

String

CIDR block of the global VPC.

mtu

Yes

Integer

Maximum Transmission Unit (MTU). The optional values are as follows: 1300, 1500, 9000

enablePriIpv6

No

Boolean

Enable private IPv6 or not.

resourceGroupId

No

String

Resource group ID where the global VPC resides. If the value is empty, the global VPC will belong to the Default Resource Group.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

vpcId

String

Global VPC ID.

4. Code Example

Create a global VPC.

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

Request:
{
  "name": "vpcXXX",
  "cidrBlock": "10.0.0.0/8",
  "mtu": 1300,
  "enablePriIpv6": false,
  "resourceGroupId": "xxxx"
}

Response:
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "vpcId": "xxxx"
  }
}

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

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​

HTTP Status CodeError CodeDescription

400

UNSUPPORTED_OPERATION_TEAM_NETWORK_COUNT_LIMIT

Global VPC quantity is limited.

Last updated