Method: enterprises.devices.operations.cancel
Startet den asynchronen Abbruch eines lang andauernden Vorgangs. Der Server unternimmt alles, um den Vorgang abzubrechen, aber der Erfolg kann nicht garantiert werden. Wenn der Server diese Methode nicht unterstützt, wird google.rpc.Code.UNIMPLEMENTED
zurückgegeben. Kunden können Operations.GetOperation
oder andere Methoden verwenden, um zu prüfen, ob der Abbruch erfolgreich war oder der Vorgang dennoch abgeschlossen wurde. Bei erfolgreichem Abbruch wird der Vorgang nicht gelöscht. Stattdessen wird daraus ein Vorgang mit einem Operation.error
-Wert mit einem google.rpc.Status.code
von 1
, was Code.CANCELLED
entspricht.
HTTP-Anfrage
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
Die URL verwendet die Syntax der gRPC-Transcodierung.
Pfadparameter
Parameter |
name |
string
Der Name der abzubrechenden Vorgangsressource
|
Anfragetext
Der Anfragetext muss leer sein.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, ist der Antworttext ein leeres JSON-Objekt.
Autorisierungsbereiche
Erfordert den folgenden OAuth-Bereich:
https://www.googleapis.com/auth/androidmanagement
Weitere Informationen finden Sie unter OAuth 2.0 Overview.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-01-30 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-01-30 (UTC)."],[[["Cancels a long-running operation asynchronously, with the server making a best effort to cancel the operation but success is not guaranteed."],["Uses an HTTP POST request to `https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel` with the operation name as a path parameter and an empty request body."],["If cancellation is successful, the response body will be empty and the operation will have an error value with a code of 1, indicating cancellation."],["Requires authorization with the `https://www.googleapis.com/auth/androidmanagement` OAuth scope."]]],["This document details the process of initiating asynchronous cancellation for a long-running operation. The core action is sending a `POST` request to a specific URL, defined by a path parameter `name`, indicating the operation to cancel. The request body must be empty. A successful cancellation results in an empty JSON object response, and the operation's error code is set to `1` (`Code.CANCELLED`). The authorization requires the `https://www.googleapis.com/auth/androidmanagement` OAuth scope. The server might not support this method, and cancellation is not guaranteed.\n"]]