Preserve Namespace and MetricName when creating cloudwatch alarm.
This commit is contained in:
parent
ae938223d4
commit
a37838b638
4 changed files with 15 additions and 6 deletions
|
|
@ -10,10 +10,12 @@ class Dimension(object):
|
|||
|
||||
|
||||
class FakeAlarm(object):
|
||||
def __init__(self, name, comparison_operator, evaluation_periods, period,
|
||||
threshold, statistic, description, dimensions, alarm_actions,
|
||||
def __init__(self, name, namespace, metric_name, comparison_operator, evaluation_periods,
|
||||
period, threshold, statistic, description, dimensions, alarm_actions,
|
||||
ok_actions, insufficient_data_actions, unit):
|
||||
self.name = name
|
||||
self.namespace = namespace
|
||||
self.metric_name = metric_name
|
||||
self.comparison_operator = comparison_operator
|
||||
self.evaluation_periods = evaluation_periods
|
||||
self.period = period
|
||||
|
|
@ -43,10 +45,10 @@ class CloudWatchBackend(BaseBackend):
|
|||
self.alarms = {}
|
||||
self.metric_data = []
|
||||
|
||||
def put_metric_alarm(self, name, comparison_operator, evaluation_periods,
|
||||
def put_metric_alarm(self, name, namespace, metric_name, comparison_operator, evaluation_periods,
|
||||
period, threshold, statistic, description, dimensions,
|
||||
alarm_actions, ok_actions, insufficient_data_actions, unit):
|
||||
alarm = FakeAlarm(name, comparison_operator, evaluation_periods, period,
|
||||
alarm = FakeAlarm(name, namespace, metric_name, comparison_operator, evaluation_periods, period,
|
||||
threshold, statistic, description, dimensions, alarm_actions,
|
||||
ok_actions, insufficient_data_actions, unit)
|
||||
self.alarms[name] = alarm
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue