Method: projects.operations.wait
等到指定的长时间运行的操作完成,或最多达到指定的超时,从而返回最新状态。如果操作已完成,则立即返回最新状态。如果指定的超时大于默认的 HTTP/RPC 超时,则使用 HTTP/RPC 超时。如果服务器不支持此方法,则会返回 google.rpc.Code.UNIMPLEMENTED
。请注意,此方法会尽力执行命令。它可能会在未达到指定的超时之前返回最新状态(包括立即返回),也就是说,即使立即收到响应,也并不保证操作已完成。
HTTP 请求
POST https://earthengine.googleapis.com/v1/{name=projects/*/operations/**}:wait
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
要等待的操作资源的名称。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"timeout": string
} |
字段 |
timeout |
string (Duration format)
超时之前等待的最长时间。如果将此字段留空,则等待时间最长为底层 HTTP/RPC 协议允许的时间。如果还指定了 RPC 上下文截止时间,则以二者中较短者为准。 该时长以秒为单位,最多包含九个小数位,以“s ”结尾。示例:"3.5s" 。
|
响应正文
如果成功,则响应正文包含一个 Operation
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/cloud-platform
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-06。
[null,null,["最后更新时间 (UTC):2025-03-06。"],[[["Waits for a specified operation to complete or until a timeout is reached, returning the operation's latest state."],["Uses the HTTP/RPC timeout or the specified timeout, whichever is shorter."],["May return the latest state before the timeout, so an immediate response doesn't guarantee completion."],["Requires specific OAuth scopes for authorization, like `https://www.googleapis.com/auth/earthengine` or `https://www.googleapis.com/auth/cloud-platform`."]]],["This API method waits for a long-running operation to complete or reach a specified timeout, returning the operation's latest state. If the operation is already finished, the state is returned immediately. The timeout is capped by the HTTP/RPC timeout. A `timeout` parameter, specifying duration, is available in the request body. The method is accessed via a POST request to a specific URL using gRPC Transcoding. Requires authorization using specified OAuth scopes. The response provides an Operation.\n"]]