Method: projects.batchOptimizeTours
針對一或多個 OptimizeToursRequest
訊息,批次最佳化車輛導覽。
這個方法是長時間執行作業 (LRO)。系統會以使用者指定的格式,讀取及寫入最佳化作業的輸入內容 (OptimizeToursRequest
訊息) 和輸出內容 (OptimizeToursResponse
訊息)。與 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
身分與存取權管理權限
需要在 parent
資源上具備下列 IAM 權限:
routeoptimization.operations.create
詳情請參閱 IAM 說明文件。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間: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"]]