Method: operations.cancel
Memulai pembatalan asinkron pada operasi yang berjalan lama. Server berusaha semaksimal mungkin untuk membatalkan operasi, tetapi keberhasilan tidak dijamin. Jika server tidak mendukung metode ini, google.rpc.Code.UNIMPLEMENTED
akan ditampilkan. Klien dapat menggunakan Operations.GetOperation
atau metode lain untuk memeriksa apakah pembatalan berhasil atau apakah operasi selesai meskipun terjadi pembatalan. Jika pembatalan berhasil, operasi tidak dihapus; sebagai gantinya, operasi ini menjadi operasi dengan nilai Operation.error
dengan google.rpc.Status.code
1
, yang sesuai dengan Code.CANCELLED
.
Permintaan HTTP
POST https://vault.googleapis.com/v1/{name=operations/**}:cancel
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
name |
string
Nama resource operasi yang akan dibatalkan.
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons adalah objek JSON kosong.
Cakupan otorisasi
Memerlukan cakupan OAuth berikut:
https://www.googleapis.com/auth/ediscovery
Untuk mengetahui informasi selengkapnya, lihat OAuth 2.0 Overview.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-02-06 UTC.
[null,null,["Terakhir diperbarui pada 2025-02-06 UTC."],[[["Initiates the cancellation process for a long-running operation, although cancellation success is not guaranteed."],["Uses the `POST` method with a specific URL structure including the operation name for cancellation."],["Requires an empty request body and returns an empty response body upon successful cancellation."],["In case of unsupported cancellation by the server, an `UNIMPLEMENTED` error code is returned."],["If cancelled successfully, the operation is not deleted but marked with a `CANCELLED` status code."]]],["This document details the process of initiating asynchronous cancellation for a long-running operation. It uses an HTTP POST request to `vault.googleapis.com/v1/{name=operations/**}:cancel`. The `name` parameter specifies the operation to cancel. The request body must be empty, and a successful response returns an empty JSON object. The server attempts cancellation, and clients can check the status via `Operations.GetOperation`. Successful cancellation results in an `Operation.error` with `Code.CANCELLED`. Authorization requires the `https://www.googleapis.com/auth/ediscovery` OAuth scope.\n"]]