Update a vehicle (AWS CLI)
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-name
with the ID of the vehicle that 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) Replace
attribute-update-mode
with vehicle attributes.-
Merge
– 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"}
. -
Overwrite
– 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.
This is required if attributes are present in the input.
-
-
(Optional) To add new attributes or update existing ones with new values, configure
attributes
. For example, if you have an electric car, you can specify the following value for an attribute:{"fuelType": "electric"}
.To delete attributes, configure
attributeUpdateMode
toMerge
.Important
Attributes must be defined in the associated vehicle model before you can add them to individual vehicles.
{ "vehicleName": "
vehicle-name
", "modelManifestArn": "model-manifest-arn
", "decoderManifestArn": "decoder-manifest-arn
", "attributeUpdateMode": "attribute-update-mode
" } }