All Products
Search
Document Center

Virtual Private Cloud:ModifyVSwitchAttribute

Last Updated:Nov 13, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ModifyVSwitchAttributeupdate
  • VSwitch
    acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VSwitchIdstringYes

The ID of the vSwitch.

vsw-25nacdfvue4****
VSwitchNamestringNo

The new name for the vSwitch.

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

VSwitch-1
RegionIdstringNo

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
DescriptionstringNo

The new description for the vSwitch.

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

This is my vswitch.
Ipv6CidrBlockintegerNo

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
EnableIPv6booleanNo

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.
false
VpcIpv6CidrBlockstringNo

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

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidDescription.MalformedInvalid description.-
400InvalidVSwitchName.MalformedSpecified virtual switch name is not valid.The format of the specified vSwitch name is invalid. Specify the name in the valid format.
400InvalidVSwitchDiscription.MalformedSpecified virtual switch description is not valid.The format of the vSwitch description is invalid.
400InvalidVSwitchDiscription.MalformedSpecified virtual switch description is not valid.The vSwitch description is invalid.
400Forbidden.VRouterNotFoundspecified virtual switch is not found during access authentication.The specified vSwitch is not found during access authentication.
400OperationFailed.Ipv6AlreadyEnabled%s-
400OperationFailed.VpcIpv6Disabled%s-
400OperationFailed.Ipv6CidrBlockExisted%s-
400IllegalParam.Ipv6CidrBlock%s-
400IncorrectStatus.VSwitchThe status of the specified VSwitch is invalid.The status of the specified VSwitch is invalid.
400UnsupportedFeature.CloudBoxIpv6The IPv6 feature is not supported by cloud box.You cannot create an IPv6 address for a CloudBox instance.
400IllegalParam.VpcIpv6CidrBlock%s-
400OperationFailed.Ipv6InstanceExistOperation failed because vswitch has ipv6 instance.IPv6 instances exist in the vSwitch.
400IncorrectStatus.VpcRouteEntryThe status of the specified routeEntry is invalid.The status of the VPC route entry is invalid.
400OperationFailed.IPv6DisabledOperation failed because IPv6 is not enabled for the vSwitch.The IPv6 feature is disabled.
400ParamExclusive.DisableIpv6AndIpv6CidrBlockDisableIpv6 and Ipv6Cidr are mutually exclusive.You cannot modify Ipv6Cidr and DisableIpv6 at the same time.
400IncorrectStatus.cbnStatusCurrent CBN status does not support this operation.The status of the CEN instance is invalid.
404InvalidVSwitchId.NotFoundThe 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 timeSummary of changesOperation
2024-11-07The Error code has changedView Change Details
2024-10-08The Error code has changedView Change Details
2023-08-24API Description Update. The Error code has changedView Change Details
2023-06-30The Error code has changedView Change Details