Inicia la cancelación asincrónica en una operación de larga duración. El servidor realiza su mejor esfuerzo para cancelar la operación, pero no se garantiza el éxito. Si el servidor no es compatible con este método, muestra google.rpc.Code.UNIMPLEMENTED. Los clientes pueden usar Operations.GetOperation o los otros métodos para comprobar si la cancelación se realizó de forma correcta o si la operación se completó a pesar de la cancelación. Si la cancelación se realiza de forma correcta, la operación no se borra. En lugar de ello, se convierte en una operación que tiene un valor Operation.error con un google.rpc.Status.code de 1, que corresponde a Code.CANCELLED.
Solicitud HTTP
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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"]]