DeleteVSwitch - 删除交换机

更新时间:
复制 MD 格式

调用DeleteVSwitch接口删除交换机。

接口说明

调用该接口删除交换机时,请注意以下事项:

  • 删除交换机之前,需要先释放或移走 VPC 内的所有资源,包括交换机、云产品实例、路由器接口、HaVip 等。

  • 只有处于 Available 状态的交换机可以被删除。

  • 交换机所在的 VPC 正在创建或删除交换机或路由条目时,无法删除交换机。

  • DeleteVSwitch 接口属于异步接口,即系统会返回一个请求 ID,但该交换机尚未删除成功,系统后台的删除任务仍在进行。您可以调用 DescribeVSwitchAttributes 查询交换机的删除状态:

    • 当交换机处于 Pending 状态时,表示交换机正在删除中。

    • 当查询不到指定的交换机时,表示交换机删除成功。

  • DeleteVSwitch 接口不支持并发删除同一个交换机。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

vpc:DeleteVSwitch

delete

*VSwitch

acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}

请求参数

名称

类型

必填

描述

示例值

VSwitchId

string

要删除的交换机的 ID。

vsw-asdfjlna****

RegionId

string

要删除的交换机的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

DryRun

boolean

是否只预检此次请求。取值:

  • true:发送检查请求,不会删除交换机。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回 HTTP 2xx 状态码并直接进行删除。

false

返回参数

名称

类型

描述

示例值

object

返回信息。

RequestId

string

请求 ID。

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

示例

正常返回示例

JSON格式

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

错误码

HTTP status code

错误码

错误信息

描述

400 OperationDenied.OtherSubnetProcessing other subnet is processing. 无法删除当前虚拟交换机(vSwitch),因为其他子网正在操作中。
400 IncorrectVSwitchStatus vpc subnet is in middle status.
400 DependencyViolation Resources deployed in the vSwitch have not been deleted. 该交换机下还有资源未释放,无法删除。
400 IncorrectRouteEntryStatus Some route entry status blocked this operation.
400 DependencyViolation.HaVip VSwitch cannot be deleted when there are some HaVip dependent with it. 无法删除交换机,该交换机下有关联的HaVip。
400 DependencyViolation.RouteTable VSwitch cannot be deleted when associated with route table
400 MissingParameter Miss mandatory parameter.
400 TaskConflict The operation is too frequent, TaskConflict. 操作太频繁,请稍后重试
400 DependencyViolation.SNAT The vswitch cannot be deleted when used by snat. snat使用时,无法删除vswitch。
400 DeleteVSwitch.IncorrectStatus.cbnStatus Current CBN status does not support this operation. 当前CBN状态不支持删除虚拟交换机(VSwitch)操作
400 AttrMismatching.NaclAndBindInstance The network acl and resource not in same vpc.
400 InvalidResource.NotBinding The resource has not been binded.
400 DependencyViolation.SnatEntry VSwitch cannot be deleted when snat entry exist.
400 DependencyViolation.NetworkAcl VSwitch cannot be deleted when network acl exist. 当存在网络acl时,无法删除VSwitch。
400 DependencyViolation.EnhancedNatgw VSwitch cannot be deleted when natgw exist. natgw存在时,无法删除VSwitch。
400 DependencyViolation.ResourceShare VSwitch cannot be deleted when resource share exist.
400 OperationFailed.SystemBusy Operation failed because system is busy. 系统繁忙,请稍后重试
400 DependencyViolation.MulticastDomain VSwitch cannot be deleted when associated with multicast domain. VSwitch加入了组播域,无法删除。
400 DependencyViolation.VSwitchCidrReservation VSwitch cannot be deleted when vswitch cidr reservation exist. VSwitch存在VSwitchCidrReservation使用中,不允许删除
400 DependencyViolation.CloudService VSwitch cannot be deleted when uesd by cloud service. 当前交换机正被云服务使用无法删除,请确认云服务使用场景。
400 InvalidVSwitchId.NotFound VSwitch not exist.
400 OperationFailed.Ipv6InstanceExist Operation failed because vswitch has ipv6 instance. 交换机中存在IPv6实例。
400 DependencyViolation.Ipv6Address The specified resource of %s depends on %s, so the operation cannot be completed. 您指定的资源被其他的资源依赖,不允许进行当前操作
400 DependencyViolation.%s The specified resource of [%s] depends on [%s], so the operation cannot be completed. 操作的资源[%s]依赖了[%s],请先删除依赖资源后再操作。
400 Forbidden.RegionNotFound Specified instance is not found during access authentication. 当前Region不支持
400 IncorrectStatus Vswtich status not stable.
400 DependencyViolation.RouterInterface Specified object has dependent resources RouterInterface.
400 InvalidRegionId.NotFound The specified region is not found. 指定地域不存在。
404 IncorrectVSwitchId Specified vSwtich instance is not found during access authentication. 权限校验过程中,未找到指定的虚拟交换机(vSwtich)实例
404 InvalidVSwitchId.NotFound VSwitch not exist.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情