Inicia la cancelación asíncrona de una operación de larga duración. El servidor hace todo lo posible por cancelar la operación, pero no se garantiza su éxito. Si el servidor no admite este método, devuelve google.rpc.Code.UNIMPLEMENTED . Los clientes pueden usar Operations.GetOperation u otros métodos para comprobar si la cancelación se realizó correctamente o si la operación se completó a pesar de la cancelación. Si la cancelación se realiza correctamente, la operación no se elimina; en su lugar, se convierte en una operación con un valor Operation.error y un google.rpc.Status.code de 1 , que corresponde a Code.CANCELLED .
Solicitud HTTP
POST https://{endpoint}/v1/{name=projects/*/locations/*/operations/*}:cancel
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-06-12 (UTC)."],[],[],null,["# Method: projects.locations.operations.cancel\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n\nStarts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use [Operations.GetOperation](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.operations/get#google.longrunning.Operations.GetOperation) or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.operations#Operation.FIELDS.error) value with a [google.rpc.Status.code](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.operations#Status.FIELDS.code) of `1`, corresponding to `Code.CANCELLED`.\n\n### HTTP request\n\n`POST https://{endpoint}/v1/{name=projects/*/locations/*/operations/*}:cancel`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/kubernetes-engine/multi-cloud/docs/reference/rest#rest_endpoints).\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:\n\n- `gkemulticloud.operations.cancel`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]