Modifies the name and description of a vSwitch.
Operation description
-
ModifyVSwitchAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeVSwitchAttributes operation to query the status of the task:
- If the vSwitch is in the Pending state, the name and description of the vSwitch are being modified.
- If the vSwitch is in the Available state, the name and description of the vSwitch are modified.
-
You cannot repeatedly call the ModifyVSwitchAttribute operation to modify the name and description of a vSwitch within the specified period of time.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:ModifyVSwitchAttribute | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VSwitchId | string | Yes | The ID of the vSwitch. | vsw-25nacdfvue4**** |
VSwitchName | string | No | The new name for the vSwitch. The name must be 1 to 128 characters in length, and cannot start with | VSwitch-1 |
RegionId | string | No | The ID of the region where the vSwitch is deployed. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
Description | string | No | The new description for the vSwitch. The description must be 1 to 256 characters in length and cannot start with | This is my vswitch. |
Ipv6CidrBlock | integer | No | 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. | 10 |
EnableIPv6 | boolean | No | Specifies whether to enable the IPv6 feature for the vSwitch. Valid values:
| false |
VpcIpv6CidrBlock | string | No | 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. | 2408:XXXX:312:3e00::/56 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidDescription.Malformed | Invalid description. | - |
400 | InvalidVSwitchName.Malformed | Specified virtual switch name is not valid. | 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 format of the vSwitch description is invalid. |
400 | InvalidVSwitchDiscription.Malformed | Specified virtual switch description is not valid. | The vSwitch description is invalid. |
400 | Forbidden.VRouterNotFound | specified virtual switch is not found during access authentication. | The specified vSwitch is not found during access authentication. |
400 | OperationFailed.Ipv6AlreadyEnabled | %s | - |
400 | OperationFailed.VpcIpv6Disabled | %s | - |
400 | OperationFailed.Ipv6CidrBlockExisted | %s | - |
400 | IllegalParam.Ipv6CidrBlock | %s | - |
400 | IncorrectStatus.VSwitch | The status of the specified VSwitch is invalid. | The status of the specified VSwitch is invalid. |
400 | UnsupportedFeature.CloudBoxIpv6 | The IPv6 feature is not supported by cloud box. | You cannot create an IPv6 address for a CloudBox instance. |
400 | IllegalParam.VpcIpv6CidrBlock | %s | - |
400 | OperationFailed.Ipv6InstanceExist | Operation failed because vswitch has ipv6 instance. | IPv6 instances exist in the vSwitch. |
400 | IncorrectStatus.VpcRouteEntry | The status of the specified routeEntry is invalid. | The status of the VPC route entry is invalid. |
400 | OperationFailed.IPv6Disabled | Operation failed because IPv6 is not enabled for the vSwitch. | The IPv6 feature is disabled. |
400 | ParamExclusive.DisableIpv6AndIpv6CidrBlock | DisableIpv6 and Ipv6Cidr are mutually exclusive. | You cannot modify Ipv6Cidr and DisableIpv6 at the same time. |
400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | The status of the CEN instance is invalid. |
404 | InvalidVSwitchId.NotFound | The specified virtual switch does not exists. | The vSwitch does not exist. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-08-24 | API Description Update. The Error code has changed | View Change Details |
2023-06-30 | The Error code has changed | View Change Details |