X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fplugins%2FCloudWatch%2Fmetric_alarms.py;h=7b03f731d2d46fa01977de99c0bff75de2fe36eb;hb=refs%2Fchanges%2F60%2F6060%2F4;hp=d8b371553172187d3a16cccd61cb2c35a0aea355;hpb=75512477988ae5e287433c6c859c61de1bc82318;p=osm%2FMON.git diff --git a/osm_mon/plugins/CloudWatch/metric_alarms.py b/osm_mon/plugins/CloudWatch/metric_alarms.py index d8b3715..7b03f73 100644 --- a/osm_mon/plugins/CloudWatch/metric_alarms.py +++ b/osm_mon/plugins/CloudWatch/metric_alarms.py @@ -24,16 +24,7 @@ __author__ = "Wajeeha Hamid" __date__ = "18-September-2017" -import sys -import os -import re -import datetime -import random -import json import logging -from random import randint -from operator import itemgetter -from connection import Connection log = logging.getLogger(__name__) @@ -67,7 +58,7 @@ class MetricAlarm(): self.del_resp = dict() def config_alarm(self,cloudwatch_conn,create_info): - """Configure or Create a new alarm""" + """Configure or Create a new alarm""" inner_dict = dict() """ Alarm Name to ID Mapping """ alarm_info = create_info['alarm_create_request'] @@ -128,7 +119,7 @@ class MetricAlarm(): #----------------------------------------------------------------------------------------------------------------------------- def update_alarm(self,cloudwatch_conn,update_info): - """Update or reconfigure an alarm""" + """Update or reconfigure an alarm""" inner_dict = dict() alarm_info = update_info['alarm_update_request'] @@ -188,7 +179,7 @@ class MetricAlarm(): #----------------------------------------------------------------------------------------------------------------------------- def delete_Alarm(self,cloudwatch_conn,del_info_all): - """Deletes an Alarm with specified alarm_id""" + """Deletes an Alarm with specified alarm_id""" inner_dict = dict() del_info = del_info_all['alarm_delete_request'] status = self.is_present(cloudwatch_conn,del_info['alarm_uuid']) @@ -261,7 +252,7 @@ class MetricAlarm(): #----------------------------------------------------------------------------------------------------------------------------- def alarm_details(self,cloudwatch_conn,ack_info): - """Get an individual alarm details specified by alarm_name""" + """Get an individual alarm details specified by alarm_name""" try: alarms_details=cloudwatch_conn.describe_alarm_history() alarm_details_all = dict() @@ -306,10 +297,10 @@ class MetricAlarm(): return alarm_details_dict except Exception as e: - log.error("Error getting alarm details: %s",str(e)) + log.error("Error getting alarm details: %s",str(e)) #----------------------------------------------------------------------------------------------------------------------------- def is_present(self,cloudwatch_conn,alarm_id): - """Finding alarm from already configured alarms""" + """Finding alarm from already configured alarms""" alarm_info = dict() try: alarms = cloudwatch_conn.describe_alarms()