[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eFleet Engine enables the creation and management of virtual vehicles that mirror real-world vehicles for dispatch and routing purposes.\u003c/p\u003e\n"],["\u003cp\u003eVehicles are created using gRPC or REST methods, requiring a unique vehicle ID and Google Cloud project association for identification.\u003c/p\u003e\n"],["\u003cp\u003eVehicle resources have output-only, required, and optional fields, with the \u003ccode\u003ename\u003c/code\u003e field being generated by Fleet Engine based on project ID and vehicle ID.\u003c/p\u003e\n"],["\u003cp\u003eAuthenticated requests to Fleet Engine are necessary, using either the Authorization library for gRPC or JSON Web Tokens for REST.\u003c/p\u003e\n"],["\u003cp\u003eVehicles remain available for reuse for 7 days after completing an itinerary, and regular updates to vehicle location or other fields extend this availability.\u003c/p\u003e\n"]]],["Fleet Engine manages vehicles through creation and management within its server environment, mirroring real-world operations and backend systems. Creating vehicles involves using `CreateVehicleRequest` (gRPC) or `providers.vehicle.create` (REST) for on-demand trips and `CreateDeliveryVehicleRequest` or `providers.deliveryVehicles.create` for scheduled tasks. Requests include a parent (Google Cloud project ID), a unique vehicle ID, and a vehicle instance with required fields. Fleet Engine sets the vehicle `name` field. Vehicles can be reused for up to 7 days after completing stops, extendable by updating location or other fields.\n"],null,["For general information about how vehicles work in Fleet Engine, see the\nfollowing guides in the Fleet Engine essential section:\n\n- [What is Fleet Engine?](/maps/documentation/mobility/fleet-engine/essentials)\n- [Introduction to vehicles](/maps/documentation/mobility/fleet-engine/essentials/vehicles-intro)\n\nThe documentation in this section describes how to create and manage vehicles in\nFleet Engine. You create vehicles in the Fleet Engine server environment to\nmirror the actual vehicles in your real-world operation. Your Fleet Engine\nvehicles should also correspond to those used in your backend system that you\nuse for vehicle assignments and routing.\n\nYou use a create method to create a vehicle resource, either using gRPC or REST.\nThe field names in this guide use gRPC notation for simplicity. \n\nOn-demand trips\n\n- [`CreateVehicleRequest`](/maps/documentation/mobility/fleet-engine/reference/trips/rpc/maps.fleetengine.v1#maps.fleetengine.v1.CreateVehicleRequest) (gRPC)\n- [`providers.vehicle.create`](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles/create) (REST)\n- `Vehicle` resource ([REST](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles), [gRPC](/maps/documentation/mobility/fleet-engine/reference/trips/rpc/maps.fleetengine.v1#maps.fleetengine.v1.Vehicle))\n\nScheduled tasks\n\n- [`CreateDeliveryVehicleRequest`](/maps/documentation/mobility/fleet-engine/reference/tasks/rpc/maps.fleetengine.delivery.v1#maps.fleetengine.delivery.v1.CreateDeliveryVehicleRequest) (gRPC)\n- [`providers.deliveryVehicles.create`](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.deliveryVehicles/create) (REST)\n- `DeliveryVehicle` ([REST](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.deliveryVehicles), [gRPC](/maps/documentation/mobility/fleet-engine/reference/tasks/rpc/maps.fleetengine.delivery.v1#maps.fleetengine.delivery.v1.DeliveryVehicle))\n| **Note:** The request messages and resource fields for the two Fleet Engine vehicle resources are largely parallel, even though some names vary between the two.\n\nVehicle requests\n\nFor both on-demand and scheduled task capabilities, you create and update a\nvehicle by issuing a request message with fields, summarized as follows:\n\n1. **The parent**: a string associated with your Google Cloud project ID, used to populate the name field of the vehicle instance.\n2. **The ID for the vehicle** : a unique string used to populate the `name`\n field of the vehicle.\n\n | **Note:** Vehicle ID strings have certain character restrictions. Avoid auto-incrementing IDs and ensure they contain no personally-identifiable information. For details on character restrictions, see the vehicle ID field for [CreateVehicleRequest](/maps/documentation/mobility/fleet-engine/reference/trips/rpc/maps.fleetengine.v1#maps.fleetengine.v1.CreateVehicleRequest) or [CreateDeliveryVehicleRequest](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/issue-jwt).\n3. **A vehicle instance** with its required fields. These fields depend on the\n Fleet Engine capability you use.\n\nThe information in the request body varies with the nature of the request. See\nthose details under their respective guides.\n\nAuthentication and authorization tokens\n\nRequests to Fleet Engine must also provide the correct access credentials.\nThe examples in this guide have the following assumptions:\n\n- gRPC examples assume the use of the [Authorization library](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/issue-jwt#use-authorization) for Java.\n- REST examples illustrate an HTTP request header, which must contain the field `Authorization` with a value of `Bearer \u003ctoken\u003e` where `\u003ctoken\u003e` is a [JSON Web Token you issue](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/issue-jwt).\n\nFor more details, see the [Set up Fleet Engine](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet) guides.\n\nVehicle resource fields\n\nA vehicle resource has the following kinds of fields:\n\n- **Output only fields** . Fields that are set by the service as an output of another method and **cannot be directly set** . An important field of this type is the `name` field. Fleet Engine ignores any supplied value for the `name` field of the vehicle per guidance from Google AIP for [user-specified\n IDs](https://google.aip.dev/133#user-specified-ids). If you supply values for these fields, Fleet Engine returns an error.\n- **Required fields**. Vehicles created in the on-demand trip service require that certain fields be set on creation. Vehicles created in the scheduled tasks service have no required vehicle resource fields.\n- **Optional fields**. Both services have fields which you can set on creation or afterwards. These can be found in the respective reference guide for the service you use.\n\nVehicle name (output only)\n\nThe `name` field is exactly the same for on-demand trips and scheduled task\nservices. Fleet Engine defines the field when you create the vehicle, based on\ntwo fields you set at vehicle creation:\n\n- **The parent** : a string associated with your Google Cloud project ID of the\n form `providers/{provider}` where `{provider}` is the ID of your Cloud\n project. Each vehicle you create for a given project will have the same\n parent path.\n\n The Cloud project you reference here must also contain the Fleet Engine\n service account roles for the service you use. See [Service Accounts](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/service-accounts) for\n a list of those service accounts. Fleet Engine does not support access from\n multiple Google Cloud projects.\n- **The ID for the vehicle** , which must be unique across all vehicles in your\n fleet and be a valid Unicode string. This is the *resource ID* for the\n vehicle. Both on-demand trips and scheduled stops use this to associate a\n trip or a task with the vehicle that completes it.\n\nIn Google Cloud-based services, all APIs must represent resources as strings.\nSee [Resource naming in Fleet Engine](/maps/documentation/mobility/fleet-engine/essentials#resource-naming) for more details.\n\nUnique entity identifiers\n\nThe format and value of the unique entity identifiers used in resource calls are\nopaque to Fleet Engine. Make sure that the identifier does not contain any\npersonally-identifiable information (PII), such as the driver's phone number.\n\nVehicle re-use\n\nAfter a vehicle completes all stops for a given itinerary, it remains available\nfor re-use in Fleet Engine for 7 days, which means you can reuse a vehicle on\nsubsequent business days without having to create a new one. Each time you\nreuse a vehicle, Fleet Engine resets its availability, at which point the\n7-day countdown begins anew.\n\nThe recommended approach to keep a vehicle available in Fleet Engine is to\nupdate its location at regular intervals. Updates to most other fields in the\n`Vehicle` entity will also extend its life, provided that the new field value is\ndifferent from the existing one.\n\nNOTE: Some fields on `Vehicle` entity like `device_settings` are purely debug\ninformation that are not persisted by Fleet Engine. Updating them does not\nextend the life of the `Vehicle` entity.\n\nFor improved system analytics, it's best to re-use the same driver-vehicle ID\npairing from day to day. Do this by using the same vehicle ID associated with\nthe driver for previous scheduled stops or on-demand trips.\n\nWhat's next\n\n- [Create a vehicle for on-demand trips](/maps/documentation/mobility/fleet-engine/essentials/vehicles/on-demand-create-vehicle)\n- [Create a vehicle for scheduled tasks](/maps/documentation/mobility/fleet-engine/essentials/vehicles/scheduled-tasks-create-vehicle)"]]