ModifyVpcAttribute

1. API Description

This API is used to modify the attributes of a global VPC.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

vpcId

Yes

String

Global VPC ID.

vpcName

No

String

Global VPC name.

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

No

String

IPv4 CIDR block to be modified. The IPv4 CIDR block should be a valid subnet within these ranges:

  • 10.0.0.0/8

  • 172.16.0.0/12

  • 192.168.0.0/16

If the global VPC has subnets, the new CIDR must include the original CIDR.

The default global VPC cannot be modified.

enableIPv6

No

Boolean

Whether to enable the private IPv6 CIDR block. Currently, only enabling (true) is allowed. Once enabled, IPv6 CIDR block function cannot be disabled.

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.

4. Code Example

Modify the information of a global VPC, and enable the private IPv6 CIDR block.

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

Request:
{
    "vpcId": "<vpcId>",
    "vpcName": "TestVpcName",
    "enableIpv6": true
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}

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 Code
Error Code
Description

404

INVALID_VPC_NOT_FOUND

Global VPC does not exist.

400

OPERATION_DENIED_DEFAULT_VPC

The default global VPC cannot be modified.

400

OPERATION_DENIED_VPC_CANT_DISABLE_IPV6

Once enabled, IPv6 CIDR block function cannot be disabled.

400

OPERATION_DENIED_VPC_CIDR_CONFLICT

CIDR blocks conflict. The new CIDR must include the original CIDR.

Last updated