Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Temporarily sets the state of an alarm for testing purposes. When the
updated state differs from the previous value, the action configured for
the appropriate state is invoked. For example, if your alarm is
configured to send an Amazon SNS message when an alarm is triggered,
temporarily changing the alarm state to ALARM
sends an SNS message.
Metric alarms returns to their actual state quickly, often within seconds. Because the metric alarm state change happens quickly, it is typically only visible in the alarm's History tab in the Amazon CloudWatch console or through DescribeAlarmHistory.
If you use SetAlarmState
on a composite alarm, the composite alarm is
not guaranteed to return to its actual state. It returns to its actual
state only once any of its children alarms change state. It is also
reevaluated if you update its configuration.
If an alarm triggers EC2 Auto Scaling policies or application Auto
Scaling policies, you must include information in the StateReasonData
parameter to enable the policy to take the correct action.
Synopsis
- data SetAlarmState = SetAlarmState' {}
- newSetAlarmState :: Text -> StateValue -> Text -> SetAlarmState
- setAlarmState_stateReasonData :: Lens' SetAlarmState (Maybe Text)
- setAlarmState_alarmName :: Lens' SetAlarmState Text
- setAlarmState_stateValue :: Lens' SetAlarmState StateValue
- setAlarmState_stateReason :: Lens' SetAlarmState Text
- data SetAlarmStateResponse = SetAlarmStateResponse' {
- newSetAlarmStateResponse :: SetAlarmStateResponse
Creating a Request
data SetAlarmState Source #
See: newSetAlarmState
smart constructor.
SetAlarmState' | |
|
Instances
:: Text | |
-> StateValue | |
-> Text | |
-> SetAlarmState |
Create a value of SetAlarmState
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:stateReasonData:SetAlarmState'
, setAlarmState_stateReasonData
- The reason that this alarm is set to this specific state, in JSON
format.
For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.
$sel:alarmName:SetAlarmState'
, setAlarmState_alarmName
- The name of the alarm.
$sel:stateValue:SetAlarmState'
, setAlarmState_stateValue
- The value of the state.
$sel:stateReason:SetAlarmState'
, setAlarmState_stateReason
- The reason that this alarm is set to this specific state, in text
format.
Request Lenses
setAlarmState_stateReasonData :: Lens' SetAlarmState (Maybe Text) Source #
The reason that this alarm is set to this specific state, in JSON format.
For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.
setAlarmState_alarmName :: Lens' SetAlarmState Text Source #
The name of the alarm.
setAlarmState_stateValue :: Lens' SetAlarmState StateValue Source #
The value of the state.
setAlarmState_stateReason :: Lens' SetAlarmState Text Source #
The reason that this alarm is set to this specific state, in text format.
Destructuring the Response
data SetAlarmStateResponse Source #
See: newSetAlarmStateResponse
smart constructor.
Instances
Eq SetAlarmStateResponse Source # | |
Defined in Amazonka.CloudWatch.SetAlarmState (==) :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool # (/=) :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool # | |
Read SetAlarmStateResponse Source # | |
Show SetAlarmStateResponse Source # | |
Defined in Amazonka.CloudWatch.SetAlarmState showsPrec :: Int -> SetAlarmStateResponse -> ShowS # show :: SetAlarmStateResponse -> String # showList :: [SetAlarmStateResponse] -> ShowS # | |
Generic SetAlarmStateResponse Source # | |
Defined in Amazonka.CloudWatch.SetAlarmState type Rep SetAlarmStateResponse :: Type -> Type # | |
NFData SetAlarmStateResponse Source # | |
Defined in Amazonka.CloudWatch.SetAlarmState rnf :: SetAlarmStateResponse -> () # | |
type Rep SetAlarmStateResponse Source # | |
newSetAlarmStateResponse :: SetAlarmStateResponse Source #
Create a value of SetAlarmStateResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.