当前位置: 首页>>代码示例>>Python>>正文


Python ApiCli.add_arguments方法代码示例

本文整理汇总了Python中boundary.ApiCli.add_arguments方法的典型用法代码示例。如果您正苦于以下问题:Python ApiCli.add_arguments方法的具体用法?Python ApiCli.add_arguments怎么用?Python ApiCli.add_arguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boundary.ApiCli的用法示例。


在下文中一共展示了ApiCli.add_arguments方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:9,代码来源:relay_set_config.py

示例2: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:9,代码来源:alarm_get.py

示例3: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:30,代码来源:measurement_get.py

示例4: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:relay_list.py

示例5: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:relay_toggle.py

示例6: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:12,代码来源:relay_get_output.py

示例7: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:57,代码来源:alarm_modify.py

示例8: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:16,代码来源:measurement_create.py

示例9: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:23,代码来源:event_create.py

示例10: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:6,代码来源:plugin_get_components.py

示例11: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 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')
开发者ID:jdgwartney,项目名称:pulse-api-cli,代码行数:8,代码来源:hostgroup_delete.py

示例12: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:6,代码来源:source_delete.py

示例13: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:6,代码来源:measurement_plot.py

示例14: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
    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')
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:7,代码来源:event_get.py

示例15: add_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import add_arguments [as 别名]
 def add_arguments(self):
     ApiCli.add_arguments(self)
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:4,代码来源:event_list.py


注:本文中的boundary.ApiCli.add_arguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。