コード例 #1
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument(
            '-n',
            '--name',
            metavar='meter_name',
            dest='meter',
            action='store',
            required=True,
            help='Name of the meter to get output information')

        self.parser.add_argument('-s',
                                 '--since',
                                 metavar='since',
                                 dest='since',
                                 action='store',
                                 required=False,
                                 default=1,
                                 help='Pull since items from end of log')

        self.parser.add_argument('-r',
                                 '--raw',
                                 dest='raw',
                                 action='store_true',
                                 required=False,
                                 help='Send output in raw JSON format')
コード例 #2
0
    def add_arguments(self):
        """
        Add specific command line arguments for this command   
        """

        # Call our parent to add the default arguments
        ApiCli.add_arguments(self)

        # Command specific arguments
        self.parser.add_argument('-f', '--format', dest='format', action='store', required=False,
                                 choices=['csv', 'json', 'raw', 'xml'], help='Output format. Default is raw')
        self.parser.add_argument('-n', '--name', dest='metric_name', action='store', required=True,
                                 metavar="metric_name", help='Metric identifier')
        self.parser.add_argument('-g', '--aggregate', dest='aggregate', action='store', required=False,
                                 choices=['sum', 'avg', 'max', 'min'], help='Metric default aggregate')
        self.parser.add_argument('-r', '--sample', dest='sample', action='store', type=int, metavar="sample",
                                 help='Down sample rate sample in seconds')
        self.parser.add_argument('-s', '--source', dest='source', action='store', metavar="source", required=True,
                                 help='Source of measurement')
        self.parser.add_argument('-b', '--start', dest='start', action='store', required=True, metavar="start",
                                 help='Start of time range as ISO 8601 string or epoch seconds')
        self.parser.add_argument('-d', '--end', dest='end', action='store', metavar="end", required=False,
                                 help='End of time range as ISO 8601 string or epoch seconds')

        self.parser.add_argument('-o', '--date-format', dest='date_format', action='store', metavar="format",
                                 required=False,
                                 help='For CSV, JSON, and XML output formats dates (see Python date.strftime). ' +
                                      'Default format is %%s')
コード例 #3
0
    def add_arguments(self):
        """
        """
        ApiCli.add_arguments(self)

        self.parser.add_argument('-i', '--alarm-id', dest='alarm_id', action='store', required=True,
                                 metavar='alarm-id', help='Alarm identifier')
コード例 #4
0
    def add_arguments(self):
        """
        """
        ApiCli.add_arguments(self)

        self.parser.add_argument('-f', '--file', metavar='path', dest='file', action='store', required=True,
                                 help='Name of the meter to get plugin configuration information')
コード例 #5
0
    def add_arguments(self):
        """
        """
        ApiCli.add_arguments(self)

        self.parser.add_argument('-n', '--alarm-name', dest='alarm_name', action='store', required=True,
                                 metavar='alarm-name', help='Alarm name')
コード例 #6
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n',
                              '--plugin-name',
                              dest='pluginName',
                              action='store',
                              required=True,
                              metavar="plugin_name",
                              help='Plugin name')
コード例 #7
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-s',
                              '--sources',
                              dest='sources',
                              metavar='source1[,source2]',
                              action='store',
                              required=True,
                              help='List of sources to delete')
コード例 #8
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n',
                              '--metric-name',
                              dest='metric_name',
                              action='store',
                              required=True,
                              metavar='metric_name',
                              help='Metric identifier')
コード例 #9
0
    def add_arguments(self):
        ApiCli.add_arguments(self)

        self.parser.add_argument('--no-control', dest="control", action='store_true', required=False,
                                 help='Remove control field from the output')
        self.parser.add_argument('--no-metrics', dest="metrics", action='store_true', required=False,
                                 help='Remove metric field from the output')
        self.parser.add_argument('--no-plugins', dest="plugins", action='store_true', required=False,
                                 help='Remove plugins field from the output')
コード例 #10
0
    def add_arguments(self):
        ApiCli.add_arguments(self)

        self.parser.add_argument('-d', '--disable', dest='disabled', action='store', default=None,
                                 choices=['yes', 'no'], help='Enable or disable the meter')
        self.parser.add_argument('-n', '--name', metavar='name', dest='name', action='store', required=True,
                                 help='Name of the meter to toggle')
        self.parser.add_argument('-r', '--remove', dest='remove', action='store', default=None,
                                 choices=['yes', 'no'], help='Remove the meter')
コード例 #11
0
    def add_arguments(self):
        ApiCli.add_arguments(self)

        self.parser.add_argument('-i',
                                 '--event-id',
                                 dest='event_id',
                                 action='store',
                                 required=True,
                                 metavar='event_id',
                                 help='Event id of the event to fetch')
コード例 #12
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument('-n', '--name', metavar='meter_name', dest='meter', action='store', required=True,
                                 help='Name of the meter to get output information')

        self.parser.add_argument('-s', '--since', metavar='since', dest='since', action='store', required=False,
                                 default=1, help='Pull since items from end of log')

        self.parser.add_argument('-r', '--raw', dest='raw', action='store_true', required=False,
                                 help='Send output in raw JSON format')
コード例 #13
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument(
         '-f',
         '--file-name',
         dest='file_name',
         action='store',
         required=False,
         metavar='path',
         help='File name including path of data to plot')
コード例 #14
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument(
         '-f',
         '--file',
         dest='file_path',
         action='store',
         required=False,
         metavar='path',
         help='Path to plugin.json manifest. Defaults to plugin.json')
コード例 #15
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument('-m', '--metric', dest='metric', action='store',
                                 required=True,
                                 metavar='metric_name', help='Name of the metric to alarm')

        self.parser.add_argument('-g', '--trigger-aggregate', dest='aggregate', action='store',
                                 required=(False if self._update else True),
                                 choices=['sum', 'avg', 'max', 'min'], help='Metric aggregate to alarm upon')

        self.parser.add_argument('-o', '--trigger-operation', dest='operation', action='store',
                                 required=(False if self._update else True),
                                 choices=['eq', 'gt', 'lt'], help='Trigger threshold comparison')

        self.parser.add_argument('-v', '--trigger-threshold', dest='threshold', action='store',
                                 required=(False if self._update else True),
                                 metavar='value', help='Trigger threshold value')

        self.parser.add_argument('-r', '--trigger-interval', dest='trigger_interval', action='store',
                                 metavar='trigger_interval', required=False, type=int,
                                 help='Interval of time in ms that the alarm state should be in fault ' +
                                      'before triggering')

        self.parser.add_argument('-j', '--timeout-interval', dest='timeout_interval', action='store',
                                 metavar = 'timeout_interval', required=False, type=int,
                                 help='The interval after which an individual host state should resolve by timeout. ' +
                                      'Default: 259200000 milli-seconds (3 days)')

        self.parser.add_argument('-u', '--host-group-id', dest='host_group_id', action='store', metavar='host_group_id',
                                 type=int, help='Host group the alarm applies to')

        self.parser.add_argument('-d', '--note', dest='note', action='store', metavar='note',
                                 help='A description or resolution of the alarm')

        self.parser.add_argument('-k', '--action', dest='actions', action='append', metavar='action-id', type=int,
                                 help='An action to be performed when an alarm is triggered')

        self.parser.add_argument('-c', '--notify-clear', dest='notify_clear', action='store', default=None,
                                 choices=['true', 'false'],
                                 help='Perform actions when all hosts')

        self.parser.add_argument('-s', '--notify-set', dest='notify_set', action='store', default=None,
                                 choices=['true', 'false'],
                                 help='Perform actions when an alarm threshold and interval is breached.')

        self.parser.add_argument('-p', '--per-host-notify', dest='per_host_notify', action='store',
                                 default=None, choices=['true', 'false'],
                                 help='An alarm by default will run the associated actions when \
                                 any server in the host group violates the threshold, and then at the end when \
                                 all servers are back within the threshold. If perHostNotify is set to true, \
                                 the actions will run when ANY server in the group violates \
                                 and falls back within the threshold.')

        self.parser.add_argument('-x', '--is-disabled', dest='is_disabled', action='store', default=None,
                                 choices=['true', 'false'], help='Enable or disable the alarm definition')
コード例 #16
0
 def add_arguments(self):
     """
     """
     ApiCli.add_arguments(self)
     self.parser.add_argument('-i',
                              '--host-group-id',
                              dest='hostGroupId',
                              action='store',
                              required=True,
                              metavar="host_group_id",
                              help='Host group id')
コード例 #17
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument(
            '-b',
            '--status',
            dest='status',
            action='store',
            choices=['acknowledged', 'closed', 'ok', 'open'])
        self.parser.add_argument('-r',
                                 '--severity',
                                 dest='severity',
                                 action='store',
                                 choices=['info', 'warn', 'error', 'critical'],
                                 help='Severity of the the event')
        self.parser.add_argument('-m',
                                 '--message',
                                 dest='message',
                                 action='store',
                                 metavar='message',
                                 help='Text describing the event')
        self.parser.add_argument(
            '-f',
            '--fingerprint-fields',
            dest='fingerprint_fields',
            action='store',
            required=True,
            type=split_string,
            metavar='field_list',
            help='List of fields that make up the fingerprint')
        self.parser.add_argument('-o',
                                 '--tenant-id',
                                 dest='tenant_id',
                                 action='store',
                                 metavar='tenant_id',
                                 help='Tenant Id')
        # Use the mixin to add argument to handle properties
        self._add_property_argument(self.parser, 'Add properties to an event')
        self.parser.add_argument(
            '-s',
            '--source',
            dest='source',
            action='store',
            metavar='ref:type:name:properties',
            type=split_string,
            help='A description or resolution of the alarm')

        self.parser.add_argument('-w',
                                 '--title',
                                 dest='title',
                                 metavar='title',
                                 action='store',
                                 required=True,
                                 help='Title of the event')
コード例 #18
0
    def add_arguments(self):
        """
        """
        ApiCli.add_arguments(self)

        self.parser.add_argument(
            '-f',
            '--file',
            metavar='path',
            dest='file',
            action='store',
            required=True,
            help='Name of the meter to get plugin configuration information')
コード例 #19
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n', '--metric-name', dest='metricName', action='store', required=True,
                              metavar='metric_name', help='Metric identifier')
     self.parser.add_argument('-m', '--measurement', dest='measurement', action='store', required=True,
                              metavar="measurement", help='Measurement value')
     self.parser.add_argument('-s', '--source', dest='source', action='store', required=False, metavar="source",
                              help='Source of measurement. Defaults to the host where the command is run')
     self.parser.add_argument('-d', '--timestamp', dest='timestamp', action='store', metavar="timestamp",
                              help='Time of occurrence of the measurement in either epoch seconds or \
                              epoch milliseconds. Defaults to the receipt time at api endpoint')
     self.parser.add_argument('-p', '--property', dest='properties', action='append', required=False,
                              metavar='property=value',
                              help='Property to add to the measurement')
コード例 #20
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-i',
                              '--host-group-id',
                              dest='hostGroupId',
                              metavar='host_group_id',
                              action='store',
                              required=True,
                              help='Host group id to delete')
     self.parser.add_argument(
         '-f',
         '--force',
         dest='force',
         action='store_true',
         help='Remove the host group, even if in use by a dashboard or alarm'
     )
コード例 #21
0
    def add_arguments(self):

        ApiCli.add_arguments(self)

        self.parser.add_argument(
            '-m',
            '--metric-manifest-path',
            dest='metric_manifest_path',
            action='store',
            required=False,
            metavar='path',
            default=None,
            help='Path to metrics.json manifest. Defaults to metrics.json')

        self.parser.add_argument(
            '-p',
            '--plugin-manifest-path',
            dest='plugin_manifest_path',
            action='store',
            required=False,
            metavar='path',
            default=None,
            help='Path to plugin.json manifest. Defaults to plugin.json')

        self.parser.add_argument(
            '-o',
            '--readme-path',
            dest='readme_path',
            action='store',
            required=False,
            metavar='path',
            default=None,
            help='Path to README.md manifest. Defaults to standard out')

        self.parser.add_argument(
            '-r',
            '--readme-template-path',
            dest='readme_template_path',
            action='store',
            required=False,
            metavar='path',
            default=None,
            help='Path to README.md template. Defaults to internal template')
コード例 #22
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument('-b', '--status', dest='status', action='store',
                                 choices=['acknowledged', 'closed', 'ok', 'open'])
        self.parser.add_argument('-r', '--severity', dest='severity', action='store',
                                 choices=['info', 'warn', 'error', 'critical'],
                                 help='Severity of the the event')
        self.parser.add_argument('-m', '--message', dest='message', action='store',
                                 metavar='message', help='Text describing the event')
        self.parser.add_argument('-f', '--fingerprint-fields', dest='fingerprint_fields', action='store',
                                 required=True, type=split_string, metavar='field_list',
                                 help='List of fields that make up the fingerprint')
        self.parser.add_argument('-o', '--tenant-id', dest='tenant_id', action='store',
                                 metavar='tenant_id', help='Tenant Id')
        # Use the mixin to add argument to handle properties
        self._add_property_argument(self.parser, 'Add properties to an event')
        self.parser.add_argument('-s', '--source', dest='source', action='store', metavar='ref:type:name:properties',
                                 type=split_string, help='A description or resolution of the alarm')

        self.parser.add_argument('-w', '--title', dest='title', metavar='title', action='store', required=True,
                                 help='Title of the event')
コード例 #23
0
    def add_arguments(self):
        """
        """
        ApiCli.add_arguments(self)
        self.parser.add_argument(
            '-n',
            '--name',
            metavar='meter_name',
            dest='meter',
            action='store',
            required=True,
            help='Name of the meter to set plugin configuration information')

        self.parser.add_argument(
            '-s',
            '--since',
            metavar='timestamp',
            dest='since',
            action='store',
            required=False,
            help='Unix timestamp of when configuration was last checked. ' +
            'If configuration has not changed, null is returned.')
コード例 #24
0
    def add_arguments(self):
        ApiCli.add_arguments(self)

        self.parser.add_argument('-d',
                                 '--disable',
                                 dest='disabled',
                                 action='store',
                                 default=None,
                                 choices=['yes', 'no'],
                                 help='Enable or disable the meter')
        self.parser.add_argument('-n',
                                 '--name',
                                 metavar='name',
                                 dest='name',
                                 action='store',
                                 required=True,
                                 help='Name of the meter to toggle')
        self.parser.add_argument('-r',
                                 '--remove',
                                 dest='remove',
                                 action='store',
                                 default=None,
                                 choices=['yes', 'no'],
                                 help='Remove the meter')
コード例 #25
0
 def add_arguments(self):
     """
     """
     ApiCli.add_arguments(self)
     self.parser.add_argument('-i', '--host-group-id', dest='hostGroupId', action='store', required=True,
                              metavar="host_group_id", help='Host group id')
コード例 #26
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n', '--host-group-name', dest='hostGroupName', metavar="host_group_name",
                              action='store', required=True,help='Host group name')
コード例 #27
0
ファイル: event_list.py プロジェクト: boundary/pulse-api-cli
 def add_arguments(self):
     ApiCli.add_arguments(self)
コード例 #28
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-s', '--sources', dest='sources', metavar='source1[,source2]',
                              action='store', required=True, help='List of sources to delete')
コード例 #29
0
ファイル: event_get.py プロジェクト: boundary/pulse-api-cli
    def add_arguments(self):
        ApiCli.add_arguments(self)

        self.parser.add_argument('-i', '--event-id', dest='event_id', action='store', required=True,
                                 metavar='event_id', help='Event id of the event to fetch')
コード例 #30
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n', '--plugin-Name', dest='pluginName', action='store', metavar='plugin_name',
                              required=True, help='Plugin name')
コード例 #31
0
    def add_arguments(self):
        """
        Add specific command line arguments for this command   
        """

        # Call our parent to add the default arguments
        ApiCli.add_arguments(self)

        # Command specific arguments
        self.parser.add_argument('-f',
                                 '--format',
                                 dest='format',
                                 action='store',
                                 required=False,
                                 choices=['csv', 'json', 'raw', 'xml'],
                                 help='Output format. Default is raw')
        self.parser.add_argument('-n',
                                 '--name',
                                 dest='metric_name',
                                 action='store',
                                 required=True,
                                 metavar="metric_name",
                                 help='Metric identifier')
        self.parser.add_argument('-g',
                                 '--aggregate',
                                 dest='aggregate',
                                 action='store',
                                 required=False,
                                 choices=['sum', 'avg', 'max', 'min'],
                                 help='Metric default aggregate')
        self.parser.add_argument('-r',
                                 '--sample',
                                 dest='sample',
                                 action='store',
                                 type=int,
                                 metavar="sample",
                                 help='Down sample rate sample in seconds')
        self.parser.add_argument('-s',
                                 '--source',
                                 dest='source',
                                 action='store',
                                 metavar="source",
                                 required=True,
                                 help='Source of measurement')
        self.parser.add_argument(
            '-b',
            '--start',
            dest='start',
            action='store',
            required=True,
            metavar="start",
            help='Start of time range as ISO 8601 string or epoch seconds')
        self.parser.add_argument(
            '-d',
            '--end',
            dest='end',
            action='store',
            metavar="end",
            required=False,
            help='End of time range as ISO 8601 string or epoch seconds')

        self.parser.add_argument(
            '-o',
            '--date-format',
            dest='date_format',
            action='store',
            metavar="format",
            required=False,
            help=
            'For CSV, JSON, and XML output formats dates (see Python date.strftime). '
            + 'Default format is %%s')
コード例 #32
0
    def add_arguments(self):
        ApiCli.add_arguments(self)
        self.parser.add_argument('-m',
                                 '--metric',
                                 dest='metric',
                                 action='store',
                                 required=True,
                                 metavar='metric_name',
                                 help='Name of the metric to alarm')

        self.parser.add_argument('-g',
                                 '--trigger-aggregate',
                                 dest='aggregate',
                                 action='store',
                                 required=(False if self._update else True),
                                 choices=['sum', 'avg', 'max', 'min'],
                                 help='Metric aggregate to alarm upon')

        self.parser.add_argument('-o',
                                 '--trigger-operation',
                                 dest='operation',
                                 action='store',
                                 required=(False if self._update else True),
                                 choices=['eq', 'gt', 'lt'],
                                 help='Trigger threshold comparison')

        self.parser.add_argument('-v',
                                 '--trigger-threshold',
                                 dest='threshold',
                                 action='store',
                                 required=(False if self._update else True),
                                 metavar='value',
                                 help='Trigger threshold value')

        self.parser.add_argument(
            '-r',
            '--trigger-interval',
            dest='trigger_interval',
            action='store',
            metavar='trigger_interval',
            required=False,
            type=int,
            help=
            'Interval of time in ms that the alarm state should be in fault ' +
            'before triggering')

        self.parser.add_argument(
            '-j',
            '--timeout-interval',
            dest='timeout_interval',
            action='store',
            metavar='timeout_interval',
            required=False,
            type=int,
            help=
            'The interval after which an individual host state should resolve by timeout. '
            + 'Default: 259200000 milli-seconds (3 days)')

        self.parser.add_argument('-u',
                                 '--host-group-id',
                                 dest='host_group_id',
                                 action='store',
                                 metavar='host_group_id',
                                 type=int,
                                 help='Host group the alarm applies to')

        self.parser.add_argument(
            '-d',
            '--note',
            dest='note',
            action='store',
            metavar='note',
            help='A description or resolution of the alarm')

        self.parser.add_argument(
            '-k',
            '--action',
            dest='actions',
            action='append',
            metavar='action-id',
            type=int,
            help='An action to be performed when an alarm is triggered')

        self.parser.add_argument('-c',
                                 '--notify-clear',
                                 dest='notify_clear',
                                 action='store',
                                 default=None,
                                 choices=['true', 'false'],
                                 help='Perform actions when all hosts')

        self.parser.add_argument(
            '-s',
            '--notify-set',
            dest='notify_set',
            action='store',
            default=None,
            choices=['true', 'false'],
            help=
            'Perform actions when an alarm threshold and interval is breached.'
        )

        self.parser.add_argument(
            '-p',
            '--per-host-notify',
            dest='per_host_notify',
            action='store',
            default=None,
            choices=['true', 'false'],
            help='An alarm by default will run the associated actions when \
                                 any server in the host group violates the threshold, and then at the end when \
                                 all servers are back within the threshold. If perHostNotify is set to true, \
                                 the actions will run when ANY server in the group violates \
                                 and falls back within the threshold.')

        self.parser.add_argument('-x',
                                 '--is-disabled',
                                 dest='is_disabled',
                                 action='store',
                                 default=None,
                                 choices=['true', 'false'],
                                 help='Enable or disable the alarm definition')
コード例 #33
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-n', '--metric-name', dest='metric_name', action='store', required=True,
                              metavar='metric_name', help='Metric identifier')
コード例 #34
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-i', '--host-group-id', dest='hostGroupId', metavar='host_group_id',
                              action='store', required=True, help='Host group id to delete')
     self.parser.add_argument('-f', '--force', dest='force', action='store_true',
                              help='Remove the host group, even if in use by a dashboard or alarm')
コード例 #35
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
コード例 #36
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-f', '--file-name', dest='file_name', action='store', required=False, metavar='path',
                              help='File name including path of data to plot')
コード例 #37
0
 def add_arguments(self):
     ApiCli.add_arguments(self)
     self.parser.add_argument('-f', '--file', dest='file_path', action='store', required=False, metavar='path',
                              help='Path to plugin.json manifest. Defaults to plugin.json')