#[non_exhaustive]
pub struct PutAlarmInputBuilder { /* private fields */ }
Expand description

A builder for PutAlarmInput.

Implementations§

source§

impl PutAlarmInputBuilder

source

pub fn alarm_name(self, input: impl Into<String>) -> Self

The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.

This field is required.
source

pub fn set_alarm_name(self, input: Option<String>) -> Self

The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.

source

pub fn get_alarm_name(&self) -> &Option<String>

The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.

source

pub fn metric_name(self, input: MetricName) -> Self

The name of the metric to associate with the alarm.

You can configure up to two alarms per metric.

The following metrics are available for each resource type:

  • Instances: BurstCapacityPercentage, BurstCapacityTime, CPUUtilization, NetworkIn, NetworkOut, StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System.

  • Load balancers: ClientTLSNegotiationErrorCount, HealthyHostCount, UnhealthyHostCount, HTTPCode_LB_4XX_Count, HTTPCode_LB_5XX_Count, HTTPCode_Instance_2XX_Count, HTTPCode_Instance_3XX_Count, HTTPCode_Instance_4XX_Count, HTTPCode_Instance_5XX_Count, InstanceResponseTime, RejectedConnectionCount, and RequestCount.

  • Relational databases: CPUUtilization, DatabaseConnections, DiskQueueDepth, FreeStorageSpace, NetworkReceiveThroughput, and NetworkTransmitThroughput.

For more information about these metrics, see Metrics available in Lightsail.

This field is required.
source

pub fn set_metric_name(self, input: Option<MetricName>) -> Self

The name of the metric to associate with the alarm.

You can configure up to two alarms per metric.

The following metrics are available for each resource type:

  • Instances: BurstCapacityPercentage, BurstCapacityTime, CPUUtilization, NetworkIn, NetworkOut, StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System.

  • Load balancers: ClientTLSNegotiationErrorCount, HealthyHostCount, UnhealthyHostCount, HTTPCode_LB_4XX_Count, HTTPCode_LB_5XX_Count, HTTPCode_Instance_2XX_Count, HTTPCode_Instance_3XX_Count, HTTPCode_Instance_4XX_Count, HTTPCode_Instance_5XX_Count, InstanceResponseTime, RejectedConnectionCount, and RequestCount.

  • Relational databases: CPUUtilization, DatabaseConnections, DiskQueueDepth, FreeStorageSpace, NetworkReceiveThroughput, and NetworkTransmitThroughput.

For more information about these metrics, see Metrics available in Lightsail.

source

pub fn get_metric_name(&self) -> &Option<MetricName>

The name of the metric to associate with the alarm.

You can configure up to two alarms per metric.

The following metrics are available for each resource type:

  • Instances: BurstCapacityPercentage, BurstCapacityTime, CPUUtilization, NetworkIn, NetworkOut, StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System.

  • Load balancers: ClientTLSNegotiationErrorCount, HealthyHostCount, UnhealthyHostCount, HTTPCode_LB_4XX_Count, HTTPCode_LB_5XX_Count, HTTPCode_Instance_2XX_Count, HTTPCode_Instance_3XX_Count, HTTPCode_Instance_4XX_Count, HTTPCode_Instance_5XX_Count, InstanceResponseTime, RejectedConnectionCount, and RequestCount.

  • Relational databases: CPUUtilization, DatabaseConnections, DiskQueueDepth, FreeStorageSpace, NetworkReceiveThroughput, and NetworkTransmitThroughput.

For more information about these metrics, see Metrics available in Lightsail.

source

pub fn monitored_resource_name(self, input: impl Into<String>) -> Self

The name of the Lightsail resource that will be monitored.

Instances, load balancers, and relational databases are the only Lightsail resources that can currently be monitored by alarms.

This field is required.
source

pub fn set_monitored_resource_name(self, input: Option<String>) -> Self

The name of the Lightsail resource that will be monitored.

Instances, load balancers, and relational databases are the only Lightsail resources that can currently be monitored by alarms.

source

pub fn get_monitored_resource_name(&self) -> &Option<String>

The name of the Lightsail resource that will be monitored.

Instances, load balancers, and relational databases are the only Lightsail resources that can currently be monitored by alarms.

source

pub fn comparison_operator(self, input: ComparisonOperator) -> Self

The arithmetic operation to use when comparing the specified statistic to the threshold. The specified statistic value is used as the first operand.

This field is required.
source

pub fn set_comparison_operator(self, input: Option<ComparisonOperator>) -> Self

The arithmetic operation to use when comparing the specified statistic to the threshold. The specified statistic value is used as the first operand.

source

pub fn get_comparison_operator(&self) -> &Option<ComparisonOperator>

The arithmetic operation to use when comparing the specified statistic to the threshold. The specified statistic value is used as the first operand.

source

pub fn threshold(self, input: f64) -> Self

The value against which the specified statistic is compared.

This field is required.
source

pub fn set_threshold(self, input: Option<f64>) -> Self

The value against which the specified statistic is compared.

source

pub fn get_threshold(&self) -> &Option<f64>

The value against which the specified statistic is compared.

source

pub fn evaluation_periods(self, input: i32) -> Self

The number of most recent periods over which data is compared to the specified threshold. If you are setting an "M out of N" alarm, this value (evaluationPeriods) is the N.

If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies the rolling period of time in which data points are evaluated.

Each evaluation period is five minutes long. For example, specify an evaluation period of 24 to evaluate a metric over a rolling period of two hours.

You can specify a minimum valuation period of 1 (5 minutes), and a maximum evaluation period of 288 (24 hours).

This field is required.
source

pub fn set_evaluation_periods(self, input: Option<i32>) -> Self

The number of most recent periods over which data is compared to the specified threshold. If you are setting an "M out of N" alarm, this value (evaluationPeriods) is the N.

If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies the rolling period of time in which data points are evaluated.

Each evaluation period is five minutes long. For example, specify an evaluation period of 24 to evaluate a metric over a rolling period of two hours.

You can specify a minimum valuation period of 1 (5 minutes), and a maximum evaluation period of 288 (24 hours).

source

pub fn get_evaluation_periods(&self) -> &Option<i32>

The number of most recent periods over which data is compared to the specified threshold. If you are setting an "M out of N" alarm, this value (evaluationPeriods) is the N.

If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies the rolling period of time in which data points are evaluated.

Each evaluation period is five minutes long. For example, specify an evaluation period of 24 to evaluate a metric over a rolling period of two hours.

You can specify a minimum valuation period of 1 (5 minutes), and a maximum evaluation period of 288 (24 hours).

source

pub fn datapoints_to_alarm(self, input: i32) -> Self

The number of data points that must be not within the specified threshold to trigger the alarm. If you are setting an "M out of N" alarm, this value (datapointsToAlarm) is the M.

source

pub fn set_datapoints_to_alarm(self, input: Option<i32>) -> Self

The number of data points that must be not within the specified threshold to trigger the alarm. If you are setting an "M out of N" alarm, this value (datapointsToAlarm) is the M.

source

pub fn get_datapoints_to_alarm(&self) -> &Option<i32>

The number of data points that must be not within the specified threshold to trigger the alarm. If you are setting an "M out of N" alarm, this value (datapointsToAlarm) is the M.

source

pub fn treat_missing_data(self, input: TreatMissingData) -> Self

Sets how this alarm will handle missing data points.

An alarm can treat missing data in the following ways:

  • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

  • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

  • ignore - Ignore the missing data. Maintains the current alarm state.

  • missing - Missing data is treated as missing.

If treatMissingData is not specified, the default behavior of missing is used.

source

pub fn set_treat_missing_data(self, input: Option<TreatMissingData>) -> Self

Sets how this alarm will handle missing data points.

An alarm can treat missing data in the following ways:

  • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

  • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

  • ignore - Ignore the missing data. Maintains the current alarm state.

  • missing - Missing data is treated as missing.

If treatMissingData is not specified, the default behavior of missing is used.

source

pub fn get_treat_missing_data(&self) -> &Option<TreatMissingData>

Sets how this alarm will handle missing data points.

An alarm can treat missing data in the following ways:

  • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

  • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

  • ignore - Ignore the missing data. Maintains the current alarm state.

  • missing - Missing data is treated as missing.

If treatMissingData is not specified, the default behavior of missing is used.

source

pub fn contact_protocols(self, input: ContactProtocol) -> Self

Appends an item to contact_protocols.

To override the contents of this collection use set_contact_protocols.

The contact protocols to use for the alarm, such as Email, SMS (text messaging), or both.

A notification is sent via the specified contact protocol if notifications are enabled for the alarm, and when the alarm is triggered.

A notification is not sent if a contact protocol is not specified, if the specified contact protocol is not configured in the Amazon Web Services Region, or if notifications are not enabled for the alarm using the notificationEnabled paramater.

Use the CreateContactMethod action to configure a contact protocol in an Amazon Web Services Region.

source

pub fn set_contact_protocols(self, input: Option<Vec<ContactProtocol>>) -> Self

The contact protocols to use for the alarm, such as Email, SMS (text messaging), or both.

A notification is sent via the specified contact protocol if notifications are enabled for the alarm, and when the alarm is triggered.

A notification is not sent if a contact protocol is not specified, if the specified contact protocol is not configured in the Amazon Web Services Region, or if notifications are not enabled for the alarm using the notificationEnabled paramater.

Use the CreateContactMethod action to configure a contact protocol in an Amazon Web Services Region.

source

pub fn get_contact_protocols(&self) -> &Option<Vec<ContactProtocol>>

The contact protocols to use for the alarm, such as Email, SMS (text messaging), or both.

A notification is sent via the specified contact protocol if notifications are enabled for the alarm, and when the alarm is triggered.

A notification is not sent if a contact protocol is not specified, if the specified contact protocol is not configured in the Amazon Web Services Region, or if notifications are not enabled for the alarm using the notificationEnabled paramater.

Use the CreateContactMethod action to configure a contact protocol in an Amazon Web Services Region.

source

pub fn notification_triggers(self, input: AlarmState) -> Self

Appends an item to notification_triggers.

To override the contents of this collection use set_notification_triggers.

The alarm states that trigger a notification.

An alarm has the following possible states:

  • ALARM - The metric is outside of the defined threshold.

  • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

  • OK - The metric is within the defined threshold.

When you specify a notification trigger, the ALARM state must be specified. The INSUFFICIENT_DATA and OK states can be specified in addition to the ALARM state.

  • If you specify OK as an alarm trigger, a notification is sent when the alarm switches from an ALARM or INSUFFICIENT_DATA alarm state to an OK state. This can be thought of as an all clear alarm notification.

  • If you specify INSUFFICIENT_DATA as the alarm trigger, a notification is sent when the alarm switches from an OK or ALARM alarm state to an INSUFFICIENT_DATA state.

The notification trigger defaults to ALARM if you don't specify this parameter.

source

pub fn set_notification_triggers(self, input: Option<Vec<AlarmState>>) -> Self

The alarm states that trigger a notification.

An alarm has the following possible states:

  • ALARM - The metric is outside of the defined threshold.

  • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

  • OK - The metric is within the defined threshold.

When you specify a notification trigger, the ALARM state must be specified. The INSUFFICIENT_DATA and OK states can be specified in addition to the ALARM state.

  • If you specify OK as an alarm trigger, a notification is sent when the alarm switches from an ALARM or INSUFFICIENT_DATA alarm state to an OK state. This can be thought of as an all clear alarm notification.

  • If you specify INSUFFICIENT_DATA as the alarm trigger, a notification is sent when the alarm switches from an OK or ALARM alarm state to an INSUFFICIENT_DATA state.

The notification trigger defaults to ALARM if you don't specify this parameter.

source

pub fn get_notification_triggers(&self) -> &Option<Vec<AlarmState>>

The alarm states that trigger a notification.

An alarm has the following possible states:

  • ALARM - The metric is outside of the defined threshold.

  • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

  • OK - The metric is within the defined threshold.

When you specify a notification trigger, the ALARM state must be specified. The INSUFFICIENT_DATA and OK states can be specified in addition to the ALARM state.

  • If you specify OK as an alarm trigger, a notification is sent when the alarm switches from an ALARM or INSUFFICIENT_DATA alarm state to an OK state. This can be thought of as an all clear alarm notification.

  • If you specify INSUFFICIENT_DATA as the alarm trigger, a notification is sent when the alarm switches from an OK or ALARM alarm state to an INSUFFICIENT_DATA state.

The notification trigger defaults to ALARM if you don't specify this parameter.

source

pub fn notification_enabled(self, input: bool) -> Self

Indicates whether the alarm is enabled.

Notifications are enabled by default if you don't specify this parameter.

source

pub fn set_notification_enabled(self, input: Option<bool>) -> Self

Indicates whether the alarm is enabled.

Notifications are enabled by default if you don't specify this parameter.

source

pub fn get_notification_enabled(&self) -> &Option<bool>

Indicates whether the alarm is enabled.

Notifications are enabled by default if you don't specify this parameter.

source

pub fn build(self) -> Result<PutAlarmInput, BuildError>

Consumes the builder and constructs a PutAlarmInput.

source§

impl PutAlarmInputBuilder

source

pub async fn send_with( self, client: &Client ) -> Result<PutAlarmOutput, SdkError<PutAlarmError, HttpResponse>>

Sends a request with this input using the given client.

Trait Implementations§

source§

impl Clone for PutAlarmInputBuilder

source§

fn clone(&self) -> PutAlarmInputBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PutAlarmInputBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for PutAlarmInputBuilder

source§

fn default() -> PutAlarmInputBuilder

Returns the “default value” for a type. Read more
source§

impl PartialEq for PutAlarmInputBuilder

source§

fn eq(&self, other: &PutAlarmInputBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for PutAlarmInputBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more