コード例 #1
0
class DashboardApiClient(object):

    def __init__(self, config):
        self.device_api_client = DeviceApiClient(config)
        self.alert_api_client = AlertApiClient(config)
        self.rules_api_client = RulesApiClient(config)

    def push_alert(self, rule, device_list, conditions):
        self.alert_api_client.push_alert(rule, device_list, conditions)

    def get_devices_with_components(self, account_id, devices_ids=None):
        return self.device_api_client.get_devices_with_components(account_id, devices_ids)

    def get_active_rules(self):
        return self.rules_api_client.get_active_rules()

    def add_rule_executions(self, rule, component_ids_with_observation, last_execution):
        return self.rules_api_client.add_rule_executions(rule, component_ids_with_observation, last_execution)
コード例 #2
0
 def __init__(self, config):
     self.device_api_client = DeviceApiClient(config)
     self.alert_api_client = AlertApiClient(config)
     self.rules_api_client = RulesApiClient(config)