Method: networks.shipments.route
Stay organized with collections
Save and categorize content based on your preferences.
Route a new shipment. Akin to creation, this operation implies a state change.
HTTP request
POST https://middlemileoptimization.googleapis.com/v1/{parent=networks/*}/shipments:route
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. The parent, the network within which the shipment must be routed. Format: "networks/{network}"
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"shipment": {
object (Shipment )
}
} |
Fields |
shipment |
object (Shipment )
Required. The shipment to route.
|
Response body
The response message for shipments.route
method.
If successful, the response body contains data with the following structure:
Fields |
shipment |
object (Shipment )
The shipment that was just created.
|
paths[] |
object (Path )
The paths that were changed due to routing the shipment. This field includes at least one entry, the path for the shipment that had to be routed. It may contain more paths for other shipments, reflecting internal state changes.
|
lines[] |
object (GeneratedLineAndRotation )
The line rotations that were created while routing the shipment. It may be empty or contain rotations for other shipments, reflecting internal state changes.
|
GeneratedLineAndRotation
One rotation of a line that is generated by this API and not the API customer. It is inherently less constrained, and could use any vehicle (unless the API customer decides otherwise in subsequent calls).
JSON representation |
{
"arrivalTimes": {
string: {
object (DateTime )
},
...
},
"departureTimes": {
string: {
object (DateTime )
},
...
}
} |
Fields |
arrivalTimes |
map (key: string, value: object (DateTime ))
Output only. Map between hub IDs and times. This map is supposed to have the same keys (minus the source hub, with no arrival time). An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
|
departureTimes |
map (key: string, value: object (DateTime ))
Output only. Map between hub IDs and times. This map is supposed to have the same keys (minus the destination hub, with no departure time). An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
|
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-01-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-14 UTC."],[[["\u003cp\u003eRoute new shipments by initiating a state change using a \u003ccode\u003ePOST\u003c/code\u003e request to the specified endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain the shipment details in JSON format adhering to the \u003ccode\u003eShipment\u003c/code\u003e object structure.\u003c/p\u003e\n"],["\u003cp\u003eA successful response includes the routed shipment, affected paths, and generated line rotations if any.\u003c/p\u003e\n"],["\u003cp\u003eGenerated line rotations, if created during routing, represent internal state changes and are less constrained.\u003c/p\u003e\n"],["\u003cp\u003eThese rotations detail arrival and departure times for hubs involved in the shipment route using \u003ccode\u003eDateTime\u003c/code\u003e objects.\u003c/p\u003e\n"]]],["To route a new shipment, a `POST` request is sent to `https://middlemileoptimization.googleapis.com/v1/{parent=networks/*}/shipments:route`, specifying the network in the `parent` parameter. The request body must include the `shipment` object. The response includes the created `shipment`, `paths` that have changed due to routing the shipment and generated line `lines`. These `lines` contain `arrivalTimes` and `departureTimes` maps relating hub IDs to specific times.\n"],null,["# Method: networks.shipments.route\n\nRoute a new shipment. Akin to creation, this operation implies a state change.\n\n### HTTP request\n\n`POST https://middlemileoptimization.googleapis.com/v1/{parent=networks/*}/shipments:route`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent, the network within which the shipment must be routed. Format: \"networks/{network}\" |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"shipment\": { object (/optimization/middlemileoptimization/reference/rest/v1/networks.shipments#Shipment) } } ``` |\n\n| Fields ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `shipment` | `object (`[Shipment](/optimization/middlemileoptimization/reference/rest/v1/networks.shipments#Shipment)`)` Required. The shipment to route. |\n\n### Response body\n\nThe response message for `shipments.route` method.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"shipment\": { object (/optimization/middlemileoptimization/reference/rest/v1/networks.shipments#Shipment) }, \"paths\": [ { object (/optimization/middlemileoptimization/reference/rest/v1/Path) } ], \"lines\": [ { object (/optimization/middlemileoptimization/reference/rest/v1/networks.shipments/route#GeneratedLineAndRotation) } ] } ``` |\n\n| Fields ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `shipment` | `object (`[Shipment](/optimization/middlemileoptimization/reference/rest/v1/networks.shipments#Shipment)`)` The shipment that was just created. |\n| `paths[]` | `object (`[Path](/optimization/middlemileoptimization/reference/rest/v1/Path)`)` The paths that were changed due to routing the shipment. This field includes at least one entry, the path for the shipment that had to be routed. It may contain more paths for other shipments, reflecting internal state changes. |\n| `lines[]` | `object (`[GeneratedLineAndRotation](/optimization/middlemileoptimization/reference/rest/v1/networks.shipments/route#GeneratedLineAndRotation)`)` The line rotations that were created while routing the shipment. It may be empty or contain rotations for other shipments, reflecting internal state changes. |\n\nGeneratedLineAndRotation\n------------------------\n\nOne rotation of a line that is generated by this API and not the API customer. It is inherently less constrained, and could use any vehicle (unless the API customer decides otherwise in subsequent calls).\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"arrivalTimes\": { string: { object (/optimization/middlemileoptimization/reference/rest/v1/DateTime) }, ... }, \"departureTimes\": { string: { object (/optimization/middlemileoptimization/reference/rest/v1/DateTime) }, ... } } ``` |\n\n| Fields ||\n|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `arrival``Times` | `map (key: string, value: object (`[DateTime](/optimization/middlemileoptimization/reference/rest/v1/DateTime)`))` Output only. Map between hub IDs and times. This map is supposed to have the same keys (minus the source hub, with no arrival time). An object containing a list of `\"key\": value` pairs. Example: `{ \"name\": \"wrench\", \"mass\": \"1.3kg\", \"count\": \"3\" }`. |\n| `departure``Times` | `map (key: string, value: object (`[DateTime](/optimization/middlemileoptimization/reference/rest/v1/DateTime)`))` Output only. Map between hub IDs and times. This map is supposed to have the same keys (minus the destination hub, with no departure time). An object containing a list of `\"key\": value` pairs. Example: `{ \"name\": \"wrench\", \"mass\": \"1.3kg\", \"count\": \"3\" }`. |"]]