/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the lightsail-2016-11-28.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Lightsail.Model
{
///
/// Describes an alarm.
///
///
///
/// An alarm is a way to monitor your Lightsail resource metrics. For more information,
/// see Alarms
/// in Amazon Lightsail.
///
///
public partial class Alarm
{
private string _arn;
private ComparisonOperator _comparisonOperator;
private List _contactProtocols = new List();
private DateTime? _createdAt;
private int? _datapointsToAlarm;
private int? _evaluationPeriods;
private ResourceLocation _location;
private MetricName _metricName;
private MonitoredResourceInfo _monitoredResourceInfo;
private string _name;
private bool? _notificationEnabled;
private List _notificationTriggers = new List();
private int? _period;
private ResourceType _resourceType;
private AlarmState _state;
private MetricStatistic _statistic;
private string _supportCode;
private double? _threshold;
private TreatMissingData _treatMissingData;
private MetricUnit _unit;
///
/// Gets and sets the property Arn.
///
/// The Amazon Resource Name (ARN) of the alarm.
///
///
public string Arn
{
get { return this._arn; }
set { this._arn = value; }
}
// Check to see if Arn property is set
internal bool IsSetArn()
{
return this._arn != null;
}
///
/// Gets and sets the property ComparisonOperator.
///
/// The arithmetic operation used when comparing the specified statistic and threshold.
///
///
public ComparisonOperator ComparisonOperator
{
get { return this._comparisonOperator; }
set { this._comparisonOperator = value; }
}
// Check to see if ComparisonOperator property is set
internal bool IsSetComparisonOperator()
{
return this._comparisonOperator != null;
}
///
/// Gets and sets the property ContactProtocols.
///
/// The contact protocols for the alarm, such as Email
, SMS
/// (text messaging), or both.
///
///
public List ContactProtocols
{
get { return this._contactProtocols; }
set { this._contactProtocols = value; }
}
// Check to see if ContactProtocols property is set
internal bool IsSetContactProtocols()
{
return this._contactProtocols != null && this._contactProtocols.Count > 0;
}
///
/// Gets and sets the property CreatedAt.
///
/// The timestamp when the alarm was created.
///
///
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
///
/// Gets and sets the property DatapointsToAlarm.
///
/// The number of data points that must not within the specified threshold to trigger
/// the alarm.
///
///
public int DatapointsToAlarm
{
get { return this._datapointsToAlarm.GetValueOrDefault(); }
set { this._datapointsToAlarm = value; }
}
// Check to see if DatapointsToAlarm property is set
internal bool IsSetDatapointsToAlarm()
{
return this._datapointsToAlarm.HasValue;
}
///
/// Gets and sets the property EvaluationPeriods.
///
/// The number of periods over which data is compared to the specified threshold.
///
///
public int EvaluationPeriods
{
get { return this._evaluationPeriods.GetValueOrDefault(); }
set { this._evaluationPeriods = value; }
}
// Check to see if EvaluationPeriods property is set
internal bool IsSetEvaluationPeriods()
{
return this._evaluationPeriods.HasValue;
}
///
/// Gets and sets the property Location.
///
/// An object that lists information about the location of the alarm.
///
///
public ResourceLocation Location
{
get { return this._location; }
set { this._location = value; }
}
// Check to see if Location property is set
internal bool IsSetLocation()
{
return this._location != null;
}
///
/// Gets and sets the property MetricName.
///
/// The name of the metric associated with the alarm.
///
///
public MetricName MetricName
{
get { return this._metricName; }
set { this._metricName = value; }
}
// Check to see if MetricName property is set
internal bool IsSetMetricName()
{
return this._metricName != null;
}
///
/// Gets and sets the property MonitoredResourceInfo.
///
/// An object that lists information about the resource monitored by the alarm.
///
///
public MonitoredResourceInfo MonitoredResourceInfo
{
get { return this._monitoredResourceInfo; }
set { this._monitoredResourceInfo = value; }
}
// Check to see if MonitoredResourceInfo property is set
internal bool IsSetMonitoredResourceInfo()
{
return this._monitoredResourceInfo != null;
}
///
/// Gets and sets the property Name.
///
/// The name of the alarm.
///
///
public string Name
{
get { return this._name; }
set { this._name = value; }
}
// Check to see if Name property is set
internal bool IsSetName()
{
return this._name != null;
}
///
/// Gets and sets the property NotificationEnabled.
///
/// Indicates whether the alarm is enabled.
///
///
public bool NotificationEnabled
{
get { return this._notificationEnabled.GetValueOrDefault(); }
set { this._notificationEnabled = value; }
}
// Check to see if NotificationEnabled property is set
internal bool IsSetNotificationEnabled()
{
return this._notificationEnabled.HasValue;
}
///
/// Gets and sets the property NotificationTriggers.
///
/// The alarm states that trigger a notification.
///
///
public List NotificationTriggers
{
get { return this._notificationTriggers; }
set { this._notificationTriggers = value; }
}
// Check to see if NotificationTriggers property is set
internal bool IsSetNotificationTriggers()
{
return this._notificationTriggers != null && this._notificationTriggers.Count > 0;
}
///
/// Gets and sets the property Period.
///
/// The period, in seconds, over which the statistic is applied.
///
///
[AWSProperty(Min=60, Max=86400)]
public int Period
{
get { return this._period.GetValueOrDefault(); }
set { this._period = value; }
}
// Check to see if Period property is set
internal bool IsSetPeriod()
{
return this._period.HasValue;
}
///
/// Gets and sets the property ResourceType.
///
/// The Lightsail resource type (e.g., Alarm
).
///
///
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
///
/// Gets and sets the property State.
///
/// The current state of the alarm.
///
///
///
/// 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.
///
///
///
public AlarmState State
{
get { return this._state; }
set { this._state = value; }
}
// Check to see if State property is set
internal bool IsSetState()
{
return this._state != null;
}
///
/// Gets and sets the property Statistic.
///
/// The statistic for the metric associated with the alarm.
///
///
///
/// The following statistics are available:
///
/// -
///
///
Minimum
- The lowest value observed during the specified period. Use
/// this value to determine low volumes of activity for your application.
///
/// -
///
///
Maximum
- The highest value observed during the specified period. Use
/// this value to determine high volumes of activity for your application.
///
/// -
///
///
Sum
- All values submitted for the matching metric added together. You
/// can use this statistic to determine the total volume of a metric.
///
/// -
///
///
Average
- The value of Sum / SampleCount during the specified period.
/// By comparing this statistic with the Minimum and Maximum values, you can determine
/// the full scope of a metric and how close the average use is to the Minimum and Maximum
/// values. This comparison helps you to know when to increase or decrease your resources.
///
/// -
///
///
SampleCount
- The count, or number, of data points used for the statistical
/// calculation.
///
///
///
public MetricStatistic Statistic
{
get { return this._statistic; }
set { this._statistic = value; }
}
// Check to see if Statistic property is set
internal bool IsSetStatistic()
{
return this._statistic != null;
}
///
/// Gets and sets the property SupportCode.
///
/// The support code. Include this code in your email to support when you have questions
/// about your Lightsail alarm. This code enables our support team to look up your Lightsail
/// information more easily.
///
///
public string SupportCode
{
get { return this._supportCode; }
set { this._supportCode = value; }
}
// Check to see if SupportCode property is set
internal bool IsSetSupportCode()
{
return this._supportCode != null;
}
///
/// Gets and sets the property Threshold.
///
/// The value against which the specified statistic is compared.
///
///
public double Threshold
{
get { return this._threshold.GetValueOrDefault(); }
set { this._threshold = value; }
}
// Check to see if Threshold property is set
internal bool IsSetThreshold()
{
return this._threshold.HasValue;
}
///
/// Gets and sets the property TreatMissingData.
///
/// Specifies how the alarm handles 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.
///
///
///
public TreatMissingData TreatMissingData
{
get { return this._treatMissingData; }
set { this._treatMissingData = value; }
}
// Check to see if TreatMissingData property is set
internal bool IsSetTreatMissingData()
{
return this._treatMissingData != null;
}
///
/// Gets and sets the property Unit.
///
/// The unit of the metric associated with the alarm.
///
///
public MetricUnit Unit
{
get { return this._unit; }
set { this._unit = value; }
}
// Check to see if Unit property is set
internal bool IsSetUnit()
{
return this._unit != null;
}
}
}