Method: operations.cancel
Stay organized with collections
Save and categorize content based on your preferences.
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 returns google.rpc.Code.UNIMPLEMENTED
. Clients can use 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
value with a google.rpc.Status.code
of 1
, corresponding to Code.CANCELLED
.
HTTP request
POST https://dai.googleapis.com/v1/{name=operations/**}:cancel
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
name |
string
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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-19 UTC."],[[["\u003cp\u003eInitiates the cancellation of a long-running operation, although cancellation success is not assured.\u003c/p\u003e\n"],["\u003cp\u003eIn case the server lacks support for this cancellation method, it responds with an \u003ccode\u003eUNIMPLEMENTED\u003c/code\u003e error code.\u003c/p\u003e\n"],["\u003cp\u003eCancellation, if successful, marks the operation with a \u003ccode\u003eCANCELLED\u003c/code\u003e status, but the operation is not removed.\u003c/p\u003e\n"],["\u003cp\u003eClients can verify the cancellation status or completion by querying with \u003ccode\u003eOperations.GetOperation\u003c/code\u003e or other relevant methods.\u003c/p\u003e\n"]]],["The core function described is to initiate the cancellation of a long-running operation via a `POST` HTTP request to a specific URL. The operation is identified by its name, provided as a path parameter. The request body must be empty. Upon successful cancellation, the operation's status will reflect a `CANCELLED` code, although success isn't guaranteed. The response body is empty when successful. The operation's status can be checked using `Operations.GetOperation`. If cancellation is not supported `google.rpc.Code.UNIMPLEMENTED` is returned.\n"],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\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](/video-creative-ingest/rest/v1/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](/video-creative-ingest/rest/v1/operations#Operation.FIELDS.error) value with a [google.rpc.Status.code](/video-creative-ingest/rest/v1/operations#Status.FIELDS.code) of `1`, corresponding to `Code.CANCELLED`.\n\nHTTP request\n\n`POST https://dai.googleapis.com/v1/{name=operations/**}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------|\n| `name` | `string` The name of the operation resource to be cancelled. |\n\nRequest body\n\nThe request body must be empty.\n\nResponse body\n\nIf successful, the response body is an empty JSON object."]]