用法
选项
等待结果
未使用--wait 时,异步接口可能返回 QUEUED 或 RUNNING 状态的 Run。使用 --wait 轮询至终态。--wait-timeout 必须为正整数,单位为秒,默认为 300。
等待超时以退出码 1 结束,但不会停止 Run。通过 glasser runs get -r <runId> --wait 继续等待,并分别检查 status、 provider_response.http_status 和 charge_usd。
传入 --task,可将 Run 与搜索、检查归入同一个 Task。详见 将相关调用归入同一个 Task。
全局选项、JSON 模式、退出码和环境变量见 CLI 约定。
数据提供商错误
对于数据提供商错误,CLI 会显示 HTTP 状态和错误正文。使用--json 时,请从返回的 Run 中读取 provider_response.http_status 和 provider_response.error。 COMPLETED 状态本身不表示数据提供商已接受请求。详见 Run 响应处理。