公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
Method: projects.operations.wait
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
等待指定的長時間執行作業完成,或是最多等到指定的逾時時間為止,並傳回最新狀態。如果作業已經完成,系統會立刻傳回最新狀態。如果指定的逾時時間比預設的 HTTP/RPC 逾時時間還要長,則會使用 HTTP/RPC 逾時時間。如果伺服器不支援這個方法,則會傳回 google.rpc.Code.UNIMPLEMENTED
。請注意,這個方法會盡可能完成作業。由於它可能會在作業達到指定的逾時時間 (包含立即) 之前就傳回最新狀態,因此就算您立即收到回應,也不代表作業已經完成。
HTTP 要求
POST https://earthengine.googleapis.com/v1beta/{name=projects/*/operations/**}:wait
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
name |
string
要等待的作業資源名稱。
|
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"timeout": string
} |
欄位 |
timeout |
string (Duration format)
逾時前的等待時間上限。如果留空,系統最多會等待基本 HTTP/RPC 通訊協定允許的時間。如果同時指定了 RPC 內容期限,則系統會採用較短的期限。 以秒為單位的時間長度,最多可有 9 個小數位數,並應以「s 」結尾,例如:"3.5s" 。
|
回應主體
如果成功,回應主體會包含 Operation
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/cloud-platform
詳情請參閱 OAuth 2.0 Overview。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eWaits for a specified operation to complete or until a timeout is reached, returning the operation's latest state.\u003c/p\u003e\n"],["\u003cp\u003eUses HTTP/RPC timeout or the specified timeout, whichever is shorter, with a best-effort approach to provide the latest state.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a timeout duration in the request body to customize the waiting period.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes for authorization, such as \u003ccode\u003ehttps://www.googleapis.com/auth/earthengine\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReturns the Operation details upon successful completion.\u003c/p\u003e\n"]]],["This API method waits for a long-running operation to complete or reach a specified timeout, returning the latest operation state. It uses the HTTP/RPC timeout if the specified timeout is longer. The `name` parameter identifies the operation resource. The request body can include a `timeout` field, formatted as a duration string. The method is best-effort and may return before the timeout. It uses POST method with gRPC Transcoding, and a successful response is an `Operation` object, requiring specific OAuth scopes for authorization.\n"],null,["# Method: projects.operations.wait\n\nWaits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{name=projects/*/operations/**}:wait`\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 wait on. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------|\n| ``` { \"timeout\": string } ``` |\n\n| Fields ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `timeout` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/earth-engine/reference/rest/Shared.Types/ListOperationsResponse#Operation).\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)."]]