All Products
Search
Document Center

NAT Gateway:DeleteNatGateway

Last Updated:Jun 12, 2026

Memanggil DeleteNatGateway untuk menghapus gateway NAT Internet yang ditentukan.

Deskripsi operasi

Operasi DeleteNatGateway bersifat asinkron. Setelah Anda memanggil operasi ini, sistem mengembalikan ID permintaan. Namun, penghapusan instans gateway NAT belum selesai, dan tugas penghapusan di latar belakang sistem masih berlangsung. Anda dapat memanggil operasi DescribeNatGateways untuk menanyakan status gateway NAT:

  • Jika gateway NAT dalam status Deleting, gateway NAT sedang dihapus. Dalam status ini, Anda hanya dapat melakukan operasi kueri dan tidak dapat melakukan operasi lainnya.

  • Jika instans gateway NAT tidak dapat ditanyakan, gateway NAT telah dihapus.

Catatan

Operasi untuk menghapus gateway NAT tidak dapat dibalik. Berhati-hatilah saat melakukan operasi ini.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID region dari gateway NAT.

Anda dapat memanggil operasi DescribeRegions untuk menanyakan daftar region terbaru.

cn-hangzhou

NatGatewayId

string

Yes

ID dari gateway NAT yang ingin Anda hapus.

ngw-bp1uewa15k4iy5770****

Force

boolean

No

Menentukan apakah akan menghapus gateway NAT secara paksa. Nilai yang valid:

  • true: menghapus gateway NAT secara paksa. Ketika nilainya true, deskripsi berikut berlaku:

    • Jika gateway NAT memiliki entri SNAT, sistem secara otomatis menghapus entri SNAT untuk Anda.

    • Jika gateway NAT memiliki entri DNAT, sistem secara otomatis menghapus entri DNAT untuk Anda.

    • Jika gateway NAT dikaitkan dengan EIP, sistem secara otomatis memutuskan keterkaitan EIP untuk Anda.

    • Jika gateway NAT memiliki paket bandwidth NAT yang belum dihapus, sistem secara otomatis menghapus paket bandwidth NAT untuk Anda.

  • false (default): tidak menghapus gateway NAT secara paksa. Ketika nilainya false, deskripsi berikut berlaku:

    • Jika gateway NAT memiliki paket bandwidth NAT yang belum dihapus, Anda harus menghapus paket bandwidth NAT terlebih dahulu.

    • Jika gateway NAT memiliki entri SNAT, Anda harus menghapus entri SNAT terlebih dahulu.

    • Jika gateway NAT memiliki entri DNAT, Anda harus menghapus entri DNAT terlebih dahulu.

    • Jika gateway NAT dikaitkan dengan EIP, Anda harus memutuskan keterkaitan EIP terlebih dahulu.

false

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 DependencyViolation.VpcEndpointService The specified resource of %s depends on %s, so the operation cannot be completed.
400 DependencyViolation.FullNatEntry The specified resource of %s depends on %s, so the operation cannot be completed.
400 DependencyViolation.RouterEntry The specified resource of %s depends on %s, so the operation cannot be completed.
400 DependencyViolation.BandwidthPackages There are BandwidthPackages on specified NatGateway not deleted.
400 DependencyViolation.EIPS There are Eips on specified NatGateway, please unbind it first.
400 Forbidden.PrePaidNatGateway The specified NatGateway is PrePaid.
400 InvalidOperation.DeletionProtection The instance cannnot delete because of deletion protecion.
400 DependencyViolation.SnatEntry The specified resource of %s depends on %s, so the operation cannot be completed.
400 IncorrectStatus.SnatEntry The status of %s [%s] is incorrect.
400 DependencyViolation.ForwardEntry The specified resource of %s depends on %s, so the operation cannot be completed.
400 IncorrectStatus.ForwardEntry The status of %s [%s] is incorrect.
400 DependencyViolation.NatIp The specified resource of %s depends on %s, so the operation cannot be completed.
400 IncorrectStatus.NatIp The status of %s [%s] is incorrect.
400 DependencyViolation.NatIpCidr The specified resource of %s depends on %s, so the operation cannot be completed.
400 IncorrectStatus.NatGateway The NatGateway instance is being deleted and needs to wait until the process is complete.
400 IncorrectStatus.RouterEntry The status of %s [%s] is incorrect.
400 IncorrectStatus.VSwitch The specified vSwitch status is invalid.
404 INSTANCE_NOT_EXISTS Instance not exists.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.
404 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records.
404 ResourceNotFound.NatGateway The specified resource of %s is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.