All Products
Search
Document Center

:ModifyVpcAttribute

最終更新日:Aug 22, 2023

Modifies the name and description of a virtual private cloud (VPC).

Usage notes

  • You cannot repeatedly call the ModifyVpcAttribute operation to modify the name and description of a VPC within the specified period of time.
  • You can call the ModifyVpcAttribute operation to enable IPv6 for a VPC. However, you cannot modify the IPv6 CIDR block or IPv6 CIDR block type for a VPC that has IPv6 enabled.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ModifyVpcAttribute

The operation that you want to perform. Set the value to ModifyVpcAttribute.

VpcId String Yes vpc-bp1qtbach57ywecf****

The ID of the VPC that you want to modify.

Description String No This is my VPC.

The new description of the VPC.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

VpcName String No Vpc-1

The new name of the VPC.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

CidrBlock String No 192.168.0.0/24

The new IPv4 CIDR block of the VPC.

You can specify a larger or smaller IPv4 CIDR block than the IPv4 CIDR block of the VPC. The subnet mask must be 8 to 28 bits in length. If you specify a smaller IPv4 CIDR block and existing IP addresses do not fall within the CIDR block, the modification fails.

Note

Your services are not affected when you modify the VPC CIDR block.

RegionId String No cn-hangzhou

The ID of the region where the VPC is deployed.

You can call the DescribeRegions operation to query the most recent region list.

EnableIPv6 Boolean No false

Specifies whether to enable IPv6 CIDR blocks. Valid values:

  • true

  • false (default)

Ipv6CidrBlock String No 2408:XXXX:0:6a::/56

The IPv6 CIDR block of the VPC.

Ipv6Isp String No BGP

The type of IPv6 CIDR block. Valid values:

  • BGP (default)
  • ChinaMobile
  • ChinaUnicom
  • ChinaTelecom
Note

If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, valid values are: ChinaTelecom, ChinaUnicom, and ChinaMobile.

Response parameters

Parameter

Type

Example

Description

RequestId String 43B72D30-25E1-4FA3-96A8-89374A521D1A

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyVpcAttribute
&VpcId=vpc-bp1qtbach57ywecf****
&Description=This is my VPC.
&VpcName=Vpc-1
&CidrBlock=192.168.0.0/24
&RegionId=cn-hangzhou
&EnableIPv6=false
&Ipv6CidrBlock=2408:XXXX:0:6a::/56
&Ipv6Isp=BGP
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyVpcAttributeResponse>
    <RequestId>43B72D30-25E1-4FA3-96A8-89374A521D1A</RequestId>
</ModifyVpcAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "43B72D30-25E1-4FA3-96A8-89374A521D1A"
}

Error codes

HttpCode

Error code

Error message

Description

400 InvalidVpcName.Malformed Specified VPC name is not valid. The format of the VPC name is invalid. Enter a valid VPC name and try again.
400 InvalidVpcDiscription.Malformed Specified VPC description is not valid. The format of the VPC description is invalid.
400 InvalidParameter Specified UserCidr invalid format. The format of the user CIDR block is invalid.
400 InvalidParameter Specified UserCidr Subnet mask is not valid . The subnet mask of the user CIDR block is invalid.
400 InvalidUserCidr.Quota Specified UserCidr number is greater than 3. The number of user CIDR blocks has reached the upper limit.
400 InvalidUserCidr.Malformed Specified UserCidr overlapping in of 100.64.0.0/10. The user CIDR block that you specify overlaps with 100.64.0.0/10.
400 IncorrectVpcStatus Current VPC status does not support this operation. This operation cannot be performed when the VPC is in the current state.
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid. The format of the specified CIDR block is invalid.
400 OperationFailed.Ipv6GatewayInUse The IPv6 gateway is in use. You cannot modify the VPC attributes because the IPv6 gateway is in use.
400 OperationFailed.QueryCenIpv6Status Failed to query the IPv6 status of the specified VPC in CEN. The operation failed because the system failed to query the IPv6 status of the VPC that is attached to the CEN instance.
400 OperationUnsupported.CenIpv6Enabled The IPv6 feature is enabled in CEN. The IPv6 feature is already enabled for CEN.
400 UnsupportedFeature.Ipv6Isp The Ipv6Isp feature is not supported. The specified IPv6 ISP is not supported.
400 ResourceNotEnough.Ipv6Cidr The specified resource ipv6 cidr is not enough. Insufficient IPv6 CIDR block resources.
400 OperationFailed.IPv6CidrNotReserved The IPv6 CIDR block is not reserved. The operation failed. The IPv6 CIDR block is not reserved.
404 InvalidVpcId.NotFound Specified VPC does not exist. The VPC is not found.

For a list of error codes, see Service error codes.