公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.data.getOperation
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
取得作業或作業清單的相關資訊。
如要進一步瞭解作業,請參閱 https://cloud.google.com/apis/design/design_patterns#long_running_operations
傳回作業狀態,或從作業名稱到狀態的對應。每項作業都包含:
- name:作業名稱,格式為 projects/X/operations/Y
- done:作業完成時為 true。
- error:done=true 時可能會設定。包含訊息和其他欄位,請參閱 https://cloud.google.com/tasks/docs/reference/rpc/google.rpc#status
- 中繼資料,內含
+ state:PENDING、RUNNING、CANCELLING、SUCCEEDED、CANCELLED 或 FAILED
+ description:提供的工作說明
+ type: EXPORT_IMAGE、EXPORT_FEATURES 等
+ create_time:首次提交作業的時間。
+ update_time:最近一次更新的時間戳記。
+ start_time:作業開始時間 (如有)。
+ end_time:作業完成執行的時間 (如有)。
+ attempt:這項工作的重試次數,從 1 開始。
+ destination_uris:這項作業輸出的資源。
+ batch_eecu_usage_seconds:這項作業使用的 CPU。
用量 | 傳回 |
---|
ee.data.getOperation(operationName, callback) | Dictionary<api.Operation>|api.Operation |
引數 | 類型 | 詳細資料 |
---|
operationName | List<String>|String | 作業名稱。 |
callback | 函式 (選用) | 選用回呼。如未提供,系統會同步發出呼叫。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThe API retrieves the status of an operation or a list of operations, providing details like progress, errors, and timing.\u003c/p\u003e\n"],["\u003cp\u003eEach operation status includes information such as name, completion status, error details, and operation-specific metadata like state, description, and resource usage.\u003c/p\u003e\n"],["\u003cp\u003eOperation metadata provides insights into the operation's lifecycle, including creation, start, update, and end times, as well as retry attempts and resource consumption.\u003c/p\u003e\n"],["\u003cp\u003eUsers can fetch operation details using the \u003ccode\u003eee.data.getOperation()\u003c/code\u003e function, providing the operation name and an optional callback for asynchronous execution.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, the function returns a dictionary containing the operation status or a map of operation names to their respective statuses.\u003c/p\u003e\n"]]],["This outlines how to retrieve information about operations, either individually or in a list. Each operation's details include its `name`, `done` status, and potential `error`. `Metadata` offers insights like `state` (`PENDING`, `RUNNING`, etc.), `description`, `type`, relevant timestamps (`create_time`, `update_time`, etc.), `attempt` count, `destination_uris`, and `batch_eecu_usage_seconds`. Operations can be retrieved using `ee.data.getOperation`, which accepts `operationName(s)` and an optional callback for asynchronous execution.\n"],null,["# ee.data.getOperation\n\n\u003cbr /\u003e\n\nGets information on an operation or list of operations.\n\n\u003cbr /\u003e\n\nSee more details on Operations here: https://cloud.google.com/apis/design/design_patterns#long_running_operations\n\nReturns operation status, or a map from operation names to status. Each Operation contains:\n\n- name: operation name in the format projects/X/operations/Y\n\n- done: true when operation has finished running.\n\n- error: may be set when done=true. Contains message and other fields from https://cloud.google.com/tasks/docs/reference/rpc/google.rpc#status\n\n- metadata, which contains\n\n+ state: PENDING, RUNNING, CANCELLING, SUCCEEDED, CANCELLED, or FAILED\n\n+ description: Supplied task description\n\n+ type: EXPORT_IMAGE, EXPORT_FEATURES, etc.\n\n+ create_time: Time the operation was first submitted.\n\n+ update_time: Timestamp of most recent update.\n\n+ start_time: Time the operation started, when so.\n\n+ end_time: Time the operation finished running, when so.\n\n+ attempt: Number of retries of this task, starting at 1.\n\n+ destination_uris: Resources output by this operation.\n\n+ batch_eecu_usage_seconds: CPU used by this operation.\n\n| Usage | Returns |\n|-----------------------------------------------------|--------------------------------------------|\n| `ee.data.getOperation(operationName, `*callback*`)` | Dictionary\\\u003capi.Operation\\\u003e\\|api.Operation |\n\n| Argument | Type | Details |\n|-----------------|------------------------|------------------------------------------------------------------------|\n| `operationName` | List\\\u003cString\\\u003e\\|String | Operation name(s). |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. |"]]