呼叫 DeleteVpc 介面刪除一個專有網路 VPC(Virtual Private Cloud)。
介面說明
呼叫該介面刪除 VPC 時,請注意:
-
刪除 VPC 之前,需要先釋放或轉移 VPC 內的所有資源,包括交換器、雲端產品執行個體、高可用虛擬 IP 等。
-
只有處於 Available 狀態的 VPC 才可以被刪除。
-
DeleteVpc 介面屬於非同步介面,即系統會返回一個請求 ID,但該 VPC 尚未刪除成功,系統背景的刪除任務仍在進行。您可以呼叫 DescribeVpcAttribute 查詢 VPC 的刪除狀態:
當 VPC 處於 Deleting 狀態時,表示 VPC 正在刪除中。
當查詢不到指定的 VPC 時,表示 VPC 刪除成功。
-
DeleteVpc 介面不支援並行刪除同一個 VPC。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
vpc:DeleteVpc |
delete |
*VPC
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| VpcId |
string |
是 |
要刪除的 VPC ID。 |
vpc-bp1m7v25emi1h5mtc**** |
| RegionId |
string |
否 |
要刪除的 VPC 所在的地域 ID。 您可以透過呼叫 DescribeRegions 介面取得地域 ID。 |
cn-hangzhou |
| ForceDelete |
boolean |
否 |
是否強制刪除 VPC。取值:
當 VPC 下僅存在以下資源時可強制刪除 VPC:
|
false |
| DryRun |
boolean |
否 |
是否只預檢此次請求。取值:
|
false |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的冪等性。 從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 可能不一樣。 |
123e4567-e89b-12d3-a456-426655440000 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
請求 ID。 |
||
| RequestId |
string |
請求 ID。 |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | IncorrectStatus.VpcDhcpStatus | The DhcpOptionsSet status of vpc does not support this operation. | 目前 VPC 中的 DHCP 選項集執行個體狀態不支援刪除 VPC。 |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | VPC 中還有終端節點,不能被刪除,請先刪除該 VPC 中的終端節點再刪除 VPC。 |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | DependencyViolation.RouteEntry | Specified object has dependent resources | 當前資源仍被路由條目所依賴。 |
| 400 | DependencyViolation.Instance | Specified object has dependent resources | |
| 400 | DependencyViolation.VSwitch | Specified object has dependent resources | 目前 VPC 仍存在未刪除的交換器,VPC 刪除失敗,請刪除 VPC 下的交換器後再嘗試刪除 VPC。 |
| 400 | DependencyViolation.RouteInterface | Specified object has dependent route interface . | |
| 400 | DependencyViolation.Tunnel | Specified object has dependent tunnel. | |
| 400 | DependencyViolation.NatGateway | Specified object has dependent resources NatGateway. | VPC 中還有 NAT 閘道器,不能被刪除,請先刪除該 VPC 中的 NAT 閘道器再刪除 VPC。 |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | 目前 VPC 仍存在未刪除的安全性群組 [%s],VPC 刪除失敗,請先刪除該 VPC 下的安全性群組後再刪除 VPC。 |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | 指定的 VPC 不存在,請您檢查 VPC 是否正確。 |
| 400 | Forbbiden | Active custom route in vpc. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | 操作過於頻繁,請稍候再重試。 |
| 400 | InvalidAction | The VPC has been connected to the classic network ECS. Please cancel the connection before proceeding. | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | CBN 目前狀態不正確。 |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | 當存在網路 ACL 時,無法刪除 VSwitch。 |
| 400 | DependencyViolation.ClassicLinkInstance | Specified object has active classicLink instance. | |
| 400 | System.ServiceBusy | System is busy, please try later. | |
| 400 | DependencyViolation.DhcpOptionsSet | The VPC cannot be deleted when it is associated with dhcpOptionsSet. | 目前 VPC 還存在未刪除的 DHCP 選項集執行個體,不允許刪除。 |
| 400 | InvalidRegionId.NotFound | The specified region is not found. | 參數錯誤。 |
| 400 | DependencyViolation.CustomRouteTable | CustomRouteTable already exists. | 依賴衝突,存在自訂路由表。 |
| 400 | DependencyViolation.Ipv4Gateway | The VPC cannot be deleted when it has ipv4Gateway. | 該 VPC 下存在 IPv4 閘道器,無法刪除。 |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | 指定操作被禁止,因為 VPC 中存在 VPC 對等連線執行個體。 |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | 該 VPC 存在反向存取授權關係,無法刪除。 |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | 該 VPC 存在對端 RouterInterface 未刪除,刪除 VPC 失敗。 |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | 您指定的資源被其他資源依賴,不允許進行目前操作。 |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | 該 VPC 存在 IPv6 閘道器,無法刪除。 |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | 該 VPC 存在雲端服務資源,無法刪除。 |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | 目前 VPC 的私有網域名稱狀態不支援此操作。 |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %s. | VPC 已關聯到專線閘道器 %s,不允許刪除。 |
| 400 | IncorrectStatus.RouteTableStatus | Route table [%s] status [%s] is not stable. Please try again later. | 路由表 [%s] 狀態 [%s] 未處於穩態。請稍後重試。 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied | The operation is not supported in this status. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。