Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Membatalkan transfer. Gunakan metode transferOperations.get untuk memeriksa apakah pembatalan berhasil atau apakah operasi selesai meskipun ada permintaan cancel.
Saat Anda membatalkan operasi, transfer yang sedang berjalan akan terganggu. Untuk tugas transfer berulang, instance tugas transfer berikutnya akan tetap berjalan. Misalnya, jika tugas Anda dikonfigurasi untuk berjalan setiap hari pukul 13.00 dan Anda membatalkan operasi hari Senin pukul 13.05, transfer hari Senin akan berhenti. Namun, tugas transfer akan tetap dicoba pada hari Selasa.
Hal ini hanya berlaku untuk operasi yang sedang berjalan. Jika operasi saat ini tidak berjalan, cancel tidak melakukan apa pun.
Saat Anda membatalkan tugas, tugas berikutnya akan menghitung delta file dan dapat memperbaiki status yang tidak konsisten. Misalnya, jika Anda menjalankan tugas setiap hari, dan tugas hari ini menemukan 10 file baru dan mentransfer lima file sebelum Anda membatalkan tugas, operasi transfer besok akan menghitung delta baru dengan lima file yang tidak disalin hari ini ditambah file baru yang ditemukan besok.
Permintaan HTTP
POST https://storagetransfer.googleapis.com/v1/{name=transferOperations/**}:cancel
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-03-04 UTC."],[],[],null,["# Method: transferOperations.cancel\n\nCancels a transfer. Use the [transferOperations.get](/storage-transfer/docs/reference/rest/v1/transferOperations/get#google.longrunning.Operations.GetOperation) method to check if the cancellation succeeded or if the operation completed despite the `cancel` request.\n\nWhen you cancel an operation, the currently running transfer is interrupted. For recurring transfer jobs, the next instance of the transfer job will still run. For example, if your job is configured to run every day at 1pm and you cancel Monday's operation at 1:05pm, Monday's transfer will stop. However, a transfer job will still be attempted on Tuesday.\n\nThis applies only to currently running operations. If an operation is not currently running, `cancel` does nothing.\n\n\u003cbr /\u003e\n\n| **Caution:** Canceling a transfer job can leave your data in an unknown state. We recommend that you restore the state at both the destination and the source after the `cancel` request completes so that your data is in a consistent state.\n\n\u003cbr /\u003e\n\nWhen you cancel a job, the next job computes a delta of files and may repair any inconsistent state. For instance, if you run a job every day, and today's job found 10 new files and transferred five files before you canceled the job, tomorrow's transfer operation will compute a new delta with the five files that were not copied today plus any new files discovered tomorrow.\n\n### HTTP request\n\n`POST https://storagetransfer.googleapis.com/v1/{name=transferOperations/**}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]