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


Python ApiCli.addArguments方法代码示例

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


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

示例1: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        ApiCli.addArguments(self)

        self.parser.add_argument('-n', '--host-group-name', dest='hostGroupName', action='store', required=True,
                                 metavar="host_group_name", help='Host group name')
        self.parser.add_argument('-s', '--sources', dest='sources', action='store', required=True, metavar='sources',
                                 help='Comma separated sources to add to the host group. If empty adds all hosts.')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:9,代码来源:host_group_modify.py

示例2: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        ApiCli.addArguments(self)
        self.parser.add_argument('-b', '--status', dest='status', action='store',
                                 choices=[])
        self.parser.add_argument('-v', '--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='aggregate', help='Metric aggregate to alarm upon')
        self.parser.add_argument('-o', '--organization-id', dest='organization_id', action='store',
                                 metavar='organization_id', help='Boundary account Id')
        #
        self.parser.add_argument('-p', '--properties', dest='properties', action='store')
        # self.parser.add_argument('-v', '--trigger-threshold', dest='triggerThreshold', action='store',
        # metavar='value',
        #                          help='Trigger threshold value')
        # self.parser.add_argument('-r', '--sender', dest='triggerInterval', action='store',
        #                          metavar='interval', help='Optional information about the sender of the event. \
        #                          This is used to describe a third party event system forwarding this event into \
        #                          Boundary, or a Boundary service sending the event.')
        # self.parser.add_argument('-i', '--host-group-id', dest='hostGroupId', action='store', metavar='hostgroup_id',
        #                          help='Host group the alarm applies to')
        self.parser.add_argument('-s', '--source', dest='source', action='store', metavar='ref:type:name:properties',
                                 type=string_to_dict, 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:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:31,代码来源:event_create.py

示例3: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        """
        """
        ApiCli.addArguments(self)

        # Make these options mutually exclusive where by the user
        # can only specify fetching of an alarm definition by id or name
        group = self.parser.add_mutually_exclusive_group()

        group.add_argument('-i', '--alarm-id', dest='alarmId', action='store',
                                 metavar='alarm-id', help='Alarm identifier')
        group.add_argument('-n', '--alarm-name', dest='alarmName', action='store',
                                 metavar='alarm-name', help='Alarm name')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:15,代码来源:alarm_get.py

示例4: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        ApiCli.addArguments(self)
        self.parser.add_argument('-m', '--metric', dest='metric_name', action='store',
                                 required=(False if self.update else 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='interval', action='store',
                                 required=(False if self.update else True),
                                 choices=['1 second', '15 seconds', '1 minute', '5 minutes', '1 hour', '1.5 hours',
                                          '3 hours', '6 hours', '12 hours'],
                                 help='Interval to alarm upon')

        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('-c', '--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('-p', '--per-host-notify', dest='per_host_notify', action='store',
                                 default=None, choices=['yes', 'no'],
                                 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=['yes', 'no'], help='Enable or disable the alarm definition')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:45,代码来源:alarm_modify.py

示例5: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        """
        Add specific command line arguments for this command   
        """

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

        # Command specific arguments
        self.parser.add_argument('-n', '--name', dest='metricName', action='store', required=True,
                                 metavar="metric_name", help='Metric identifier')
        self.parser.add_argument('-g', '--aggregate', dest='aggregate', action='store',
                                 choices=['sum', 'avg', 'max', 'min'], metavar='aggregate',
                                 help='Metric default aggregate')
        self.parser.add_argument('-s', '--source', dest='source', action='store', metavar="source",
                                 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",
                                 help='End of time range as ISO 8601 string or epoch seconds')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:22,代码来源:measurement_get.py

示例6: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     ApiCli.addArguments(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",
         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 Boundary",
     )
开发者ID:wcainboundary,项目名称:boundary-api-cli,代码行数:39,代码来源:measurement_create.py

示例7: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        ApiCli.addArguments(self)

        self.parser.add_argument('-n', '--plugin-Name', dest='plugin_name', action='store', metavar='plugin_name',
                                 required=True, help='Plugin name')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:7,代码来源:plugin_get.py

示例8: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     """
     """
     ApiCli.addArguments(self)
     self.parser.add_argument('-i', '--alarm-id', dest='alarmId', action='store',
                              required=True, metavar='alarm-id', help='Alarm identifier')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:8,代码来源:alarm_delete.py

示例9: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     """
     """
     ApiCli.addArguments(self)
     self.parser.add_argument('-i', '--host-group-id', dest='hostGroupId', action='store', required=True,
                              metavar="host_group_id", help='Host group id')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:8,代码来源:host_group_get.py

示例10: addArguments

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

示例11: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     ApiCli.addArguments(self)
     self.parser.add_argument('-n', '--metric-name', dest='metricName',action='store',required=True,metavar='metric_name',help='Metric identifier')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:5,代码来源:metric_ref.py

示例12: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     ApiCli.addArguments(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:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:8,代码来源:host_group_delete.py

示例13: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
 def addArguments(self):
     ApiCli.addArguments(self)
     self.parser.add_argument('-s', '--sources', dest='sources', metavar='source1[,source2]',
                              action='store', required=True, help='List of sources to delete')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:6,代码来源:source_delete.py

示例14: addArguments

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

示例15: addArguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import addArguments [as 别名]
    def addArguments(self):
        ApiCli.addArguments(self)

        self.parser.add_argument('-i', '--event-id', dest='event_id', action='store', required=True,
                                 metavar='event_id', help='Host group the alarm applies to')
开发者ID:GabrielNicolasAvellaneda,项目名称:boundary-api-cli,代码行数:7,代码来源:event_get.py


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