UpdateAlarmModel - Amazon IoT Events
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

UpdateAlarmModel

Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.

Request Syntax

POST /alarm-models/alarmModelName HTTP/1.1 Content-type: application/json { "alarmCapabilities": { "acknowledgeFlow": { "enabled": boolean }, "initializationConfiguration": { "disabledOnInitialization": boolean } }, "alarmEventActions": { "alarmActions": [ { "dynamoDB": { "hashKeyField": "string", "hashKeyType": "string", "hashKeyValue": "string", "operation": "string", "payload": { "contentExpression": "string", "type": "string" }, "payloadField": "string", "rangeKeyField": "string", "rangeKeyType": "string", "rangeKeyValue": "string", "tableName": "string" }, "dynamoDBv2": { "payload": { "contentExpression": "string", "type": "string" }, "tableName": "string" }, "firehose": { "deliveryStreamName": "string", "payload": { "contentExpression": "string", "type": "string" }, "separator": "string" }, "iotEvents": { "inputName": "string", "payload": { "contentExpression": "string", "type": "string" } }, "iotSiteWise": { "assetId": "string", "entryId": "string", "propertyAlias": "string", "propertyId": "string", "propertyValue": { "quality": "string", "timestamp": { "offsetInNanos": "string", "timeInSeconds": "string" }, "value": { "booleanValue": "string", "doubleValue": "string", "integerValue": "string", "stringValue": "string" } } }, "iotTopicPublish": { "mqttTopic": "string", "payload": { "contentExpression": "string", "type": "string" } }, "lambda": { "functionArn": "string", "payload": { "contentExpression": "string", "type": "string" } }, "sns": { "payload": { "contentExpression": "string", "type": "string" }, "targetArn": "string" }, "sqs": { "payload": { "contentExpression": "string", "type": "string" }, "queueUrl": "string", "useBase64": boolean } } ] }, "alarmModelDescription": "string", "alarmNotification": { "notificationActions": [ { "action": { "lambdaAction": { "functionArn": "string", "payload": { "contentExpression": "string", "type": "string" } } }, "emailConfigurations": [ { "content": { "additionalMessage": "string", "subject": "string" }, "from": "string", "recipients": { "to": [ { "ssoIdentity": { "identityStoreId": "string", "userId": "string" } } ] } } ], "smsConfigurations": [ { "additionalMessage": "string", "recipients": [ { "ssoIdentity": { "identityStoreId": "string", "userId": "string" } } ], "senderId": "string" } ] } ] }, "alarmRule": { "simpleRule": { "comparisonOperator": "string", "inputProperty": "string", "threshold": "string" } }, "roleArn": "string", "severity": number }

URI Request Parameters

The request uses the following URI parameters.

alarmModelName

The name of the alarm model.

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

Pattern: ^[a-zA-Z0-9_-]+$

Required: Yes

Request Body

The request accepts the following data in JSON format.

alarmCapabilities

Contains the configuration information of alarm state changes.

Type: AlarmCapabilities object

Required: No

alarmEventActions

Contains information about one or more alarm actions.

Type: AlarmEventActions object

Required: No

alarmModelDescription

The description of the alarm model.

Type: String

Length Constraints: Maximum length of 1024.

Required: No

alarmNotification

Contains information about one or more notification actions.

Type: AlarmNotification object

Required: No

alarmRule

Defines when your alarm is invoked.

Type: AlarmRule object

Required: Yes

roleArn

The ARN of the IAM role that allows the alarm to perform actions and access Amazon resources. For more information, see Amazon Resource Names (ARNs) in the Amazon General Reference.

Type: String

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

Required: Yes

severity

A non-negative integer that reflects the severity level of the alarm.

Type: Integer

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

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "alarmModelArn": "string", "alarmModelVersion": "string", "creationTime": number, "lastUpdateTime": number, "status": "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.

alarmModelArn

The ARN of the alarm model. For more information, see Amazon Resource Names (ARNs) in the Amazon General Reference.

Type: String

alarmModelVersion

The version of the alarm model.

Type: String

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

creationTime

The time the alarm model was created, in the Unix epoch format.

Type: Timestamp

lastUpdateTime

The time the alarm model was last updated, in the Unix epoch format.

Type: Timestamp

status

The status of the alarm model. The status can be one of the following values:

  • ACTIVE - The alarm model is active and it's ready to evaluate data.

  • ACTIVATING - Amazon IoT Events is activating your alarm model. Activating an alarm model can take up to a few minutes.

  • INACTIVE - The alarm model is inactive, so it isn't ready to evaluate data. Check your alarm model information and update the alarm model.

  • FAILED - You couldn't create or update the alarm model. Check your alarm model information and try again.

Type: String

Valid Values: ACTIVE | ACTIVATING | INACTIVE | FAILED

Errors

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

InternalFailureException

An internal failure occurred.

HTTP Status Code: 500

InvalidRequestException

The request was invalid.

HTTP Status Code: 400

ResourceInUseException

The resource is in use.

HTTP Status Code: 409

ResourceNotFoundException

The resource was not found.

HTTP Status Code: 404

ServiceUnavailableException

The service is currently unavailable.

HTTP Status Code: 503

ThrottlingException

The request could not be completed due to throttling.

HTTP Status Code: 429

See Also

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