Esempio n. 1
0
    def __init__(self, settings=None, **kwargs):
        logging.debug("Configuring with settings: %s" % settings)
        self.settings = settings.__dict__  # type: dict
        self.host = get_key_from_settings("TSDB_HOST", self.settings, default="defiant")
        self.port = get_key_from_settings("TSDB_PORT", self.settings, default=4242)
        self.qsize = get_key_from_settings("TSDB_QSIZE", self.settings, default=1000)
        self.mps = get_key_from_settings("TSDB_MPS", self.settings, default=100)
        self.host_tag = False
        self.check_host = True

        # connect
        self.client = potsdb.Client(self.host, port=self.port, qsize=self.qsize, host_tag=self.host_tag,
                                    mps=self.mps, check_host=self.check_host)
Esempio n. 2
0
    def __init__(self, **kwargs):
        """
        General tools plugin, invoke as any other plugin. May have dependencies to other plugins.

        :param api: the SolaceAPI instance, settings object will be used from SolaceAPI.
        :param kwargs:
        :return:
        """
        self.api = get_key_from_kwargs('api', kwargs)
        self.commands = SolaceCommandQueue(version=self.api.version)
        self.settings = self.api.settings
        self.SOLACE_QUEUE_PLUGIN = get_key_from_settings("SOLACE_QUEUE_PLUGIN", self.settings.__dict__)
        self.SOLACE_USER_PLUGIN = get_key_from_settings("SOLACE_USER_PLUGIN", self.settings.__dict__)
Esempio n. 3
0
    def __init__(self, settings=None, **kwargs):
        logging.debug("Configuring with settings: %s" % settings)
        self.settings = settings.__dict__  # type: dict
        self.influxdb_host = get_key_from_settings("INFLUXDB_HOST", self.settings, default="defiant")
        self.influxdb_port = get_key_from_settings("INFLUXDB_PORT", self.settings, default=8086)
        self.influxdb_user = get_key_from_settings("INFLUXDB_USER", self.settings, default="root")
        self.influxdb_pass = get_key_from_settings("INFLUXDB_PASS", self.settings, default="root")
        self.influxdb_db = get_key_from_settings("INFLUXDB_DB", self.settings, default="solace")

        # connect
        self.client = InfluxDBClientConnector(self.influxdb_host,
                                     self.influxdb_port,
                                     self.influxdb_user,
                                     self.influxdb_pass,
                                     self.influxdb_db)
Esempio n. 4
0
 def __init__(self, settings=None, **kwargs):
     """
     Example:
     >>> cmdbapi =
     :param settings:
     :param kwargs:
     :return:
     """
     logging.debug("Configuring with settings: %s" % settings)
     self.settings = settings.__dict__  # type: dict
     self.url = get_key_from_settings("CMDB_URL", self.settings)
Esempio n. 5
0
    def __init__(self, settings=None, **kwargs):
        """
        Example:
        import libsolace.settingsloader as settings
        import libsolace
        clazz = libsolace.plugin_registry('YAMLClient', settings=settings)
        yaml_client = clazz(settings=settings)
        yaml_client.get_vpns_by_owner("SolaceTest", environment="au")

        :param settings:
        :param kwargs:
        :return:
        """
        logging.debug("Configuring with settings: %s" % settings)
        self.settings = settings.__dict__  # type: dict
        self.file = get_key_from_settings("CMDB_FILE", self.settings)
        stream = open(self.file, 'r')
        self.data = yaml.load(stream)