Method: operations.cancel
Rozpoczyna asynchroniczne anulowanie długotrwałej operacji. Serwer dokłada wszelkich starań, aby anulować operację, ale nie można tego zagwarantować. Jeśli serwer nie obsługuje tej metody, zwraca google.rpc.Code.UNIMPLEMENTED
. Klienci mogą użyć Operations.GetOperation
lub innych metod, aby sprawdzić, czy anulowanie się powiodło lub czy operacja została zakończona pomimo anulowania. Po anulowaniu operacji nie jest ona usuwana. Zamiast tego staje się operacją o wartości Operation.error
z wartością google.rpc.Status.code
= 1
, która odpowiada operacji Code.CANCELLED
.
Żądanie HTTP
POST https://vault.googleapis.com/v1/{name=operations/**}:cancel
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
name |
string
Nazwa zasobu operacji, który ma zostać anulowany.
|
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi to pusty obiekt JSON.
Zakresy autoryzacji
Wymaga następującego zakresu OAuth:
https://www.googleapis.com/auth/ediscovery
Więcej informacji znajdziesz w OAuth 2.0 Overview.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-02-06 UTC.
[null,null,["Ostatnia aktualizacja: 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"]]