DeleteVpc
呼叫 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. | |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | |
| 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 | |
| 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. | |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | |
| 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. | |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | |
| 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. | |
| 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. | |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。