Update a vehicle (AWS CLI) - AWS IoT FleetWise

Update a vehicle (AWS CLI)

AWS IoT FleetWise is in preview release and is subject to change. We recommend that you use the service only with test data, and not in production environments.

While AWS IoT FleetWise is in preview, you must download the preview AWS SDK and AWS CLI to use the API operations for this service. These API operations aren't available in the public AWS SDK or AWS CLI. For more information, see Preview AWS CLI and AWS SDKs.

You can use the UpdateVehicle API operation to update an existing vehicle. The following example uses the AWS CLI.

To update a vehicle, run the following command.

Replace file-name with the name of the JSON file that contains the configuration of your vehicle.

aws iotfleetwise update-vehicle --cli-input-json file://file-name.json

Example vehicle configuration

  • Replace vehicle-ID with the ID of the vehicle you want to update.

  • (Optional) Replace model-manifest-ARN with the ARN of the vehicle model (model manifest) that you use to replace the vehicle model in use.

  • (Optional) Replace decoder-manifest-ARN with the ARN of your decoder manifest associated with the new vehicle model that you specified.

  • (Optional) The mergeAttributes value can be one of the following.

    • true – Merge new attributes into existing attributes by updating existing attributes with new values and adding new attributes if they don't exist.

      For example, if a vehicle has the following attributes: {"color": "black", "fuelType": "electric"}, and you update the vehicle with the following attributes: {"color": "", "fuelType": "gasoline", "model": "x"}, the updated vehicle has the following attributes: {"fuelType": "gasoline", "model": "x"}.

    • false – Replace existing attributes with new attributes.

      For example, if a vehicle has the following attributes: {"color": "black", "fuelType": "electric"}, and you update the vehicle with the {"model": "x"} attribute, the updated vehicle has the {"model": "x"} attribute.

    If it's not specified, the default value is false.

  • (Optional) Configure attributes to add new attributes or update existing ones with new values. For example, if you have an electric car, you can specify the following value for an attribute: {"fuelType": "electric"}.

    To delete attributes, configure mergeAttributes to true and define attributes with empty strings. For example, {"color": "", "fuelType": ""}.

    Important

    Attributes must be defined in the associated vehicle model before you can add them to individual vehicles.

{ "vehicleId": "vehicle-id", "modelManifestArn": "model-manifest-arn", "decoderManifestArn": "decoder-manifest-arn", "mergeAttributes": true, "attributes": { ... "key": "value" } }