公告:所有在
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:提供的任务说明
+ 类型: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 | 函数(可选) | 可选的回调。如果未提供,则会同步进行调用。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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. |"]]