Fleet Engine provides the SearchTripsRequest
endpoint that you can use to find
trips. This document describes two scenarios where you might use this feature.
See SearchTripsRequest
for gRPC or trips.Search
for REST.
Determine active trips for a vehicle
To do find the active trips for a specific fields, use the SearchTripsRequest
message to set the vehicle_id
to the vehicle under consideration and set
active_trips_only
to true
.
Reconcile vehicle availability between your system and Fleet Engine
In some situations, you might see results returned by SearchVehicles
that
don't correspond with the vehicles you know to be available in your system and
your fleet. This happens because SearchVehicles
either doesn't show vehicles
with active trips, or pushes them down in the results ranking. One cause of this
is when vehicles have completed trips, but the trip status not been properly set
to either COMPLETE
or CANCELED
. By using SearchTrips
to find open trips,
you can evaluate vehicles to ensure that TripStatus
in your system matches
that of Fleet Engine.
To use SearchTrips
in this way, set the following in the SearchTripsRequest
message:
vehicle_id
should be empty.active_trips_only
should betrue
.minimum_staleness
should be a time greater than most trip durations; for example, one hour.
The results of such a request include Trips that are neither COMPLETE
nor
CANCELED
, and have not been updated in over an hour. You can then examine
these trips to ensure that their status in Fleet Engine is properly updated.