Method: operations.cancel

Full name: projects.locations.operations.cancel

Starts 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 returnsgoogle.rpc.Code.UNIMPLEMENTED. Clients can useOperations.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 anOperation.error value with agoogle.rpc.Status.code of1, corresponding tocode.CANCELLED.

Endpoint

posthttps://{service-endpoint}/v1/{name}:cancel

Where{service-endpoint} is one of thesupported service endpoints.

Path parameters

namestring

The name of the operation resource to be cancelled.

Request body

The request body must be empty.

Response body

If successful, the response body is an empty JSON object.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-06-27 UTC.