Method: providers.vehicles.list

Returns a paginated list of vehicles associated with a provider that match the request options.

HTTP request

GET https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Must be in the format providers/{provider}. The provider must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

Query parameters

Parameters
header

object (RequestHeader)

The standard Fleet Engine request header.

pageSize

integer

The maximum number of vehicles to return. Default value: 100.

pageToken

string

The value of the nextPageToken provided by a previous call to vehicles.list so that you can paginate through groups of vehicles. The value is undefined if the filter criteria of the request is not the same as the filter criteria for the previous call to vehicles.list.

minimumCapacity

integer

Specifies the required minimum capacity of the vehicle. All vehicles returned will have a maximumCapacity greater than or equal to this value. If set, must be greater or equal to 0.

tripTypes[]

enum (TripType)

Restricts the response to vehicles that support at least one of the specified trip types.

maximumStaleness

string (Duration format)

Restricts the response to vehicles that have sent location updates to Fleet Engine within the specified duration. Stationary vehicles still transmitting their locations are not considered stale. If present, must be a valid positive duration.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

vehicleTypeCategories[]

enum (Category)

Required. Restricts the response to vehicles with one of the specified type categories. UNKNOWN is not allowed.

requiredAttributes[]

string

Callers can form complex logical operations using any combination of the requiredAttributes, requiredOneOfAttributes, and requiredOneOfAttributeSets fields.

requiredAttributes is a list; requiredOneOfAttributes uses a message which allows a list of lists. In combination, the two fields allow the composition of this expression:

(requiredAttributes[0] AND requiredAttributes[1] AND ...)
AND
(requiredOneOfAttributes[0][0] OR requiredOneOfAttributes[0][1] OR
...)
AND
(requiredOneOfAttributes[1][0] OR requiredOneOfAttributes[1][1] OR
...)

Restricts the response to vehicles with the specified attributes. This field is a conjunction/AND operation. A max of 50 requiredAttributes is allowed. This matches the maximum number of attributes allowed on a vehicle. Each repeated string should be of the format "key:value".

requiredOneOfAttributes[]

string

Restricts the response to vehicles with at least one of the specified attributes in each VehicleAttributeList. Within each list, a vehicle must match at least one of the attributes. This field is an inclusive disjunction/OR operation in each VehicleAttributeList and a conjunction/AND operation across the collection of VehicleAttributeList. Each repeated string should be of the format "key1:value1|key2:value2|key3:value3".

requiredOneOfAttributeSets[]

string

requiredOneOfAttributeSets provides additional functionality.

Similar to requiredOneOfAttributes, requiredOneOfAttributeSets uses a message which allows a list of lists, allowing expressions such as this one:

(requiredAttributes[0] AND requiredAttributes[1] AND ...)
AND
(
  (requiredOneOfAttributeSets[0][0] AND
  requiredOneOfAttributeSets[0][1] AND
  ...)
  OR
  (requiredOneOfAttributeSets[1][0] AND
  requiredOneOfAttributeSets[1][1] AND
  ...)
)

Restricts the response to vehicles that match all the attributes in a VehicleAttributeList. Within each list, a vehicle must match all of the attributes. This field is a conjunction/AND operation in each VehicleAttributeList and inclusive disjunction/OR operation across the collection of VehicleAttributeList. Each repeated string should be of the format "key1:value1|key2:value2|key3:value3".

vehicleState

enum (VehicleState)

Restricts the response to vehicles that have this vehicle state.

onTripOnly

boolean

Only return the vehicles with current trip(s).

filter

string

Optional. A filter query to apply when listing vehicles. See http://aip.dev/160 for examples of the filter syntax.

This field is designed to replace the requiredAttributes, requiredOneOfAttributes, and required_one_of_attributes_sets fields. If a non-empty value is specified here, the following fields must be empty: requiredAttributes, requiredOneOfAttributes, and required_one_of_attributes_sets.

This filter functions as an AND clause with other constraints, such as vehicleState or onTripOnly.

Note that the only queries supported are on vehicle attributes (for example, attributes.<key> = <value> or attributes.<key1> = <value1> AND attributes.<key2> = <value2>). The maximum number of restrictions allowed in a filter query is 50.

Also, all attributes are stored as strings, so the only supported comparisons against attributes are string comparisons. In order to compare against number or boolean values, the values must be explicitly quoted to be treated as strings (for example, attributes.<key> = "10" or attributes.<key> = "true").

viewport

object (Viewport)

Optional. A filter that limits the vehicles returned to those whose last known location was in the rectangular area defined by the viewport.

Request body

The request body must be empty.

Response body

vehicles.list response message.

If successful, the response body contains data with the following structure:

JSON representation
{
  "vehicles": [
    {
      object (Vehicle)
    }
  ],
  "nextPageToken": string,
  "totalSize": string
}
Fields
vehicles[]

object (Vehicle)

Vehicles matching the criteria in the request. The maximum number of vehicles returned is determined by the pageSize field in the request.

nextPageToken

string

Token to retrieve the next page of vehicles, or empty if there are no more vehicles that meet the request criteria.

totalSize

string (int64 format)

Required. Total number of vehicles matching the request criteria across all pages.

Viewport

A latitude-longitude viewport, represented as two diagonally opposite low and high points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include:

  • If low = high, the viewport consists of that single point.

  • If low.longitude > high.longitude, the longitude range is inverted (the viewport crosses the 180 degree longitude line).

  • If low.longitude = -180 degrees and high.longitude = 180 degrees, the viewport includes all longitudes.

  • If low.longitude = 180 degrees and high.longitude = -180 degrees, the longitude range is empty.

  • If low.latitude > high.latitude, the latitude range is empty.

Both low and high must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error.

For example, this viewport fully encloses New York City:

{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }

JSON representation
{
  "low": {
    object (LatLng)
  },
  "high": {
    object (LatLng)
  }
}
Fields
low

object (LatLng)

Required. The low point of the viewport.

high

object (LatLng)

Required. The high point of the viewport.