Deletes a VSwitch.

Note the following before you call this action:
  • You first must release or remove all resources under the VPC, including VSwitches, cloud product instances, router interfaces, and HAVIPs.

  • Only VSwitches in the available status can be deleted.

  • A VSwitch cannot be deleted when the VPC to which it belongs is creating or deleting a VSwitch or route entry.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DeleteVSwitch

The name of this action. Value:

DeleteVSwitch

VSwitchId String Yes vsw-asdfjlnaue4g

The ID of the VSwitch to delete.

Response parameters

Parameter Type Example value Description
RequestId String AF083E3D-7E29-4B77-A937-1F129802D5XXXXXX The ID of the request.

Examples

Request example


http(s)://vpc.aliyuncs.com/?Action=DeleteVSwitch
&VSwitchId=vsw-asdfjlnaue4g
&<CommonParameters>
Response example
  • XML format

    <DeleteVSwitchResponse>
      <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
    </DeleteVSwitchResponse>
    
  • JSON format

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

Error codes

HTTP status code Error code Error message Description
400 IncorrectVSwitchStatus The current virtual switch status does not support this operation. The specified VSwitch failed to be deleted because it was in the Pending state.
400 DependencyViolation Some route entry status blocked this operation. The route table contains entries in the Pending or Modifying status.
400 IncorrectRouteEntryStatus Some route entry status blocked this operation. The route table contains entries in the Pending or Modifying state.
400 DependencyViolation.HaVip VSwitch cannot be deleted when there are some HaVip dependent with it. You cannot delete this VSwitch because a HAVIP is bound to it.
400 MissingParameter Miss mandatory parameter. The required parameters are missing.
404 InvalidVSwitchId.NotFound VSwitch not exist. The specified VSwitch does not exist.
404 IncorrectStatus Vswtich status not stable. The VSwitch is currently in the Pending or Modifying status. Please try again later.

See common error codes