Skip to main content

fleets

Creates, updates, deletes, gets or lists a fleets resource.

Overview

Namefleets
TypeResource
Idaws.iotfleetwise.fleets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the fleet. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
arnstringThe Amazon Resource Name (ARN) of the fleet.
creation_timestring (date-time)The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).
descriptionstringA brief description of the fleet. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
last_modification_timestring (date-time)The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).
signal_catalog_arnstringThe ARN of a signal catalog associated with the fleet.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_fleetselectregionRetrieves information about a fleet.
list_fleetsselectregionRetrieves information for each created fleet in an Amazon Web Services account. This API operation uses pagination. Specify the nextToken parameter in the request to return more results.
create_fleetinsertregion, fleetId, signalCatalogArnCreates a fleet that represents a group of vehicles. You must create both a signal catalog and vehicles before you can create a fleet. For more information, see Fleets in the Amazon Web Services IoT FleetWise Developer Guide.
associate_vehicle_fleetupdateregion, vehicleName, fleetIdAdds, or associates, a vehicle with a fleet.
update_fleetupdateregion, fleetIdUpdates the description of an existing fleet.
delete_fleetdeleteregionDeletes a fleet. Before you delete a fleet, all vehicles must be dissociated from the fleet. For more information, see Delete a fleet (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
disassociate_vehicle_fleetexecregion, vehicleName, fleetIdRemoves, or disassociates, a vehicle from a fleet. Disassociating a vehicle from a fleet doesn't delete the vehicle.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about a fleet.

SELECT
id,
arn,
creation_time,
description,
last_modification_time,
signal_catalog_arn
FROM aws.iotfleetwise.fleets
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a fleet that represents a group of vehicles. You must create both a signal catalog and vehicles before you can create a fleet. For more information, see Fleets in the Amazon Web Services IoT FleetWise Developer Guide.

INSERT INTO aws.iotfleetwise.fleets (
fleetId,
description,
signalCatalogArn,
tags,
region
)
SELECT
'{{ fleetId }}' /* required */,
'{{ description }}',
'{{ signalCatalogArn }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
id,
arn
;

UPDATE examples

Adds, or associates, a vehicle with a fleet.

UPDATE aws.iotfleetwise.fleets
SET
vehicleName = '{{ vehicleName }}',
fleetId = '{{ fleetId }}'
WHERE
region = '{{ region }}' --required
AND vehicleName = '{{ vehicleName }}' --required
AND fleetId = '{{ fleetId }}' --required;

DELETE examples

Deletes a fleet. Before you delete a fleet, all vehicles must be dissociated from the fleet. For more information, see Delete a fleet (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.

DELETE FROM aws.iotfleetwise.fleets
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Removes, or disassociates, a vehicle from a fleet. Disassociating a vehicle from a fleet doesn't delete the vehicle.

EXEC aws.iotfleetwise.fleets.disassociate_vehicle_fleet
@region='{{ region }}' --required
@@json=
'{
"vehicleName": "{{ vehicleName }}",
"fleetId": "{{ fleetId }}"
}'
;