Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Esta guía te ayuda a verificar que la configuración de autorización de Fleet Engine esté completa y que puedas crear un vehículo de prueba. En esta guía, se usa la utilidad de línea de comandos gcloud para probar la firma de tokens de autorización y la creación de vehículos.
Para completar este proceso, haz lo siguiente:
Reemplaza los campos a continuación por los datos que creaste como parte de la configuración:
Campo
Reemplazar por
PROJECT_ID
ID de tu proyecto de Cloud
SERVICE_ACCOUNT_EMAIL_ADDRESS
Dirección de correo electrónico de una cuenta de servicio que creaste con el rol de administrador Consulta los roles de la cuenta de servicio de movilidad para obtener más detalles.
VEHICLE_ID
OR
DELIVERY_VEHICLE_ID
Es un ID aleatorio del vehículo. El ID puede contener un máximo de 64 caracteres.
Usa la utilidad gcloud para acceder a la cuenta de Google Cloud y establecer el proyecto activo en tu estación de trabajo:
gcloudauthlogin
gcloudconfigsetprojectPROJECT_ID
Crea un reclamo de token web JSON (JWT) para la creación del vehículo:
[null,null,["Última actualización: 2025-09-05 (UTC)"],[[["\u003cp\u003eThis guide provides instructions to verify your Fleet Engine authorization and create a trial vehicle using the \u003ccode\u003egcloud\u003c/code\u003e command line utility.\u003c/p\u003e\n"],["\u003cp\u003eYou will need your Cloud project ID, service account email address, and a unique vehicle ID to complete the verification process.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves generating and signing a JWT, then using it to create a test vehicle via a \u003ccode\u003ecurl\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful setup is indicated by the output displaying the name of the created vehicle (e.g., "providers/PROJECT_ID/vehicles/VEHICLE_ID").\u003c/p\u003e\n"],["\u003cp\u003eFleet Engine automatically purges inactive vehicles after 7 days, eliminating the need for manual deletion.\u003c/p\u003e\n"]]],[],null,["# Verify your setup\n\nThis guide helps you verify that your Fleet Engine authorization setup is\ncomplete, and that you can create a trial vehicle. This guide uses\n[the `gcloud` command line utility](https://cloud.google.com/sdk/gcloud) to test\nauthorization token signing and vehicle creation.\n\nTo complete this process, do the following:\n\n1. Replace the fields below with the data you created as part of the setup:\n\n| Field | Replace with |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| \u003cvar class=\"edit\" scope=\"PROJECT_ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e | Your Cloud project ID. |\n| \u003cvar class=\"edit\" scope=\"SERVICE_ACCOUNT_EMAIL_ADDRESS\" translate=\"no\"\u003eSERVICE_ACCOUNT_EMAIL_ADDRESS\u003c/var\u003e | The email address of a service account you've created with the Admin role. See [Mobility service account roles](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/service-accounts#mobility_service_account_roles) for details. |\n| \u003cvar class=\"edit\" scope=\"VEHICLE_ID\" translate=\"no\"\u003eVEHICLE_ID\u003c/var\u003e **OR** \u003cvar class=\"edit\" scope=\"DELIVERY_VEHICLE_ID\" translate=\"no\"\u003eDELIVERY_VEHICLE_ID\u003c/var\u003e | A random ID for the vehicle. The ID can contain a maximum of 64 characters. |\n\n1. Use the `gcloud` utility to log into the Google Cloud account and set the\n active project on your workstation:\n\n gcloud auth login\n gcloud config set project \u003cvar label=\"project ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n2. Create a JSON Web Token (JWT) claim for the vehicle creation:\n\n ### On-demand trips\n\n ```\n cat \u003e claim.jwt \u003c\u003c EOM\n {\n \"iss\": \"SERVICE_ACCOUNT_EMAIL_ADDRESS\",\n \"sub\": \"SERVICE_ACCOUNT_EMAIL_ADDRESS\",\n \"aud\": \"https://fleetengine.googleapis.com/\",\n \"iat\": $(date +%s),\n \"exp\": $((`date +%s` + 3600)),\n \"authorization\": {\n \"vehicleid\": \"VEHICLE_ID\"\n }\n }\n EOM\n \n ```\n\n ### Scheduled tasks\n\n ```\n cat \u003e claim.jwt \u003c\u003c EOM\n {\n \"iss\": \"SERVICE_ACCOUNT_EMAIL_ADDRESS\",\n \"sub\": \"SERVICE_ACCOUNT_EMAIL_ADDRESS\",\n \"aud\": \"https://fleetengine.googleapis.com/\",\n \"iat\": $(date +%s),\n \"exp\": $((`date +%s` + 3600)),\n \"authorization\": {\n \"deliveryvehicleid\": \"DELIVERY_VEHICLE_ID\"\n }\n }\n EOM\n \n ```\n3. Use `gcloud` to sign this JWT with the appropriate IAM permissions. :\n\n gcloud iam service-accounts sign-jwt claim.jwt output.jwt \\\n --iam-account=\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_EMAIL_ADDRESS\u003c/var\u003e\n\n The signed JWT is stored in `output.jwt`.\n\n For details, see [Provide required permissions](https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#permissions-access) and\n [the `gcloud` command line guide](https://cloud.google.com/sdk/gcloud/reference/beta/iam/service-accounts/sign-jwt) in the Google Cloud\n documentation.\n4. Use `curl` to create a test vehicle on Fleet Engine:\n\n ### On-demand trips\n\n ```\n curl -X POST \"https://fleetengine.googleapis.com/v1/providers/PROJECT_ID/vehicles?vehicleId=VEHICLE_ID\" \\\n -H \"Content-type: application/json\" \\\n -H \"Authorization: Bearer $(cat output.jwt)\" \\\n --data-binary @- \u003c\u003c EOM\n {\n \"name\": \"providers/PROJECT_ID/vehicles/VEHICLE_ID\"\n }\n EOM\n {\n \"vehicleState\": \"OFFLINE\",\n \"supportedTripTypes\": [\"EXCLUSIVE\"],\n \"maximumCapacity\": 4,\n \"vehicleType\": {\"category\": \"AUTO\"},\n \"attributes\": [{\"key\": \"on_trip\", \"value\": \"false\"}]\n }\n \n ```\n\n This command should print the name of the vehicle as output. If you\n see the following text, your setup is successful. \n\n ```\n {\n \"name\": \"providers/PROJECT_ID/vehicles/VEHICLE_ID\"\n }\n \n ```\n\n ### Scheduled tasks\n\n ```\n curl -X POST \"https://fleetengine.googleapis.com/v1/providers/PROJECT_ID/deliveryVehicles?deliveryVehicleId=DELIVERY_VEHICLE_ID\" \\\n -H \"Content-type: application/json\" \\\n -H \"Authorization: Bearer $(cat output.jwt)\" \\\n --data-binary @- \u003c\u003c EOM\n {\n \"name\": \"providers/PROJECT_ID/deliveryVehicles/DELIVERY_VEHICLE_ID\"\n }\n EOM\n \n ```\n\n This command should print the name of the delivery vehicle as output. If you\n see the following text, your setup is successful. \n\n ```\n {\n \"name\": \"providers/PROJECT_ID/deliveryVehicles/DELIVERY_VEHICLE_ID\"\n }\n \n ```\n | **Note:** Fleet Engine automatically purges all entities (including vehicles) after 7 days of inactivity, such as updates.\n\nWhat's next\n-----------\n\n- [Troubleshoot common issues](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/troubleshoot)\n- [Create and use vehicles](/maps/documentation/mobility/fleet-engine/essentials/vehicles)"]]