o ckF[Xã@s,ddlmZddlmZGdd„deƒZdS)é)Ú MetricAlarm)Ú Dimensionc@sfeZdZgd¢Zgd¢Zddd„Zdd„Zdd „Zd d „Zdd d„Z   ddd„Z  ddd„Z dS)ÚMetric)ÚMinimumÚMaximumÚSumÚAverageÚ SampleCount)ÚSecondsÚ MicrosecondsÚ MillisecondsÚBytesÚ KilobytesÚ MegabytesÚ GigabytesÚ TerabytesÚBitsÚKilobitsÚMegabitsÚGigabitsÚTerabitsÚPercentÚCountz Bytes/SecondzKilobytes/SecondzMegabytes/SecondzGigabytes/SecondzTerabytes/Secondz Bits/SecondzKilobits/SecondzMegabits/SecondzGigabits/SecondzTerabits/Secondz Count/SecondNNcCs||_d|_d|_d|_dS©N)Ú connectionÚnameÚ namespaceÚ dimensions)Úselfr©rús "ùz Metric.queryTcCsH| s|j} t|j||j|j|||||| || | | | ƒ}|j |¡r"|SdS)a‚ Creates or updates an alarm and associates it with this metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm. When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is evaluated and its StateValue is set appropriately. Any actions associated with the StateValue is then executed. When updating an existing alarm, its StateValue is left unchanged. :type alarm: boto.ec2.cloudwatch.alarm.MetricAlarm :param alarm: MetricAlarm object. N)rrrrrÚput_metric_alarm)rrÚ comparisonÚ thresholdr3Úevaluation_periodsÚ statisticÚenabledÚ descriptionrÚ alarm_actionsÚ ok_actionsÚinsufficient_data_actionsr2Úalarmrrr Ú create_alarmks û ÿzMetric.create_alarmcCs|j |j|j||||¡S)aV Retrieves all alarms for this metric. Specify a statistic, period, or unit to filter the set of alarms further. :type period: int :param period: The period in seconds over which the statistic is applied. :type statistic: string :param statistic: The statistic for the metric. :type dimensions: dict :param dimension: A dictionary containing name/value pairs that will be used to filter the results. The key in the dictionary is the name of a Dimension. The value in the dictionary is either a scalar value of that Dimension name that you want to filter on, a list of values to filter on or None if you want all metrics with that Dimension name. :type unit: string :rtype list )rÚdescribe_alarms_for_metricrr)rr3r9rr2rrr Údescribe_alarmsŠs ûzMetric.describe_alarmsr)Nr+)TNNNNNN)NNNN) Ú__name__Ú __module__Ú __qualname__Ú StatisticsÚUnitsr!r"r%r*r4r@rBrrrr rs  / üÿrN)Úboto.ec2.cloudwatch.alarmrÚboto.ec2.cloudwatch.dimensionrÚobjectrrrrr Ús