Method: enterprises.devices.operations.cancel
Запускает асинхронную отмену длительной операции. Сервер делает все возможное, чтобы отменить операцию, но успех не гарантирован. Если сервер не поддерживает этот метод, он возвращает google.rpc.Code.UNIMPLEMENTED
. Клиенты могут использовать Operations.GetOperation
или другие методы, чтобы проверить, была ли отмена успешной или завершилась ли операция, несмотря на отмену. При успешной отмене операция не удаляется; вместо этого она становится операцией со значением Operation.error
и google.rpc.Status.code
, равным 1
, что соответствует Code.CANCELLED
.
HTTP-запрос
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
URL-адрес использует синтаксис транскодирования gRPC .
Параметры пути
Параметры |
---|
name | string Имя ресурса операции, которую необходимо отменить. |
Тело запроса
Тело запроса должно быть пустым.
Тело ответа
В случае успеха тело ответа представляет собой пустой объект JSON.
Области авторизации
Требуется следующая область действия OAuth:
-
https://www.googleapis.com/auth/androidmanagement
Для получения дополнительной информации см.OAuth 2.0 Overview .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-01-29 UTC.
[null,null,["Последнее обновление: 2025-01-29 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"]]