הפונקציה מתחילה ביטול אסינכרוני של פעולה ממושכת. השרת עושה כמיטב יכולתו כדי לבטל את הפעולה, אבל אי אפשר להבטיח שהיא תבוטל. אם השרת לא תומך בשיטה הזו, הוא מחזיר את הערך google.rpc.Code.UNIMPLEMENTED. לקוחות יכולים להשתמש ב-Operations.GetOperation או בשיטות אחרות כדי לבדוק אם הביטול בוצע או אם הפעולה הושלמה למרות הביטול. אם הביטול בוצע בהצלחה, הפעולה לא נמחקת. במקום זאת, היא הופכת לפעולה עם ערך Operation.error עם google.rpc.Status.code של 1, שתואם ל-Code.CANCELLED.
בקשת HTTP
POST https://routeoptimization.googleapis.com/v1/{name=operations/**}:cancel
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[[["\u003cp\u003eThis document details how to cancel a long-running Route Optimization operation using a \u003ccode\u003ePOST\u003c/code\u003e request to a specific URL.\u003c/p\u003e\n"],["\u003cp\u003eCancellation is attempted but not guaranteed, and the operation's status can be checked using the \u003ccode\u003eOperations.GetOperation\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful cancellation results in the operation having an error code indicating it was canceled but the operation itself is not deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe request must have an empty body and include the operation's name as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\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- [Authorization scopes](#body.aspect)\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](/maps/documentation/route-optimization/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](/maps/documentation/route-optimization/reference/rest/v1/projects.locations.operations#Operation.FIELDS.error) value with a [google.rpc.Status.code](/maps/documentation/route-optimization/reference/rest/v1/projects.locations.operations#Status.FIELDS.code) of `1`, corresponding to `Code.CANCELLED`.\n\nHTTP request\n\n`POST https://routeoptimization.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.\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`"]]