Skip to main content

campaigns

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

Overview

Namecampaigns
TypeResource
Idaws.iotfleetwise.campaigns

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the campaign. (pattern: <code>[a-zA-Z\d-_:]+</code>)
arnstringThe Amazon Resource Name (ARN) of the campaign. (pattern: <code>arn:aws:iotfleetwise:[a-z0-9-]+:[0-9]{12}:campaign/[a-zA-Z\d-_:]{1,100}</code>)
collection_schemeobjectInformation about the data collection scheme associated with the campaign.
compressionstringWhether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If OFF is specified, the signals aren't compressed. If it's not specified, SNAPPY is used. (OFF, SNAPPY)
creation_timestring (date-time)The time the campaign was created in seconds since epoch (January 1, 1970 at midnight UTC time).
data_destination_configsarrayThe destination where the campaign sends data. You can send data to an MQTT topic, or store it in Amazon S3 or Amazon Timestream. MQTT is the publish/subscribe messaging protocol used by Amazon Web Services IoT to communicate with your devices. Amazon S3 optimizes the cost of data storage and provides additional mechanisms to use vehicle data, such as data lakes, centralized data storage, data processing pipelines, and analytics. You can use Amazon Timestream to access and analyze time series data, and Timestream to query vehicle data so that you can identify trends and patterns.
data_extra_dimensionsarrayA list of vehicle attributes associated with the campaign.
data_partitionsarrayThe data partitions associated with the signals collected from the vehicle.
descriptionstringThe description of the campaign. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
diagnostics_modestringOption for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. (OFF, SEND_ACTIVE_DTCS)
expiry_timestring (date-time)The time the campaign expires, in seconds since epoch (January 1, 1970 at midnight UTC time). Vehicle data won't be collected after the campaign expires.
last_modification_timestring (date-time)The last time the campaign was modified.
post_trigger_collection_durationinteger (int64)How long (in seconds) to collect raw data after a triggering event initiates the collection.
priorityintegerA number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. A campaign with the lowest value is deployed to vehicles before any other campaigns.
signal_catalog_arnstringThe ARN of a signal catalog.
signals_to_collectarrayInformation about a list of signals to collect data on.
signals_to_fetcharrayInformation about a list of signals to fetch data from.
spooling_modestringWhether to store collected data after a vehicle lost a connection with the cloud. After a connection is re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. (OFF, TO_DISK)
start_timestring (date-time)The time, in milliseconds, to deliver a campaign after it was approved.
statusstringThe state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. (CREATING, WAITING_FOR_APPROVAL, RUNNING, SUSPENDED)
target_arnstringThe ARN of the vehicle or the fleet targeted by the campaign.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_campaignselectregionRetrieves information about a campaign. Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see Amazon Web Services Region and feature availability in the Amazon Web Services IoT FleetWise Developer Guide.
list_campaignsselectregionLists information about created campaigns. This API operation uses pagination. Specify the nextToken parameter in the request to return more results.
create_campaigninsertregion, name, signalCatalogArn, targetArn, collectionSchemeCreates an orchestration of data collection rules. The Amazon Web Services IoT FleetWise Edge Agent software running in vehicles uses campaigns to decide how to collect and transfer data to the cloud. You create campaigns in the cloud. After you or your team approve campaigns, Amazon Web Services IoT FleetWise automatically deploys them to vehicles. For more information, see Collect and transfer data with campaigns in the Amazon Web Services IoT FleetWise Developer Guide. Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see Amazon Web Services Region and feature availability in the Amazon Web Services IoT FleetWise Developer Guide.
update_campaignupdateregion, name, actionUpdates a campaign.
delete_campaigndeleteregionDeletes a data collection campaign. Deleting a campaign suspends all data collection and removes it from any vehicles.

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 campaign. Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see Amazon Web Services Region and feature availability in the Amazon Web Services IoT FleetWise Developer Guide.

SELECT
name,
arn,
collection_scheme,
compression,
creation_time,
data_destination_configs,
data_extra_dimensions,
data_partitions,
description,
diagnostics_mode,
expiry_time,
last_modification_time,
post_trigger_collection_duration,
priority,
signal_catalog_arn,
signals_to_collect,
signals_to_fetch,
spooling_mode,
start_time,
status,
target_arn
FROM aws.iotfleetwise.campaigns
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an orchestration of data collection rules. The Amazon Web Services IoT FleetWise Edge Agent software running in vehicles uses campaigns to decide how to collect and transfer data to the cloud. You create campaigns in the cloud. After you or your team approve campaigns, Amazon Web Services IoT FleetWise automatically deploys them to vehicles. For more information, see Collect and transfer data with campaigns in the Amazon Web Services IoT FleetWise Developer Guide. Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see Amazon Web Services Region and feature availability in the Amazon Web Services IoT FleetWise Developer Guide.

INSERT INTO aws.iotfleetwise.campaigns (
name,
description,
signalCatalogArn,
targetArn,
startTime,
expiryTime,
postTriggerCollectionDuration,
diagnosticsMode,
spoolingMode,
compression,
priority,
signalsToCollect,
collectionScheme,
dataExtraDimensions,
tags,
dataDestinationConfigs,
dataPartitions,
signalsToFetch,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ signalCatalogArn }}' /* required */,
'{{ targetArn }}' /* required */,
'{{ startTime }}',
'{{ expiryTime }}',
{{ postTriggerCollectionDuration }},
'{{ diagnosticsMode }}',
'{{ spoolingMode }}',
'{{ compression }}',
{{ priority }},
'{{ signalsToCollect }}',
'{{ collectionScheme }}' /* required */,
'{{ dataExtraDimensions }}',
'{{ tags }}',
'{{ dataDestinationConfigs }}',
'{{ dataPartitions }}',
'{{ signalsToFetch }}',
'{{ region }}'
RETURNING
name,
arn
;

UPDATE examples

Updates a campaign.

UPDATE aws.iotfleetwise.campaigns
SET
name = '{{ name }}',
description = '{{ description }}',
dataExtraDimensions = '{{ dataExtraDimensions }}',
action = '{{ action }}'
WHERE
region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND action = '{{ action }}' --required
RETURNING
name,
arn,
status;

DELETE examples

Deletes a data collection campaign. Deleting a campaign suspends all data collection and removes it from any vehicles.

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