Beispiel #1
0
 def get_api_parameters(self):
     AlarmModify.get_api_parameters(self)
     self.method = "PUT"
     if self._alarm_id is not None:
         self._payload['id'] = int(self._alarm_id)
     self.data = json.dumps(self._payload, sort_keys=True)
     self.path = "v2/alarms/{0}".format(self._alarm_id)
    def getArguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        AlarmModify.getArguments(self)

        self.path = 'v1/alarms'
Beispiel #3
0
 def get_api_parameters(self):
     AlarmModify.get_api_parameters(self)
     self.method = "PUT"
     if self._alarm_id is not None:
         self._payload['id'] = int(self._alarm_id)
     self.data = json.dumps(self._payload, sort_keys=True)
     self.path = "v2/alarms/{0}".format(self._alarm_id)
Beispiel #4
0
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """

        AlarmModify.get_arguments(self)
        self._alarm_id = self.args.alarm_id if self.args.alarm_id is not None else None
        self.get_api_parameters()
    def addArguments(self):

        self.parser.add_argument('-i', '--alarm-id', dest='alarm_id', action='store', required=True,
                                 metavar='alarm_id', help='Id of the alarm to update')
        self.parser.add_argument('-n', '--alarm-name', dest='alarm_name', action='store',
                                 metavar='alarm_name', help='Name of the alarm')

        AlarmModify.addArguments(self)
Beispiel #6
0
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """

        AlarmModify.get_arguments(self)
        self._alarm_id = self.args.alarm_id if self.args.alarm_id is not None else None
        self.get_api_parameters()
Beispiel #7
0
    def add_arguments(self):

        self.parser.add_argument('-n', '--alarm-name', dest='alarm_name', action='store', required=True,
                                 metavar='alarm_name', help='Name of the alarm')
        self.parser.add_argument('-y', '--alarm-type', dest='alarm_type', action='store', required=False,
                                 choices=['threshold', 'host', 'api'],
                                 help='Type of the alarm either: threshold or communication. Default threshold')

        AlarmModify.add_arguments(self)
    def getArguments(self):
        """
        Extracts the specific arguments of this CLI
        """

        AlarmModify.getArguments(self)

        if self.args.alarm_id is not None:
            self.alarm_id = self.args.alarm_id

        self.path = "v1/alarm/{0}".format(self.alarm_id)
Beispiel #9
0
    def add_arguments(self):

        self.parser.add_argument('-i',
                                 '--alarm-id',
                                 dest='alarm_id',
                                 action='store',
                                 required=True,
                                 type=int,
                                 metavar='alarm_id',
                                 help='Id of the alarm to update')
        self.parser.add_argument('-n',
                                 '--alarm-name',
                                 dest='alarm_name',
                                 action='store',
                                 metavar='alarm_name',
                                 help='Name of the alarm')

        AlarmModify.add_arguments(self)
Beispiel #10
0
 def __init__(self, **kwargs):
     AlarmModify.__init__(self, False)
     self._kwargs = kwargs
     self.method = "POST"
     self._alarm_result = None
Beispiel #11
0
 def handle_key_word_args(self):
     AlarmModify.handle_key_word_args(self)
     self._alarm_id = self._kwargs['id'] if 'id' in self._kwargs else None
Beispiel #12
0
 def __init__(self):
     AlarmModify.__init__(self, True)
     self._alarm_id = None
Beispiel #13
0
 def get_arguments(self):
     """
     Extracts the specific arguments of this CLI
     """
     AlarmModify.get_arguments(self)
    def __init__(self):
        AlarmModify.__init__(self, False)
        self.method = "POST"

        self.cli_description = "Creates a new alarm definition in an Boundary account"
    def __init__(self):
        AlarmModify.__init__(self, True)
        self.alarm_id = None
        self.method = "PUT"

        self.cli_description = "Creates a new metric definition in an Boundary account"
Beispiel #16
0
 def __init__(self):
     AlarmModify.__init__(self, True)
     self._alarm_id = None
Beispiel #17
0
 def handle_key_word_args(self):
     AlarmModify.handle_key_word_args(self)
     self._alarm_id = self._kwargs['id'] if 'id' in self._kwargs else None