DeleteVSwitch

更新時間:
Copy as 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.
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.
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.
400 DeleteVSwitch.IncorrectStatus.cbnStatus Current CBN status does not support this operation.
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.
400 DependencyViolation.EnhancedNatgw VSwitch cannot be deleted when natgw exist.
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.
400 DependencyViolation.VSwitchCidrReservation VSwitch cannot be deleted when vswitch cidr reservation exist.
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.
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.
400 Forbidden.RegionNotFound Specified instance is not found during access authentication.
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.
404 InvalidVSwitchId.NotFound VSwitch not exist.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情