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


Python ApiCli.get_arguments方法代码示例

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


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

示例1: get_arguments

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

        if self.args.file is not None:
            self._file = self.args.path

        self.path = 'v1/relays/{0}/config'.format(self._meter)
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:9,代码来源:relay_set_config.py

示例2: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)

        # Get the host group name
        if self.args.host_group_name is not None:
            self.host_group_name = self.args.host_group_name

        # Get the list of sources separated by commas
        if self.args.sources is not None:
            self.sources = self.args.sources

        payload = {}
        if self.host_group_name is not None:
            payload['name'] = self.host_group_name

        if self.sources is not None:
            source_list = str.split(self.sources, ',')
            if 'hostnames' not in payload:
                payload['hostnames'] = []

            for s in source_list:
                payload['hostnames'].append(s)
        self.data = json.dumps(payload, sort_keys=True)
        self.headers = {'Content-Type': 'application/json', "Accept": "application/json"}
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:29,代码来源:hostgroup_modify.py

示例3: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
 def get_arguments(self):
     """
     Extracts the specific arguments of this CLI
     """
     ApiCli.get_arguments(self)
     if self.args.pluginName is not None:
         self.pluginName = self.args.pluginName
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:9,代码来源:plugin_base.py

示例4: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.metricName is not None:
            self.metricName = self.args.metricName

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

        if self.args.source is not None:
            self.source = self.args.source
        else:
            self.source = socket.gethostname()

        if self.args.timestamp is not None:
            self.timestamp = int(self.args.timestamp)

        m = {'metric': self.metricName,
             'measure': self.measurement}

        if self.source is not None:
            m['source'] = self.source
        if self.timestamp is not None:
            m['timestamp'] = int(self.timestamp)

        self._process_properties()

        if self._properties is not None:
            m['metadata'] = self._properties

        self.data = json.dumps(m, sort_keys=True)
        self.headers = {'Content-Type': 'application/json', "Accept": "application/json"}
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:36,代码来源:measurement_create.py

示例5: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
 def get_arguments(self):
     """
     Extracts the specific arguments of this CLI
     """
     ApiCli.get_arguments(self)
     if self.args.hostGroupName is not None:
         self.url_parameters = {"name": self.args.hostGroupName}
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:9,代码来源:hostgroup_search.py

示例6: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.hostGroupId is not None:
            self.hostGroupId = self.args.hostGroupId

        self.path = "v1/hostgroup/{0}".format(str(self.hostGroupId))
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:hostgroup_get.py

示例7: get_arguments

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

        if self.args.control is not None:
            self._control = self.args.control
        if self.args.metrics is not None:
            self._metrics = self.args.metrics
        if self.args.plugins is not None:
            self._plugins = self.args.plugins
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:relay_list.py

示例8: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.pluginName is not None:
            self.pluginName = self.args.pluginName

        self.path = "v1/plugins/{0}/components".format(self.pluginName)
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:plugin_get_components.py

示例9: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.metric_name is not None:
            self._metric_name = self.args.metric_name

        self.path = "v1/metrics/{0}".format(self._metric_name)
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:metric_delete.py

示例10: get_arguments

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

        self._meter = self.args.meter if self.args.meter is not None else None
        self._since = self.args.since if self.args.since is not None else None
        self._raw = self.args.raw if self.args.raw is not None else None

        self.method = 'GET'
        self.path = 'v1/relays/{0}/output/{1}'.format(self._meter, self._since)
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:11,代码来源:relay_get_output.py

示例11: get_arguments

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

        if self.args.file_path is None:
            self.file_path = 'plugin.json'
        else:
            self.file_path = self.args.file_path

        self.path = "v1/metrics"

        self.load()
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:13,代码来源:metric_markdown.py

示例12: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)

        if self.args.tenant_id is not None:
            self._tenant_id = self.args.tenant_id

        if self.args.fingerprint_fields is not None:
            self._fingerprint_fields = self.args.fingerprint_fields

        if self.args.title is not None:
            self._title = self.args.title

        if self.args.source is not None:
            self._source = self.args.source

        if self.args.severity is not None:
            self._severity = self.args.severity

        if self.args.message is not None:
            self._message = self.args.message

        event = {}

        if self._title is not None:
            event['title'] = self._title

        if self._severity is not None:
            event['severity'] = self._severity

        if self._message is not None:
            event['message'] = self._message

        if self._source is not None:
            if 'source' not in event:
                event['source'] = {}
            if len(self._source) >= 1:
                event['source']['ref'] = self._source[0]
            if len(self._source) >= 2:
                event['source']['type'] = self._source[1]

        self._process_properties(self.args.properties)
        if self._properties is not None:
            event['properties'] = self._properties

        if self._fingerprint_fields is not None:
            event['fingerprintFields'] = self._fingerprint_fields

        self.data = json.dumps(event, sort_keys=True)
        self.headers = {'Content-Type': 'application/json'}
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:54,代码来源:event_create.py

示例13: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.hostGroupId is not None:
            self.hostGroupId = self.args.hostGroupId
        if self.args.force is not None:
            self.force = self.args.force

        if self.force:
            self.url_parameters = {"forceRemove": True}

        self.path = "v1/hostgroups/{0}".format(str(self.hostGroupId))
开发者ID:jdgwartney,项目名称:pulse-api-cli,代码行数:16,代码来源:hostgroup_delete.py

示例14: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)
        if self.args.metric_name is not None:
            self._metric_name = self.args.metric_name

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

        if self.args.source is not None:
            self.source = self.args.source
        else:
            self.source = None

        if self.args.aggregate is not None:
            self.aggregate = self.args.aggregate
        else:
            self.aggregate = "avg"

        if self.args.format is not None:
            self.format = self.args.format
        else:
            self.format = "json"

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

        start_time = int(self.parse_time_date(self.args.start).strftime("%s"))

        # If the end time is not specified then
        # default to the current time
        if self.args.end is None:
            stop_time = int(self.now.strftime("%s"))
        else:
            stop_time = int(self.parse_time_date(self.args.end).strftime("%s"))

        # Convert to epoch time in milli-seconds
        start_time *= 1000
        stop_time *= 1000

        self.path = "v1/measurements/{0}".format(self._metric_name)
        url_parameters = {"start": str(start_time),
                          "end": str(stop_time),
                          "sample": str(self.sample),
                          "agg": self.aggregate}
        if self.source is not None:
            url_parameters['source'] = self.source
        self.url_parameters = url_parameters
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:52,代码来源:measurement_get.py

示例15: get_arguments

# 需要导入模块: from boundary import ApiCli [as 别名]
# 或者: from boundary.ApiCli import get_arguments [as 别名]
    def get_arguments(self):
        """
        Extracts the specific arguments of this CLI
        """
        ApiCli.get_arguments(self)

        self._actions = self.args.actions if self.args.actions is not None else None
        self._alarm_name = self.args.alarm_name if self.args.alarm_name is not None else None

        self._metric = self.args.metric if self.args.metric is not None else None
        self._aggregate = self.args.aggregate if self.args.aggregate is not None else None
        self._operation = self.args.operation if self.args.operation is not None else None
        self._threshold = self.args.threshold if self.args.threshold is not None else None
        self._trigger_interval = self.args.trigger_interval if self.args.trigger_interval is not None else None
        self._host_group_id = self.args.host_group_id if self.args.host_group_id is not None else None
        self._note = self.args.note if self.args.note is not None else None
        self._per_host_notify = self.args.per_host_notify if self.args.per_host_notify is not None else None
        self._is_disabled = self.args.is_disabled if self.args.is_disabled is not None else None
        self._notify_clear = self.args.notify_clear if self.args.notify_clear is not None else None
        self._notify_set = self.args.notify_set if self.args.notify_set is not None else None
        self._timeout_interval = self.args.timeout_interval if self.args.timeout_interval is not None else None
开发者ID:boundary,项目名称:pulse-api-cli,代码行数:23,代码来源:alarm_modify.py


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