- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListAlarmsCommand
Lists one or more alarms. The operation returns only the metadata associated with each alarm.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTEventsDataClient, ListAlarmsCommand } from "@aws-sdk/client-iot-events-data"; // ES Modules import
// const { IoTEventsDataClient, ListAlarmsCommand } = require("@aws-sdk/client-iot-events-data"); // CommonJS import
const client = new IoTEventsDataClient(config);
const input = { // ListAlarmsRequest
alarmModelName: "STRING_VALUE", // required
nextToken: "STRING_VALUE",
maxResults: Number("int"),
};
const command = new ListAlarmsCommand(input);
const response = await client.send(command);
// { // ListAlarmsResponse
// alarmSummaries: [ // AlarmSummaries
// { // AlarmSummary
// alarmModelName: "STRING_VALUE",
// alarmModelVersion: "STRING_VALUE",
// keyValue: "STRING_VALUE",
// stateName: "DISABLED" || "NORMAL" || "ACTIVE" || "ACKNOWLEDGED" || "SNOOZE_DISABLED" || "LATCHED",
// creationTime: new Date("TIMESTAMP"),
// lastUpdateTime: new Date("TIMESTAMP"),
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListAlarmsCommand Input
See ListAlarmsCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
alarmModelName Required | string | undefined | The name of the alarm model. |
maxResults | number | undefined | The maximum number of results to be returned per request. |
nextToken | string | undefined | The token that you can use to return the next set of results. |
ListAlarmsCommand Output
See ListAlarmsCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
alarmSummaries | AlarmSummary[] | undefined | A list that summarizes each alarm. |
nextToken | string | undefined | The token that you can use to return the next set of results, or |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalFailureException | server | An internal failure occurred. |
InvalidRequestException | client | The request was invalid. |
ResourceNotFoundException | client | The resource was not found. |
ServiceUnavailableException | server | The service is currently unavailable. |
ThrottlingException | client | The request could not be completed due to throttling. |
IoTEventsDataServiceException | Base exception class for all service exceptions from IoTEventsData service. |