Method: projects.locations.batchOptimizeTours
Stay organized with collections
Save and categorize content based on your preferences.
Optimizes vehicle tours for one or more OptimizeToursRequest
messages as a batch.
This 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.
The user can poll operations.get
to check the status of the LRO:
If 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.
If 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.
HTTP request
POST https://routeoptimization.googleapis.com/v1/{parent=projects/*/locations/*}:batchOptimizeTours
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
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.
|
Request body
The request body contains data with the following structure:
Fields |
modelConfigs[] |
object (AsyncModelConfig )
Required. Input/Output information each purchase model, such as file paths and data formats.
|
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
IAM Permissions
Requires the following IAM permission on the parent
resource:
routeoptimization.operations.create
For more information, see the IAM documentation.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\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)."]]