ListCampaignsCommand

Lists information about created campaigns.

This API operation uses pagination. Specify the nextToken parameter in the request to return more results.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IoTFleetWiseClient, ListCampaignsCommand } from "@aws-sdk/client-iotfleetwise"; // ES Modules import
// const { IoTFleetWiseClient, ListCampaignsCommand } = require("@aws-sdk/client-iotfleetwise"); // CommonJS import
const client = new IoTFleetWiseClient(config);
const input = { // ListCampaignsRequest
  nextToken: "STRING_VALUE",
  maxResults: Number("int"),
  status: "STRING_VALUE",
  listResponseScope: "METADATA_ONLY",
};
const command = new ListCampaignsCommand(input);
const response = await client.send(command);
// { // ListCampaignsResponse
//   campaignSummaries: [ // campaignSummaries
//     { // CampaignSummary
//       arn: "STRING_VALUE",
//       name: "STRING_VALUE",
//       description: "STRING_VALUE",
//       signalCatalogArn: "STRING_VALUE",
//       targetArn: "STRING_VALUE",
//       status: "CREATING" || "WAITING_FOR_APPROVAL" || "RUNNING" || "SUSPENDED",
//       creationTime: new Date("TIMESTAMP"), // required
//       lastModificationTime: new Date("TIMESTAMP"), // required
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

ListCampaignsCommand Input

See ListCampaignsCommandInput for more details

Parameter
Type
Description
listResponseScope
ListResponseScope | undefined

When you set the listResponseScope parameter to METADATA_ONLY, the list response includes: campaign name, Amazon Resource Name (ARN), creation time, and last modification time.

maxResults
number | undefined

The maximum number of items to return, between 1 and 100, inclusive.

nextToken
string | undefined

A pagination token for the next set of results.

If the results of a search are large, only a portion of the results are returned, and a nextToken pagination token is returned in the response. To retrieve the next set of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.

status
string | undefined

An optional parameter to filter the results by the status of each created campaign in your account. The status can be one of: CREATING, WAITING_FOR_APPROVAL, RUNNING, or SUSPENDED.

ListCampaignsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
campaignSummaries
CampaignSummary[] | undefined

A summary of information about each campaign.

nextToken
string | undefined

The token to retrieve the next set of results, or null if there are no more results.

Throws

Name
Fault
Details
AccessDeniedException
client

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

ThrottlingException
client

The request couldn't be completed due to throttling.

ValidationException
client

The input fails to satisfy the constraints specified by an Amazon Web Services service.

InternalServerException
server

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

IoTFleetWiseServiceException
Base exception class for all service exceptions from IoTFleetWise service.