Struct aws_sdk_cloudwatch::client::fluent_builders::SetAlarmState
source · [−]pub struct SetAlarmState { /* private fields */ }Expand description
Fluent builder constructing a request to SetAlarmState.
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.
Implementations
sourceimpl SetAlarmState
impl SetAlarmState
sourcepub async fn send(
self
) -> Result<SetAlarmStateOutput, SdkError<SetAlarmStateError>>
pub async fn send(
self
) -> Result<SetAlarmStateOutput, SdkError<SetAlarmStateError>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn alarm_name(self, input: impl Into<String>) -> Self
pub fn alarm_name(self, input: impl Into<String>) -> Self
The name of the alarm.
sourcepub fn set_alarm_name(self, input: Option<String>) -> Self
pub fn set_alarm_name(self, input: Option<String>) -> Self
The name of the alarm.
sourcepub fn state_value(self, input: StateValue) -> Self
pub fn state_value(self, input: StateValue) -> Self
The value of the state.
sourcepub fn set_state_value(self, input: Option<StateValue>) -> Self
pub fn set_state_value(self, input: Option<StateValue>) -> Self
The value of the state.
sourcepub fn state_reason(self, input: impl Into<String>) -> Self
pub fn state_reason(self, input: impl Into<String>) -> Self
The reason that this alarm is set to this specific state, in text format.
sourcepub fn set_state_reason(self, input: Option<String>) -> Self
pub fn set_state_reason(self, input: Option<String>) -> Self
The reason that this alarm is set to this specific state, in text format.
sourcepub fn state_reason_data(self, input: impl Into<String>) -> Self
pub fn state_reason_data(self, input: impl Into<String>) -> Self
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.
sourcepub fn set_state_reason_data(self, input: Option<String>) -> Self
pub fn set_state_reason_data(self, input: Option<String>) -> Self
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.
Trait Implementations
sourceimpl Clone for SetAlarmState
impl Clone for SetAlarmState
sourcefn clone(&self) -> SetAlarmState
fn clone(&self) -> SetAlarmState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SetAlarmState
impl Send for SetAlarmState
impl Sync for SetAlarmState
impl Unpin for SetAlarmState
impl !UnwindSafe for SetAlarmState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more