הפונקציה מתחילה ביטול אסינכרוני של פעולה ממושכת. השרת עושה כמיטב יכולתו כדי לבטל את הפעולה, אבל אי אפשר להבטיח שהיא תבוטל. אם השרת לא תומך בשיטה הזו, הוא מחזיר את הערך google.rpc.Code.UNIMPLEMENTED. לקוחות יכולים להשתמש ב-Operations.GetOperation או בשיטות אחרות כדי לבדוק אם הביטול בוצע או אם הפעולה הושלמה למרות הביטול. אם הביטול בוצע בהצלחה, הפעולה לא נמחקת. במקום זאת, היא הופכת לפעולה עם ערך Operation.error עם google.rpc.Status.code של 1, שתואם ל-Code.CANCELLED.
בקשת HTTP
POST https://vault.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-02-06 (שעון UTC)."],[[["Initiates the cancellation process for a long-running operation, although cancellation success is not guaranteed."],["Uses the `POST` method with a specific URL structure including the operation name for cancellation."],["Requires an empty request body and returns an empty response body upon successful cancellation."],["In case of unsupported cancellation by the server, an `UNIMPLEMENTED` error code is returned."],["If cancelled successfully, the operation is not deleted but marked with a `CANCELLED` status code."]]],["This document details the process of initiating asynchronous cancellation for a long-running operation. It uses an HTTP POST request to `vault.googleapis.com/v1/{name=operations/**}:cancel`. The `name` parameter specifies the operation to cancel. The request body must be empty, and a successful response returns an empty JSON object. The server attempts cancellation, and clients can check the status via `Operations.GetOperation`. Successful cancellation results in an `Operation.error` with `Code.CANCELLED`. Authorization requires the `https://www.googleapis.com/auth/ediscovery` OAuth scope.\n"]]