Method: projects.operations.cancel
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הפונקציה מתחילה ביטול אסינכרוני של פעולה ממושכת. השרת עושה כמיטב יכולתו כדי לבטל את הפעולה, אבל אי אפשר להבטיח שהיא תבוטל. אם השרת לא תומך בשיטה הזו, הוא מחזיר את הערך google.rpc.Code.UNIMPLEMENTED
. לקוחות יכולים להשתמש ב-Operations.GetOperation
או בשיטות אחרות כדי לבדוק אם הביטול בוצע או אם הפעולה הושלמה למרות הביטול. אם הביטול בוצע בהצלחה, הפעולה לא נמחקת. במקום זאת, היא הופכת לפעולה עם ערך Operation.error
עם google.rpc.Status.code
של 1
, שתואם ל-Code.CANCELLED
.
בקשת HTTP
POST https://earthengine.googleapis.com/v1beta/{name=projects/*/operations/**}:cancel
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
name |
string
השם של משאב הפעולה שרוצים לבטל.
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה הוא אובייקט JSON ריק.
היקפי הרשאה
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/cloud-platform
מידע נוסף זמין בOAuth 2.0 Overview.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\u003cp\u003eInitiates an asynchronous cancellation process for long-running operations, although cancellation success is not guaranteed.\u003c/p\u003e\n"],["\u003cp\u003eThe server may return an \u003ccode\u003eUNIMPLEMENTED\u003c/code\u003e error if it lacks cancellation support; use \u003ccode\u003eOperations.GetOperation\u003c/code\u003e to verify cancellation status.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful cancellation, the operation persists with an error code indicating cancellation instead of deletion.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCancelOperation\u003c/code\u003e request is sent to a specific URL with the operation's name as a path parameter and an empty request body.\u003c/p\u003e\n"],["\u003cp\u003eProper authorization is needed using either \u003ccode\u003eearthengine\u003c/code\u003e or \u003ccode\u003ecloud-platform\u003c/code\u003e OAuth scopes to execute the request.\u003c/p\u003e\n"]]],["This describes how to asynchronously cancel a long-running operation. A `POST` request to a specific URL using `gRPC Transcoding` initiates cancellation, with the operation's name as a path parameter. The request body must be empty. Upon success, the server returns an empty JSON object, but cancellation isn't guaranteed. The status of the operation is checked via `Operations.GetOperation` and a successful cancellation changes the operation's status `Code.CANCELLED` and is not deleted.\n"],null,["# Method: projects.operations.cancel\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](/earth-engine/reference/rest/v1alpha/projects.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](/earth-engine/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.error) value with a [google.rpc.Status.code](/earth-engine/reference/rest/Shared.Types/ListOperationsResponse#Status.FIELDS.code) of `1`, corresponding to `Code.CANCELLED`.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{name=projects/*/operations/**}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------|\n| `name` | `string` The name of the operation resource to be cancelled. |\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 one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]