CreateCampaign - AWS IoT FleetWise

CreateCampaign

Creates an orchestration of data collection rules. The AWS 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, AWS IoT FleetWise automatically deploys them to vehicles.

For more information, see Collect and transfer data with campaigns in the AWS IoT FleetWise Developer Guide.

Request Syntax

{ "collectionScheme": { "conditionBasedCollectionScheme": { "conditionLanguageVersion": number, "expression": "string", "minimumTriggerIntervalMs": number, "triggerMode": "string" }, "timeBasedCollectionScheme": { "periodMs": number } }, "compression": "string", "dataExtraDimensions": [ "string" ], "description": "string", "diagnosticsMode": "string", "expiryTime": number, "name": "string", "postTriggerCollectionDuration": number, "priority": number, "signalCatalogArn": "string", "signalsToCollect": [ { "maxSampleCount": number, "minimumSamplingIntervalMs": number, "name": "string" } ], "spoolingMode": "string", "startTime": number, "tags": [ { "Key": "string", "Value": "string" } ], "targetArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

collectionScheme

The data collection scheme associated with the campaign. You can specify a scheme that collects data based on time or an event.

Type: CollectionScheme object

Required: Yes

compression

(Optional) Whether to compress signals before transmitting data to AWS IoT FleetWise. If you don't want to compress the signals, use OFF. If it's not specified, SNAPPY is used.

Default: SNAPPY

Type: String

Valid Values: OFF | SNAPPY

Required: No

dataExtraDimensions

(Optional) A list of vehicle attributes to associate with a campaign.

Enrich the data with specified vehicle attributes. For example, add make and model to the campaign, and AWS IoT FleetWise will associate the data with those attributes as dimensions in Amazon Timestream. You can then query the data against make and model.

Default: An empty array

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 5 items.

Length Constraints: Minimum length of 1. Maximum length of 150.

Pattern: [a-zA-Z0-9_.]+

Required: No

description

An optional description of the campaign to help identify its purpose.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [^\u0000-\u001F\u007F]+

Required: No

diagnosticsMode

(Optional) Option for a vehicle to send diagnostic trouble codes to AWS IoT FleetWise. If you want to send diagnostic trouble codes, use SEND_ACTIVE_DTCS. If it's not specified, OFF is used.

Default: OFF

Type: String

Valid Values: OFF | SEND_ACTIVE_DTCS

Required: No

expiryTime

(Optional) 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.

Default: 253402214400 (December 31, 9999, 00:00:00 UTC)

Type: Timestamp

Required: No

name

The name of the campaign to create.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [a-zA-Z\d\-_:]+

Required: Yes

postTriggerCollectionDuration

(Optional) How long (in milliseconds) to collect raw data after a triggering event initiates the collection. If it's not specified, 0 is used.

Default: 0

Type: Long

Valid Range: Minimum value of 0. Maximum value of 4294967295.

Required: No

priority

(Optional) A 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. If it's not specified, 0 is used.

Default: 0

Type: Integer

Valid Range: Minimum value of 0.

Required: No

signalCatalogArn

(Optional) The Amazon Resource Name (ARN) of the signal catalog to associate with the campaign.

Type: String

Required: Yes

signalsToCollect

(Optional) A list of information about signals to collect.

Type: Array of SignalInformation objects

Array Members: Minimum number of 0 items. Maximum number of 1000 items.

Required: No

spoolingMode

(Optional) Whether 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 AWS IoT FleetWise. If you want to store collected data when a vehicle loses connection with the cloud, use TO_DISK. If it's not specified, OFF is used.

Default: OFF

Type: String

Valid Values: OFF | TO_DISK

Required: No

startTime

(Optional) The time, in milliseconds, to deliver a campaign after it was approved. If it's not specified, 0 is used.

Default: 0

Type: Timestamp

Required: No

tags

Metadata that can be used to manage the campaign.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

targetArn

The ARN of the vehicle or fleet to deploy a campaign to.

Type: String

Required: Yes

Response Syntax

{ "arn": "string", "name": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

arn

The ARN of the created campaign.

Type: String

name

The name of the created campaign.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [a-zA-Z\d\-_:]+

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have sufficient permission to perform this action.

HTTP Status Code: 400

ConflictException

The request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

HTTP Status Code: 400

InternalServerException

The request couldn't be completed because the server temporarily failed.

HTTP Status Code: 500

LimitExceededException

A service quota was exceeded.

HTTP Status Code: 400

ResourceNotFoundException

The resource wasn't found.

HTTP Status Code: 400

ThrottlingException

The request couldn't be completed due to throttling.

HTTP Status Code: 400

ValidationException

The input fails to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: