Method: projects.locations.batchOptimizeTours
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
批量优化一条或多条 OptimizeToursRequest
消息的车辆游览体验。
此方法是一项长时间运行的操作 (LRO)。优化输入(OptimizeToursRequest
消息)和输出(OptimizeToursResponse
消息)以用户指定的格式从 Cloud Storage 读取和写入。与 locations.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/*/locations/*}: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):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eOptimizes vehicle tours in batches using \u003ccode\u003eOptimizeToursRequest\u003c/code\u003e messages, processing inputs and outputs through Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eUsers can monitor the Long Running Operation (LRO) status via \u003ccode\u003eoperations.get\u003c/code\u003e to track progress and access results.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires \u003ccode\u003eAsyncModelConfig\u003c/code\u003e objects specifying input/output details for each purchase model.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses return an \u003ccode\u003eOperation\u003c/code\u003e object providing information about the optimization process.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope and \u003ccode\u003erouteoptimization.operations.create\u003c/code\u003e IAM permission for authorization.\u003c/p\u003e\n"]]],["This service optimizes vehicle tours via batch processing of `OptimizeToursRequest` messages. Inputs and outputs are managed in Cloud Storage. Each request includes a `ShipmentModel`, yielding `ShipmentRoute` results that minimize overall costs. Users can track progress with `operations.get`; a false `done` field indicates ongoing processing, while a true `done` field signals completion. Failed requests won't have results in Cloud Storage. The HTTP request is a `POST` operation, requiring `routeoptimization.operations.create` IAM permission and `https://www.googleapis.com/auth/cloud-platform` OAuth scope. The `modelConfigs` field contains input/output data.\n"],null,["# Method: projects.locations.batchOptimizeTours\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n\nOptimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch.\n\nThis method is a Long Running Operation (LRO). The inputs for optimization (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are read from and written to Cloud Storage in user-specified format. Like the `locations.optimizeTours` method, each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` containing `ShipmentRoute` fields, which are a set of routes to be performed by vehicles minimizing the overall cost.\n\nThe user can poll `operations.get` to check the status of the LRO:\n\nIf the LRO `done` field is false, then at least one request is still being processed. Other requests may have completed successfully and their results are available in Cloud Storage.\n\nIf the LRO's `done` field is true, then all requests have been processed. Any successfully processed requests will have their results available in Cloud Storage. Any requests that failed will not have their results available in Cloud Storage. If the LRO's `error` field is set, then it contains the error from one of the failed requests.\n\n### HTTP request\n\n`POST https://routeoptimization.googleapis.com/v1/{parent=projects/*/locations/*}:batchOptimizeTours`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. Target project and location to make a call. Format: \\* `projects/{project-id}` \\* `projects/{project-id}/locations/{location-id}` If no location is specified, a region will be chosen automatically. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"modelConfigs\": [ { object (/maps/documentation/route-optimization/reference/rest/v1/AsyncModelConfig) } ] } ``` |\n\n| Fields ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `modelConfigs[]` | `object (`[AsyncModelConfig](/maps/documentation/route-optimization/reference/rest/v1/AsyncModelConfig)`)` Required. Input/Output information each purchase model, such as file paths and data formats. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/maps/documentation/route-optimization/reference/rest/v1/projects.locations.operations#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `routeoptimization.operations.create`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]