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://{endpoint}/v1/{name=projects/*/locations/*/operations/*}:cancel
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos 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)."]]