Method: projects.batchOptimizeTours
批量优化一个或多个 OptimizeToursRequest
消息的车辆导览。
此方法是一项长时间运行的操作 (LRO)。优化输入(OptimizeToursRequest
消息)和输出(OptimizeToursResponse
消息)以用户指定的格式从 Cloud Storage 读取和写入。与 projects.optimizeTours
方法一样,每个 OptimizeToursRequest
都包含一个 ShipmentModel
,并返回一个包含 ShipmentRoute
字段的 OptimizeToursResponse
,这些字段是车辆执行的一组路线,可最大限度地降低总费用。
用户可以轮询 operations.get
以检查 LRO 的状态:
如果 LRO done
字段为 false,则表示仍有至少一个请求正在处理中。其他请求可能已成功完成,其结果可在 Cloud Storage 中找到。
如果 LRO 的 done
字段为 true,则表示所有请求均已处理完毕。所有成功处理的请求的结果都会存储在 Cloud Storage 中。任何失败的请求都不会在 Cloud Storage 中显示其结果。如果 LRO 的 error
字段已设置,则其中包含某个失败请求的错误。
HTTP 请求
POST https://routeoptimization.googleapis.com/v1/{parent=projects/*}:batchOptimizeTours
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。定位项目和位置以进行呼叫。 格式:* projects/{project-id} * projects/{project-id}/locations/{location-id} 如果未指定位置,则系统将自动选择区域。
|
请求正文
请求正文中包含结构如下的数据:
字段 |
modelConfigs[] |
object (AsyncModelConfig )
必需。每个购买模型的输入/输出信息,例如文件路径和数据格式。
|
响应正文
如果成功,则响应正文包含一个 Operation
实例。
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/cloud-platform
IAM 权限
需要拥有 parent
资源的以下 IAM 权限:
routeoptimization.operations.create
如需了解详情,请参阅 IAM 文档。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-22。
[null,null,["最后更新时间 (UTC):2024-12-22。"],[[["The `batchOptimizeTours` method optimizes vehicle tours for multiple requests as a Long Running Operation (LRO), reading inputs and writing outputs to Cloud Storage."],["Users can monitor the LRO status using `operations.get`, with results becoming available in Cloud Storage upon completion."],["The request body requires `modelConfigs` which specifies file paths and data formats for each model using the `AsyncModelConfig` structure."],["Authorization requires the `https://www.googleapis.com/auth/cloud-platform` OAuth scope and the `routeoptimization.operations.create` IAM permission."],["Successful responses contain an `Operation` instance providing information about the ongoing operation."]]],["This API method `batchOptimizeTours` optimizes vehicle tours for multiple `OptimizeToursRequest` messages via a Long Running Operation (LRO). Inputs and outputs are stored in Cloud Storage. Each request includes a `ShipmentModel`, and returns `ShipmentRoute` fields, minimizing overall cost. Users can check the LRO's status via `operations.get`. The `done` field indicates completion, while the `error` field shows failures. Requires `routeoptimization.operations.create` IAM permission and `cloud-platform` OAuth scope. The parent parameter will be used for routing.\n"]]