| 1 | |||
| 2 | package Paws::Lightsail::PutAlarm; | ||
| 3 | use Moose; | ||
| 4 | has AlarmName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'alarmName' , required => 1); | ||
| 5 | has ComparisonOperator => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'comparisonOperator' , required => 1); | ||
| 6 | has ContactProtocols => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'contactProtocols' ); | ||
| 7 | has DatapointsToAlarm => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'datapointsToAlarm' ); | ||
| 8 | has EvaluationPeriods => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'evaluationPeriods' , required => 1); | ||
| 9 | has MetricName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'metricName' , required => 1); | ||
| 10 | has MonitoredResourceName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'monitoredResourceName' , required => 1); | ||
| 11 | has NotificationEnabled => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'notificationEnabled' ); | ||
| 12 | has NotificationTriggers => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'notificationTriggers' ); | ||
| 13 | has Threshold => (is => 'ro', isa => 'Num', traits => ['NameInRequest'], request_name => 'threshold' , required => 1); | ||
| 14 | has TreatMissingData => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'treatMissingData' ); | ||
| 15 | |||
| 16 | use MooseX::ClassAttribute; | ||
| 17 | |||
| 18 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutAlarm'); | ||
| 19 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Lightsail::PutAlarmResult'); | ||
| 20 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 21 | 1; | ||
| 22 | |||
| 23 | ### main pod documentation begin ### | ||
| 24 | |||
| 25 | =head1 NAME | ||
| 26 | |||
| 27 | Paws::Lightsail::PutAlarm - Arguments for method PutAlarm on L<Paws::Lightsail> | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | This class represents the parameters used for calling the method PutAlarm on the | ||
| 32 | L<Amazon Lightsail|Paws::Lightsail> service. Use the attributes of this class | ||
| 33 | as arguments to method PutAlarm. | ||
| 34 | |||
| 35 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutAlarm. | ||
| 36 | |||
| 37 | =head1 SYNOPSIS | ||
| 38 | |||
| 39 | my $lightsail = Paws->service('Lightsail'); | ||
| 40 | my $PutAlarmResult = $lightsail->PutAlarm( | ||
| 41 | AlarmName => 'MyResourceName', | ||
| 42 | ComparisonOperator => 'GreaterThanOrEqualToThreshold', | ||
| 43 | EvaluationPeriods => 1, | ||
| 44 | MetricName => 'CPUUtilization', | ||
| 45 | MonitoredResourceName => 'MyResourceName', | ||
| 46 | Threshold => 1, | ||
| 47 | ContactProtocols => [ | ||
| 48 | 'Email', ... # values: Email, SMS | ||
| 49 | ], # OPTIONAL | ||
| 50 | DatapointsToAlarm => 1, # OPTIONAL | ||
| 51 | NotificationEnabled => 1, # OPTIONAL | ||
| 52 | NotificationTriggers => [ | ||
| 53 | 'OK', ... # values: OK, ALARM, INSUFFICIENT_DATA | ||
| 54 | ], # OPTIONAL | ||
| 55 | TreatMissingData => 'breaching', # OPTIONAL | ||
| 56 | ); | ||
| 57 | |||
| 58 | # Results: | ||
| 59 | my $Operations = $PutAlarmResult->Operations; | ||
| 60 | |||
| 61 | # Returns a L<Paws::Lightsail::PutAlarmResult> object. | ||
| 62 | |||
| 63 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 64 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/lightsail/PutAlarm> | ||
| 65 | |||
| 66 | =head1 ATTRIBUTES | ||
| 67 | |||
| 68 | |||
| 69 | =head2 B<REQUIRED> AlarmName => Str | ||
| 70 | |||
| 71 | The name for the alarm. Specify the name of an existing alarm to | ||
| 72 | update, and overwrite the previous configuration of the alarm. | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | =head2 B<REQUIRED> ComparisonOperator => Str | ||
| 77 | |||
| 78 | The arithmetic operation to use when comparing the specified statistic | ||
| 79 | to the threshold. The specified statistic value is used as the first | ||
| 80 | operand. | ||
| 81 | |||
| 82 | Valid values are: C<"GreaterThanOrEqualToThreshold">, C<"GreaterThanThreshold">, C<"LessThanThreshold">, C<"LessThanOrEqualToThreshold"> | ||
| 83 | |||
| 84 | =head2 ContactProtocols => ArrayRef[Str|Undef] | ||
| 85 | |||
| 86 | The contact protocols to use for the alarm, such as C<Email>, C<SMS> | ||
| 87 | (text messaging), or both. | ||
| 88 | |||
| 89 | A notification is sent via the specified contact protocol if | ||
| 90 | notifications are enabled for the alarm, and when the alarm is | ||
| 91 | triggered. | ||
| 92 | |||
| 93 | A notification is not sent if a contact protocol is not specified, if | ||
| 94 | the specified contact protocol is not configured in the AWS Region, or | ||
| 95 | if notifications are not enabled for the alarm using the | ||
| 96 | C<notificationEnabled> paramater. | ||
| 97 | |||
| 98 | Use the C<CreateContactMethod> action to configure a contact protocol | ||
| 99 | in an AWS Region. | ||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | =head2 DatapointsToAlarm => Int | ||
| 104 | |||
| 105 | The number of data points that must be not within the specified | ||
| 106 | threshold to trigger the alarm. If you are setting an "M out of N" | ||
| 107 | alarm, this value (C<datapointsToAlarm>) is the M. | ||
| 108 | |||
| 109 | |||
| 110 | |||
| 111 | =head2 B<REQUIRED> EvaluationPeriods => Int | ||
| 112 | |||
| 113 | The number of most recent periods over which data is compared to the | ||
| 114 | specified threshold. If you are setting an "M out of N" alarm, this | ||
| 115 | value (C<evaluationPeriods>) is the N. | ||
| 116 | |||
| 117 | If you are setting an alarm that requires that a number of consecutive | ||
| 118 | data points be breaching to trigger the alarm, this value specifies the | ||
| 119 | rolling period of time in which data points are evaluated. | ||
| 120 | |||
| 121 | Each evaluation period is five minutes long. For example, specify an | ||
| 122 | evaluation period of 24 to evaluate a metric over a rolling period of | ||
| 123 | two hours. | ||
| 124 | |||
| 125 | You can specify a minimum valuation period of 1 (5 minutes), and a | ||
| 126 | maximum evaluation period of 288 (24 hours). | ||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | =head2 B<REQUIRED> MetricName => Str | ||
| 131 | |||
| 132 | The name of the metric to associate with the alarm. | ||
| 133 | |||
| 134 | You can configure up to two alarms per metric. | ||
| 135 | |||
| 136 | The following metrics are available for each resource type: | ||
| 137 | |||
| 138 | =over | ||
| 139 | |||
| 140 | =item * | ||
| 141 | |||
| 142 | B<Instances>: C<BurstCapacityPercentage>, C<BurstCapacityTime>, | ||
| 143 | C<CPUUtilization>, C<NetworkIn>, C<NetworkOut>, C<StatusCheckFailed>, | ||
| 144 | C<StatusCheckFailed_Instance>, and C<StatusCheckFailed_System>. | ||
| 145 | |||
| 146 | =item * | ||
| 147 | |||
| 148 | B<Load balancers>: C<ClientTLSNegotiationErrorCount>, | ||
| 149 | C<HealthyHostCount>, C<UnhealthyHostCount>, C<HTTPCode_LB_4XX_Count>, | ||
| 150 | C<HTTPCode_LB_5XX_Count>, C<HTTPCode_Instance_2XX_Count>, | ||
| 151 | C<HTTPCode_Instance_3XX_Count>, C<HTTPCode_Instance_4XX_Count>, | ||
| 152 | C<HTTPCode_Instance_5XX_Count>, C<InstanceResponseTime>, | ||
| 153 | C<RejectedConnectionCount>, and C<RequestCount>. | ||
| 154 | |||
| 155 | =item * | ||
| 156 | |||
| 157 | B<Relational databases>: C<CPUUtilization>, C<DatabaseConnections>, | ||
| 158 | C<DiskQueueDepth>, C<FreeStorageSpace>, C<NetworkReceiveThroughput>, | ||
| 159 | and C<NetworkTransmitThroughput>. | ||
| 160 | |||
| 161 | =back | ||
| 162 | |||
| 163 | For more information about these metrics, see Metrics available in | ||
| 164 | Lightsail | ||
| 165 | (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-resource-health-metrics#available-metrics). | ||
| 166 | |||
| 167 | Valid values are: C<"CPUUtilization">, C<"NetworkIn">, C<"NetworkOut">, C<"StatusCheckFailed">, C<"StatusCheckFailed_Instance">, C<"StatusCheckFailed_System">, C<"ClientTLSNegotiationErrorCount">, C<"HealthyHostCount">, C<"UnhealthyHostCount">, C<"HTTPCode_LB_4XX_Count">, C<"HTTPCode_LB_5XX_Count">, C<"HTTPCode_Instance_2XX_Count">, C<"HTTPCode_Instance_3XX_Count">, C<"HTTPCode_Instance_4XX_Count">, C<"HTTPCode_Instance_5XX_Count">, C<"InstanceResponseTime">, C<"RejectedConnectionCount">, C<"RequestCount">, C<"DatabaseConnections">, C<"DiskQueueDepth">, C<"FreeStorageSpace">, C<"NetworkReceiveThroughput">, C<"NetworkTransmitThroughput">, C<"BurstCapacityTime">, C<"BurstCapacityPercentage"> | ||
| 168 | |||
| 169 | =head2 B<REQUIRED> MonitoredResourceName => Str | ||
| 170 | |||
| 171 | The name of the Lightsail resource that will be monitored. | ||
| 172 | |||
| 173 | Instances, load balancers, and relational databases are the only | ||
| 174 | Lightsail resources that can currently be monitored by alarms. | ||
| 175 | |||
| 176 | |||
| 177 | |||
| 178 | =head2 NotificationEnabled => Bool | ||
| 179 | |||
| 180 | Indicates whether the alarm is enabled. | ||
| 181 | |||
| 182 | Notifications are enabled by default if you don't specify this | ||
| 183 | parameter. | ||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | =head2 NotificationTriggers => ArrayRef[Str|Undef] | ||
| 188 | |||
| 189 | The alarm states that trigger a notification. | ||
| 190 | |||
| 191 | An alarm has the following possible states: | ||
| 192 | |||
| 193 | =over | ||
| 194 | |||
| 195 | =item * | ||
| 196 | |||
| 197 | C<ALARM> - The metric is outside of the defined threshold. | ||
| 198 | |||
| 199 | =item * | ||
| 200 | |||
| 201 | C<INSUFFICIENT_DATA> - The alarm has just started, the metric is not | ||
| 202 | available, or not enough data is available for the metric to determine | ||
| 203 | the alarm state. | ||
| 204 | |||
| 205 | =item * | ||
| 206 | |||
| 207 | C<OK> - The metric is within the defined threshold. | ||
| 208 | |||
| 209 | =back | ||
| 210 | |||
| 211 | When you specify a notification trigger, the C<ALARM> state must be | ||
| 212 | specified. The C<INSUFFICIENT_DATA> and C<OK> states can be specified | ||
| 213 | in addition to the C<ALARM> state. | ||
| 214 | |||
| 215 | =over | ||
| 216 | |||
| 217 | =item * | ||
| 218 | |||
| 219 | If you specify C<OK> as an alarm trigger, a notification is sent when | ||
| 220 | the alarm switches from an C<ALARM> or C<INSUFFICIENT_DATA> alarm state | ||
| 221 | to an C<OK> state. This can be thought of as an I<all clear> alarm | ||
| 222 | notification. | ||
| 223 | |||
| 224 | =item * | ||
| 225 | |||
| 226 | If you specify C<INSUFFICIENT_DATA> as the alarm trigger, a | ||
| 227 | notification is sent when the alarm switches from an C<OK> or C<ALARM> | ||
| 228 | alarm state to an C<INSUFFICIENT_DATA> state. | ||
| 229 | |||
| 230 | =back | ||
| 231 | |||
| 232 | The notification trigger defaults to C<ALARM> if you don't specify this | ||
| 233 | parameter. | ||
| 234 | |||
| 235 | |||
| 236 | |||
| 237 | =head2 B<REQUIRED> Threshold => Num | ||
| 238 | |||
| 239 | The value against which the specified statistic is compared. | ||
| 240 | |||
| 241 | |||
| 242 | |||
| 243 | =head2 TreatMissingData => Str | ||
| 244 | |||
| 245 | Sets how this alarm will handle missing data points. | ||
| 246 | |||
| 247 | An alarm can treat missing data in the following ways: | ||
| 248 | |||
| 249 | =over | ||
| 250 | |||
| 251 | =item * | ||
| 252 | |||
| 253 | C<breaching> - Assume the missing data is not within the threshold. | ||
| 254 | Missing data counts towards the number of times the metric is not | ||
| 255 | within the threshold. | ||
| 256 | |||
| 257 | =item * | ||
| 258 | |||
| 259 | C<notBreaching> - Assume the missing data is within the threshold. | ||
| 260 | Missing data does not count towards the number of times the metric is | ||
| 261 | not within the threshold. | ||
| 262 | |||
| 263 | =item * | ||
| 264 | |||
| 265 | C<ignore> - Ignore the missing data. Maintains the current alarm state. | ||
| 266 | |||
| 267 | =item * | ||
| 268 | |||
| 269 | C<missing> - Missing data is treated as missing. | ||
| 270 | |||
| 271 | =back | ||
| 272 | |||
| 273 | If C<treatMissingData> is not specified, the default behavior of | ||
| 274 | C<missing> is used. | ||
| 275 | |||
| 276 | Valid values are: C<"breaching">, C<"notBreaching">, C<"ignore">, C<"missing"> | ||
| 277 | |||
| 278 | |||
| 279 | =head1 SEE ALSO | ||
| 280 | |||
| 281 | This class forms part of L<Paws>, documenting arguments for method PutAlarm in L<Paws::Lightsail> | ||
| 282 | |||
| 283 | =head1 BUGS and CONTRIBUTIONS | ||
| 284 | |||
| 285 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 286 | |||
| 287 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 288 | |||
| 289 | =cut | ||
| 290 |