Memanggil operasi DeleteVpc untuk menghapus Virtual Private Cloud (VPC).
Deskripsi operasi
Saat memanggil operasi ini untuk menghapus VPC, perhatikan hal berikut:
-
Sebelum menghapus VPC, Anda harus merilis atau memigrasi semua Sumber daya di VPC, termasuk vSwitch, instans produk cloud, dan alamat IP virtual ketersediaan tinggi (HAVIP).
-
Hanya VPC dalam status Available yang dapat dihapus.
-
Operasi DeleteVpc bersifat asinkron. Setelah permintaan dikirim, ID permintaan akan dikembalikan, tetapi VPC tidak langsung dihapus. Tugas penghapusan berlanjut di latar belakang. Anda dapat memanggil operasi DescribeVpcAttribute untuk mengkueri status penghapusan VPC:
Saat VPC berada dalam status Deleting, VPC sedang dihapus.
Saat VPC yang ditentukan tidak dapat ditemukan, VPC telah dihapus.
-
Operasi DeleteVpc tidak mendukung penghapusan bersamaan untuk VPC yang sama.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DeleteVpc |
delete |
*VPC
|
|
None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| VpcId |
string |
Yes |
ID VPC yang akan dihapus. |
vpc-bp1m7v25emi1h5mtc**** |
| RegionId |
string |
No |
ID wilayah VPC yang akan dihapus. Anda dapat memanggil operasi DescribeRegions untuk mengkueri ID wilayah. |
cn-hangzhou |
| ForceDelete |
boolean |
No |
Apakah akan menghapus VPC secara paksa. Nilai valid:
VPC hanya dapat dihapus secara paksa jika Sumber daya berikut ada di VPC:
|
false |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run. Nilai valid:
|
false |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Nilai ClientToken hanya dapat berisi karakter ASCII. Catatan
Jika Anda tidak menentukan parameter ini, sistem menggunakan RequestId dari permintaan API sebagai ClientToken. RequestId mungkin berbeda untuk setiap permintaan API. |
123e4567-e89b-12d3-a456-426655440000 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
ID permintaan. |
||
| RequestId |
string |
ID permintaan. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncorrectStatus.VpcDhcpStatus | The DhcpOptionsSet status of vpc does not support this operation. | The status of the DHCP options set in the current VPC does not support VPC deletion. |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | The VPC contains endpoints and cannot be deleted. Delete the endpoints in the VPC before you delete the VPC. |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | DependencyViolation.RouteEntry | Specified object has dependent resources | The current VPC contains custom route entries that have not been deleted. Failed to delete the VPC. |
| 400 | DependencyViolation.Instance | Specified object has dependent resources | |
| 400 | DependencyViolation.VSwitch | Specified object has dependent resources | The current VPC contains vSwitches that have not been deleted. Failed to delete the VPC. Delete the vSwitches in the VPC and try again. |
| 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. | The VPC contains NAT gateways and cannot be deleted. Delete the NAT gateways in the VPC before you delete the VPC. |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | The current VPC contains security groups that have not been deleted. Failed to delete the VPC. Delete the security groups in the VPC before you delete the VPC. |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | The specified VPC does not exist. Check whether the VPC is correct. |
| 400 | Forbbiden | Active custom route in vpc. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | The operation is too frequent and a task conflict has occurred. |
| 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. | The current CBN status is invalid. |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | The specified object has dependent network ACL resources. |
| 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. | The current VPC contains DHCP options sets that have not been deleted. The deletion is not allowed. |
| 400 | InvalidRegionId.NotFound | The specified region is not found. | The specified region does not exist. |
| 400 | DependencyViolation.CustomRouteTable | CustomRouteTable already exists. | Dependency conflict. A custom route table exists. |
| 400 | DependencyViolation.Ipv4Gateway | The VPC cannot be deleted when it has ipv4Gateway. | The VPC contains an IPv4 gateway and cannot be deleted. |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | The specified operation is not allowed because a VPC peering connection exists in the VPC. |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | The VPC has a reverse access authorization relationship and cannot be deleted. |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | The peer router interface of the VPC has not been deleted. Failed to delete the VPC. |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | The specified resource is depended on by other resources. The current operation is not allowed. |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | The VPC contains an IPv6 gateway and cannot be deleted. |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | The VPC contains cloud service resources and cannot be deleted. |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | The DNS hostname status of the current VPC does not support this operation. |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %s. | The VPC is attached to ECR %s and cannot be deleted. |
| 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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.