def checkConfiguration(config): checkType('config', (dict, ), config) checkIPv4('listenIP', checkAttr('listenIP', config)) checkPort('listenPort', checkAttr('listenPort', config)) transport = checkAttr('transport', config) checkOptions('transport', transport, ['udp', 'tcp']) if (transport != 'udp'): raise Exception('Transport(%s) not implemented' % str(transport))
def checkConfiguration(config): checkType('config', (dict,), config) checkIPv4('localIP', checkAttr('localIP', config)) checkIPv4('serverIP', checkAttr('serverIP', config)) checkPort('serverPort', checkAttr('serverPort', config)) transport = checkAttr('transport', config) checkOptions('transport', transport, ['udp', 'tcp']) if(transport != 'udp'): raise Exception('Transport(%s) not implemented' % str(transport)) checkFloat('templateRefreshTimeout', checkAttr('templateRefreshTimeout', config), 1, 86400)
def add(self, exporterId, serverIP, serverPort): checkInteger('exporterId', exporterId, 0) checkIPv4('serverIP', serverIP) checkPort('serverPort', serverPort) if (exporterId in self.__exporters): raise Exception('Exporter(%d) already exists' % (exporterId)) exporterConfig = copy.deepcopy(self.__configTemplate) exporterConfig.update({'serverIP': serverIP, 'serverPort': serverPort}) session = Session() exporter = Exporter(session) exporter.configure(exporterConfig) exporter.start() self.__exporters[exporterId] = exporter
def reconfigure(self, serverIP, serverPort): checkIPv4('serverIP', serverIP) checkPort('serverPort', serverPort) self.__serverIP = serverIP self.__serverPort = serverPort if(not self.__configured): return for obsDomId in self.__session.getDomainIds(): domain = self.__session.getDomain(obsDomId) domain.getExporterSequentiation().reset() if(not self.__running): return self.stop() self.start()
def checkConfiguration(config): checkType('config', (dict, ), config) if (('localIP' in config) and (config['localIP'] is not None)): checkIPv4('localIP', config['localIP']) if (('serverIP' in config) and (config['serverIP'] is not None)): checkIPv4('serverIP', config['serverIP']) if (('serverPort' in config) and (config['serverPort'] is not None)): checkPort('serverPort', config['serverPort']) if (('transport' in config) and (config['transport'] is not None)): checkOptions('transport', config['transport'], ['udp', 'tcp']) if (config['transport'] != 'udp'): raise Exception('Transport(%s) not implemented' % str(config['transport'])) if (('templateRefreshTimeout' in config) and (config['templateRefreshTimeout'] is not None)): checkFloat('templateRefreshTimeout', config['templateRefreshTimeout'], 1, 86400)
def checkConfiguration(config): checkType('config', (dict, ), config) checkIPv4('listenIP', checkAttr('listenIP', config)) checkPort('listenPort', checkAttr('listenPort', config)) checkInteger('numWorkers', checkAttr('numWorkers', config), 1)
def checkConfiguration(config): checkIPv4('deviceIP', checkAttr('deviceIP', config)) checkPort('devicePort', checkAttr('devicePort', config))
def checkConfiguration(config): #Comprobamos configuracion checkType('config', (dict,), config) checkIPv4('serverIP', checkAttr('serverIP', config)) checkPort('serverPort', checkAttr('serverPort', config))