Modifies the name and description of a vSwitch.

Usage notes

  • The ModifyVSwitchAttribute operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the DescribeVSwitchAttributes operation to query the status of a vSwitch:
    • If the vSwitch is in the Pending state, the vSwitch is being modified.
    • If the vSwitch is in the Available state, the vSwitch is available.
  • You cannot repeatedly call the ModifyVSwitchAttribute operation to modify the name and description of a vSwitch within the specified period of time.

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 ModifyVSwitchAttribute

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

VSwitchId String Yes vsw-25nacdfvue4****

The ID of the vSwitch.

VSwitchName String No VSwitch-1

The new name for the vSwitch.

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

RegionId String No cn-hangzhou

The ID of the region where the vSwitch is deployed. You can call the DescribeRegions operation to query the most recent region list.

Description String No This is my vswitch.

The new description for the vSwitch.

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

Ipv6CidrBlock Integer No 10

The last eight bits of the IPv6 CIDR block of the vSwitch. Valid values: 0 to 255.

You can set this parameter only when the IPv6 feature is enabled for the virtual private cloud (VPC) to which the vSwitch belongs.

EnableIPv6 Boolean No false

Specifies whether to enable the IPv6 feature for the vSwitch. Valid values:

  • true: enables the IPv6 feature.
  • false: disables the IPv6 feature. This is the default value.
VpcIpv6CidrBlock String No 2408:XXXX:312:3e00::/56

The IPv6 CIDR block of the VPC to which the vSwitch belongs.

You can set this parameter only when the IPv6 feature is enabled for the VPC.

Response parameters

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyVSwitchAttribute
&VSwitchId=vsw-25nacdfvue4****
&<Common request parameters>

Sample responses

XML format

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

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

JSON format

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

{
  "RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HttpCode Error code Error message Description
400 InvalidVSwitchName.Malformed Specified virtual switch name is not valid. The error message returned because the format of the specified vSwitch name is invalid. Specify the name in the valid format.
400 InvalidVSwitchDiscription.Malformed Specified virtual switch description is not valid. The error message returned because the format of the description is invalid.
400 InvalidVSwitchDiscription.Malformed Specified virtual switch description is not valid. The error message returned because the description of the vSwitch is invalid.
400 Forbidden.VRouterNotFound specified virtual switch is not found during access authentication. The specified vSwitch is not found during access authentication.
400 UnsupportedFeature.CloudBoxIpv6 The IPv6 feature is not supported by cloud box. The error message returned because you cannot create IPv6 addresses for a cloud box.
400 OperationFailed.Ipv6InstanceExist Operation failed because vswitch has ipv6 instance. The error message returned because IPv6 instances exist in the vSwitch.
400 IncorrectStatus.VpcRouteEntry The status of the specified routeEntry is invalid. The error message returned because the status of the VPC routes is invalid.
400 OperationFailed.IPv6Disabled Operation failed because IPv6 is not enabled for the vSwitch. The error message returned because the IPv6 feature is disabled.
404 InvalidVSwitchId.NotFound The specified virtual switch does not exists. The error message returned because the specified vSwitch does not exist. Check whether the specified vSwitch ID is valid.

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