如需详细了解操作,请访问: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
+ 说明:提供的任务说明
+ 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 | 函数,可选 | 可选的回调。如果未提供,则以同步方式进行调用。 |