Modifies the name and description of a specified VPC.

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 description of the VPC.

The description must be 2 to 256 characters in length and start with a letter. The description cannot start with http:// or https://.

VpcName String No Vpc-1

The name of the VPC.

The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter and cannot start with http:// or https://.

CidrBlock String No 192.168.0.0/24

The IPv4 CIDR block of the VPC. The block can be selected from 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8, and their subnets. The mask length ranges from 8 to 24 bits.

RegionId String Yes cn-hangzhou

The region where the VPC is deployed.

EnableIPv6 Boolean No true

Specifies whether to enable IPv6 CIDR blocks.

  • true: indicates that the IPv6 CIDR block is enabled.
  • false: indicates that the IPv6 CIDR block is disabled.

Response parameters

Parameter Type Example Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Sample requests

https://vpc.aliyuncs.com/?Action=ModifyVpcAttribute
&RegionId=cn-hangzhou
&VpcId=vpc-bp1qtbach57ywecf****
&<Common request parameters>

Sample success responses

XML format

<ModifyVpcAttributeResponse>
      <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</ModifyVpcAttributeResponse>

JSON format

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

Error codes

HttpCode Error code Error message Description
404 InvalidVpcId.NotFound Specified VPC does not exist. The error message returned because the specified VPC does not exist.
400 InvalidVpcName.Malformed Specified VPC name is not valid. The error message returned because the format of the VPC name is invalid.
400 InvalidVpcDiscription.Malformed Specified VPC description is not valid. The error message returned because the format of the VPC description is invalid.
400 InvalidParameter Specified UserCidr invalid format. The error message returned because the format of the user CIDR block is invalid.
400 InvalidParameter Specified UserCidr Subnet mask is not valid . The error message returned because the subnet mask of the user CIDR block is invalid.
400 InvalidUserCidr.Quota Specified UserCidr number is greater than 3. The error message returned because the Usercidr value has reached the upper limit.
400 InvalidUserCidr.Malformed Specified UserCidr overlapping in of 100.64.0.0/10. The error message returned because the UserCidr overlaps with 100.64.0.0/10.
400 IncorrectVpcStatus Current VPC status does not support this operation. The error message returned because the VPC in the current state does not support this operation.
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid. The error message returned because the format of the specified CIDR block is invalid.

For a list of error codes, visit the API Error Center.