Halaman ini menjelaskan cara membatalkan operasi ekspor untuk file CSV dan file dump SQL.
Sebelum memulai
Untuk membatalkan ekspor data, temukan ID operasi ekspor yang ingin Anda batalkan. Untuk menemukan ID, lakukan salah satu hal berikut:
Ikuti petunjuk di Mengekspor file SQL. ID operasi ditampilkan di kolom
namerespons.Lakukan panggilan
operations.listdi cluster AlloyDB.
Membatalkan operasi ekspor
Anda dapat menggunakan perintah gcloud atau REST API untuk membatalkan operasi ekspor.
gcloud
Gunakan perintah gcloud alloydb operations cancel untuk membatalkan operasi:
gcloud alloydb operations cancel OPERATION_ID --region=REGIONGanti OPERATION_ID dengan ID operasi. Untuk mengetahui informasi selengkapnya, lihat
Sebelum memulai.
REST v1
Gunakan metode HTTP dan URL berikut:
POST https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:cancel
Untuk informasi selengkapnya, lihat cancel.
Sebelum menggunakan data permintaan apa pun, buat penggantian berikut:
- PROJECT_ID: project ID.
- REGION: region tempat cluster AlloyDB di-deploy.
- OPERATION_ID: ID operasi ekspor. Untuk mengetahui informasi selengkapnya, lihat Sebelum memulai.
Untuk mengirim permintaan Anda, perluas salah satu opsi berikut:
curl (Linux, macOS, atau Cloud Shell)
Jalankan perintah berikut:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
POST https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:cancel
PowerShell (Windows)
Jalankan perintah berikut:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "POST https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:cancel" | Select-Object -Expand Content
Anda akan menerima respons JSON yang mirip dengan berikut ini:
Panggilan REST API ini tidak menampilkan respons apa pun. Untuk mengetahui informasi selengkapnya tentang cara memeriksa status pembatalan operasi ekspor, lihat Memeriksa status yang dibatalkan.
Memeriksa status yang dibatalkan
Anda dapat menggunakan perintah gcloud atau REST API untuk memeriksa status operasi ekspor yang dibatalkan.
gcloud
Gunakan perintah gcloud alloydb operations describe untuk memeriksa status operasi yang dibatalkan.
gcloud alloydb operations describe OPERATION_ID --region=REGIONGanti variabel OPERATION_ID dengan ID operasi yang dibatalkan.
Untuk mengetahui informasi selengkapnya, lihat Sebelum memulai.
REST v1
Jalankan perintah berikut:
GET https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:describe
Untuk informasi selengkapnya, lihat get.
Sebelum menggunakan data permintaan apa pun, buat penggantian berikut:
- REGION: region tempat cluster AlloyDB di-deploy.
- PROJECT_ID: project ID.
- OPERATION_ID: ID operasi ekspor. Untuk mengetahui informasi selengkapnya, lihat Sebelum memulai.
Untuk mengirim permintaan Anda, perluas salah satu opsi berikut:
curl (Linux, macOS, atau Cloud Shell)
Jalankan perintah berikut:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:describe
PowerShell (Windows)
Jalankan perintah berikut:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://alloydb.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID:describe
Anda akan menerima respons JSON yang mirip dengan berikut ini:
Jika berhasil, isi respons akan berisi instance Operation.
Langkah berikutnya
- Pelajari cara mengekspor file CSV.
- Pelajari cara mengekspor file dump SQL.