Example #1
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_conns
     self.routines.append(self.apiroutine)
     self.managed_conns = {}
     self.managed_systemids = {}
     self.managed_bridges = {}
     self.managed_routines = []
     self.endpoint_conns = {}
     self.createAPI(api(self.getconnection, self.apiroutine),
                    api(self.waitconnection, self.apiroutine),
                    api(self.getdatapathids, self.apiroutine),
                    api(self.getalldatapathids, self.apiroutine),
                    api(self.getallconnections, self.apiroutine),
                    api(self.getbridges, self.apiroutine),
                    api(self.getbridge, self.apiroutine),
                    api(self.getbridgebyuuid, self.apiroutine),
                    api(self.waitbridge, self.apiroutine),
                    api(self.waitbridgebyuuid, self.apiroutine),
                    api(self.getsystemids, self.apiroutine),
                    api(self.getallsystemids, self.apiroutine),
                    api(self.getconnectionbysystemid, self.apiroutine),
                    api(self.waitconnectionbysystemid, self.apiroutine),
                    api(self.getconnectionsbyendpoint, self.apiroutine),
                    api(self.getconnectionsbyendpointname, self.apiroutine),
                    api(self.getendpoints, self.apiroutine),
                    api(self.getallendpoints, self.apiroutine),
                    api(self.getallbridges, self.apiroutine),
                    api(self.getbridgeinfo, self.apiroutine),
                    api(self.waitbridgeinfo, self.apiroutine)
                    )
     self._synchronized = False
Example #2
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_conns
     self.routines.append(self.apiroutine)
     self.managed_conns = {}
     self.managed_systemids = {}
     self.managed_bridges = {}
     self.managed_routines = []
     self.endpoint_conns = {}
     self.createAPI(api(self.getconnection, self.apiroutine),
                    api(self.waitconnection, self.apiroutine),
                    api(self.getdatapathids, self.apiroutine),
                    api(self.getalldatapathids, self.apiroutine),
                    api(self.getallconnections, self.apiroutine),
                    api(self.getbridges, self.apiroutine),
                    api(self.getbridge, self.apiroutine),
                    api(self.getbridgebyuuid, self.apiroutine),
                    api(self.waitbridge, self.apiroutine),
                    api(self.waitbridgebyuuid, self.apiroutine),
                    api(self.getsystemids, self.apiroutine),
                    api(self.getallsystemids, self.apiroutine),
                    api(self.getconnectionbysystemid, self.apiroutine),
                    api(self.waitconnectionbysystemid, self.apiroutine),
                    api(self.getconnectionsbyendpoint, self.apiroutine),
                    api(self.getconnectionsbyendpointname, self.apiroutine),
                    api(self.getendpoints, self.apiroutine),
                    api(self.getallendpoints, self.apiroutine),
                    api(self.getallbridges, self.apiroutine),
                    api(self.getbridgeinfo, self.apiroutine),
                    api(self.waitbridgeinfo, self.apiroutine))
     self._synchronized = False
Example #3
0
 def __init__(self, server):
     Module.__init__(self, server)
     self._managed_objs = {}
     self._watches = {}
     self._watchedkeys = set()
     self._requests = []
     self._transactno = 0
     self._stale = False
     self._updatekeys = set()
     self._update_version = {}
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._update
     self.routines.append(self.apiroutine)
     self.createAPI(api(self.mget, self.apiroutine),
                    api(self.get, self.apiroutine),
                    api(self.mgetonce, self.apiroutine),
                    api(self.getonce, self.apiroutine),
                    api(self.mwatch, self.apiroutine),
                    api(self.watch, self.apiroutine),
                    api(self.munwatch, self.apiroutine),
                    api(self.unwatch, self.apiroutine),
                    api(self.unwatchall, self.apiroutine),
                    api(self.transact, self.apiroutine),
                    api(self.watchlist),
                    api(self.walk, self.apiroutine)
                    )
Example #4
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_conns
     self.routines.append(self.apiroutine)
     self.managed_conns = {}
     self.endpoint_conns = {}
     self.table_modules = set()
     self._acquiring = False
     self._acquire_updated = False
     self._lastacquire = None
     self._synchronized = False
     self.createAPI(api(self.getconnections, self.apiroutine),
                    api(self.getconnection, self.apiroutine),
                    api(self.waitconnection, self.apiroutine),
                    api(self.getdatapathids, self.apiroutine),
                    api(self.getalldatapathids, self.apiroutine),
                    api(self.getallconnections, self.apiroutine),
                    api(self.getconnectionsbyendpoint, self.apiroutine),
                    api(self.getconnectionsbyendpointname, self.apiroutine),
                    api(self.getendpoints, self.apiroutine),
                    api(self.getallendpoints, self.apiroutine),
                    api(self.acquiretable, self.apiroutine),
                    api(self.unacquiretable, self.apiroutine),
                    api(self.lastacquiredtables))
Example #5
0
 def __init__(self, server):
     Module.__init__(self, server)
     self._managed_objs = {}
     self._watches = {}
     self._watchedkeys = set()
     self._requests = []
     self._transactno = 0
     self._stale = False
     self._updatekeys = set()
     self._update_version = {}
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._update
     self.routines.append(self.apiroutine)
     self.createAPI(api(self.mget, self.apiroutine),
                    api(self.get, self.apiroutine),
                    api(self.mgetonce, self.apiroutine),
                    api(self.getonce, self.apiroutine),
                    api(self.mwatch, self.apiroutine),
                    api(self.watch, self.apiroutine),
                    api(self.munwatch, self.apiroutine),
                    api(self.unwatch, self.apiroutine),
                    api(self.transact, self.apiroutine),
                    api(self.watchlist),
                    api(self.walk, self.apiroutine)
                    )
Example #6
0
    def __init__(self, server):
        '''
        Constructor
        '''
        Module.__init__(self, server)
        self._ce_matcher = ConsoleEvent.createMatcher()
        self.apiroutine = RoutineContainer(self.scheduler)
        self.apiroutine.main = self._service_routine
        self._restore_console_event = threading.Event()

        @generator_to_async(True, False)
        def proxy(event, matcher):
            while True:
                events = self.sendEventQueue.get()
                if events is None:
                    break
                yield events

        @async_to_async(True, False)
        @async_processor
        def processor(event, matcher, queueout):
            if event.type == 'initproxy':
                proxy(event, matcher, queueout)

        self.connector = Connector(processor, (self._ce_matcher, ),
                                   self.scheduler, False)
        self.routines.append(self.apiroutine)
        self.routines.append(self.connector)
Example #7
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.client = ZooKeeperClient(self.apiroutine, self.serverlist)
     self.connections.append(self.client)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #8
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.client = ZooKeeperClient(self.apiroutine, self.serverlist)
     self.connections.append(self.client)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #9
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_conns
     self.routines.append(self.apiroutine)
     self.managed_conns = {}
     self.endpoint_conns = {}
     self.table_modules = set()
     self._acquiring = False
     self._acquire_updated = False
     self._lastacquire = None
     self._synchronized = False
     self.createAPI(api(self.getconnections, self.apiroutine),
                    api(self.getconnection, self.apiroutine),
                    api(self.waitconnection, self.apiroutine),
                    api(self.getdatapathids, self.apiroutine),
                    api(self.getalldatapathids, self.apiroutine),
                    api(self.getallconnections, self.apiroutine),
                    api(self.getconnectionsbyendpoint, self.apiroutine),
                    api(self.getconnectionsbyendpointname, self.apiroutine),
                    api(self.getendpoints, self.apiroutine),
                    api(self.getallendpoints, self.apiroutine),
                    api(self.acquiretable, self.apiroutine),
                    api(self.unacquiretable, self.apiroutine),
                    api(self.lastacquiredtables)
                    )
Example #10
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.protocol = ZooKeeper()
     self.client = Client(self.url, self.protocol, self.scheduler)
     self.connections.append(self.client)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #11
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.protocol = ZooKeeper()
     self.client = Client(self.url, self.protocol, self.scheduler)
     self.connections.append(self.client)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #12
0
 def __init__(self, server):
     Module.__init__(self, server)
     taskpool = TaskPool(self.scheduler)
     self.taskpool = taskpool
     self.routines.append(self.taskpool)
     self.routines.append(NetworkPlugin(self))
     self.apiroutine = RoutineContainer(self.scheduler)
     self._reqid = 0
     self.createAPI(api(self.getdockerinfo, self.apiroutine))
Example #13
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.createAPI(api(self.start, self.apiroutine),
                    api(self.create, self.apiroutine),
                    api(self.get, self.apiroutine),
                    api(self.destroy, self.apiroutine))
Example #14
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     def _main():
         try:
             for m in self.run(*self.args, **self.kwargs):
                 yield m
         finally:
             self.scheduler.quit()
     self.apiroutine.main = _main
     self.routines.append(self.apiroutine)
Example #15
0
 def __init__(self, server, protocolclass):
     Module.__init__(self, server)
     self._protocolclass = protocolclass
     self.apiroutine = RoutineContainer(self.scheduler)
     self.managed_connections = set()
     self._createServers(self, '')
     self.createAPI(api(self.getservers),
                    api(self.stoplisten, self.apiroutine),
                    api(self.startlisten, self.apiroutine),
                    api(self.updateconfig, self.apiroutine),
                    api(self.getconnections))
Example #16
0
 def __init__(self, server, protocolclass):
     Module.__init__(self, server)
     self._protocolclass = protocolclass
     self.apiroutine = RoutineContainer(self.scheduler)
     self.managed_connections = set()
     self._createServers(self, '')
     self.createAPI(api(self.getservers),
                    api(self.stoplisten, self.apiroutine),
                    api(self.startlisten, self.apiroutine),
                    api(self.updateconfig, self.apiroutine),
                    api(self.getconnections))
Example #17
0
 def __init__(self, server):
     """
     Constructor
     """
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.createAPI(
         api(self.start, self.apiroutine),
         api(self.create, self.apiroutine),
         api(self.get, self.apiroutine),
         api(self.destroy, self.apiroutine),
     )
Example #18
0
    def __init__(self, server):
        Module.__init__(self, server)
        self.apiroutine = RoutineContainer(self.scheduler)

        async def _main():
            try:
                return await self.run(*self.args, **self.kwargs)
            finally:
                self.scheduler.quit()

        self.apiroutine.main = _main
        self.routines.append(self.apiroutine)
Example #19
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self.timeoutroutine = RoutineContainer(self.scheduler)
     self.timeoutroutine.main = self._timeout
     self.db = {}
     self.routines.append(self.timeoutroutine)
     self.createAPI(api(self.get), api(self.set), api(self.delete),
                    api(self.mget), api(self.mgetwithcache), api(self.mset),
                    api(self.update), api(self.mupdate),
                    api(self.updateall), api(self.updateallwithtime))
Example #20
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_ports
     self.routines.append(self.apiroutine)
     self.managed_ports = {}
     self.createAPI(api(self.getports, self.apiroutine),
                    api(self.getallports, self.apiroutine),
                    api(self.getportbyno, self.apiroutine),
                    api(self.waitportbyno, self.apiroutine),
                    api(self.getportbyname, self.apiroutine),
                    api(self.waitportbyname, self.apiroutine),
                    api(self.resync, self.apiroutine))
     self._synchronized = False
Example #21
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._autoreload
     self._lastcheck = time()
     if self.autoreload:
         self.routines.append(self.apiroutine)
     self.createAPI(api(self.enableAutoReload), api(self.activeModules),
                    api(self.reloadmodules, self.apiroutine),
                    api(self.loadmodule, self.apiroutine),
                    api(self.unloadmodule, self.apiroutine))
Example #22
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_ports
     self.routines.append(self.apiroutine)
     self.managed_ports = {}
     self.createAPI(api(self.getports, self.apiroutine),
                    api(self.getallports, self.apiroutine),
                    api(self.getportbyno, self.apiroutine),
                    api(self.waitportbyno, self.apiroutine),
                    api(self.getportbyname, self.apiroutine),
                    api(self.waitportbyname, self.apiroutine),
                    api(self.resync, self.apiroutine)
                    )
     self._synchronized = False
Example #23
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.dispatcher = Dispatcher(self.scheduler)
     self.mimetypedatabase = mimetypes.MimeTypes(self.mimetypes)
     self._cache = {}
     self.apiroutine = RoutineContainer(self.scheduler)
     self.lastcleartime = 0
     def start(asyncStart = False):
         self._createHandlers(self)
     def close():
         self.dispatcher.close()
     self.apiroutine.start = start
     self.apiroutine.close = close
     self.routines.append(self.apiroutine)
     self.createAPI(api(self.updateconfig))
Example #24
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.dispatcher = Dispatcher(self.scheduler)
     self.mimetypedatabase = mimetypes.MimeTypes(self.mimetypes)
     self._cache = {}
     self.apiroutine = RoutineContainer(self.scheduler)
     self.lastcleartime = 0
     def start(asyncStart = False):
         self._createHandlers(self)
     def close():
         self.dispatcher.close()
     self.apiroutine.start = start
     self.apiroutine.close = close
     self.routines.append(self.apiroutine)
     self.createAPI(api(self.updateconfig))
Example #25
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._main
     self.routines.append(self.apiroutine)
     self._reqid = 0
     self._ownerid = uuid1().hex
     self.createAPI(api(self.createlogicalnetwork, self.apiroutine),
                    api(self.createlogicalnetworks, self.apiroutine),
                    api(self.createphysicalnetwork, self.apiroutine),
                    api(self.createphysicalnetworks, self.apiroutine),
                    api(self.createphysicalport, self.apiroutine),
                    api(self.createphysicalports, self.apiroutine),
                    api(self.createlogicalport, self.apiroutine),
                    api(self.createlogicalports, self.apiroutine),
                    api(self.getlogicalnetworks, self.apiroutine))
     self._logger.setLevel(logging.DEBUG)
Example #26
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._main
     self.routines.append(self.apiroutine)
     self._reqid = 0
     self._ownerid = uuid1().hex
     self.createAPI(api(self.createlogicalnetwork, self.apiroutine),
                    api(self.createlogicalnetworks, self.apiroutine),
                    api(self.createphysicalnetwork, self.apiroutine),
                    api(self.createphysicalnetworks, self.apiroutine),
                    api(self.createphysicalport, self.apiroutine),
                    api(self.createphysicalports, self.apiroutine),
                    api(self.createlogicalport, self.apiroutine),
                    api(self.createlogicalports, self.apiroutine),
                    api(self.getlogicalnetworks, self.apiroutine))
     self._logger.setLevel(logging.DEBUG)
Example #27
0
 def __init__(self, server):
     """
     Constructor
     """
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._autoreload
     self._lastcheck = time()
     if self.autoreload:
         self.routines.append(self.apiroutine)
     self.createAPI(
         api(self.enableAutoReload),
         api(self.activeModules),
         api(self.reloadmodules, self.apiroutine),
         api(self.loadmodule, self.apiroutine),
         api(self.unloadmodule, self.apiroutine),
     )
Example #28
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_ports
     self.routines.append(self.apiroutine)
     self.managed_ports = {}
     self.managed_ids = {}
     self.monitor_routines = set()
     self.ports_uuids = {}
     self.wait_portnos = {}
     self.wait_names = {}
     self.wait_ids = {}
     self.bridge_datapathid = {}
     self.createAPI(api(self.getports, self.apiroutine),
                    api(self.getallports, self.apiroutine),
                    api(self.getportbyid, self.apiroutine),
                    api(self.waitportbyid, self.apiroutine),
                    api(self.getportbyname, self.apiroutine),
                    api(self.waitportbyname, self.apiroutine),
                    api(self.getportbyno, self.apiroutine),
                    api(self.waitportbyno, self.apiroutine),
                    api(self.resync, self.apiroutine))
     self._synchronized = False
Example #29
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._manage_ports
     self.routines.append(self.apiroutine)
     self.managed_ports = {}
     self.managed_ids = {}
     self.monitor_routines = set()
     self.ports_uuids = {}
     self.wait_portnos = {}
     self.wait_names = {}
     self.wait_ids = {}
     self.bridge_datapathid = {}
     self.createAPI(api(self.getports, self.apiroutine),
                    api(self.getallports, self.apiroutine),
                    api(self.getportbyid, self.apiroutine),
                    api(self.waitportbyid, self.apiroutine),
                    api(self.getportbyname, self.apiroutine),
                    api(self.waitportbyname, self.apiroutine),
                    api(self.getportbyno, self.apiroutine),
                    api(self.waitportbyno, self.apiroutine),
                    api(self.resync, self.apiroutine)
                    )
     self._synchronized = False
Example #30
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self._ce_matcher = ConsoleEvent.createMatcher()
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self._service_routine
     self._restore_console_event = threading.Event()
     @generator_to_async(True, False)
     def proxy(event, matcher):
         while True:
             events = self.sendEventQueue.get()
             if events is None:
                 break
             yield events
     @async_to_async(True, False)
     @async_processor
     def processor(event, matcher, queueout):
         if event.type == 'initproxy':
             proxy(event, matcher, queueout)
     self.connector = Connector(processor, (self._ce_matcher,), self.scheduler, False)
     self.routines.append(self.apiroutine)
     self.routines.append(self.connector)
Example #31
0
 def __init__(self, server):
     Module.__init__(self, server)
     self._tableacquire_routine = RoutineContainer(self.scheduler)
     self._tableacquire_routine.main = self._acquiretable
     self.routines.append(self._tableacquire_routine)
     self.createAPI(api(self.gettablerequest))
Example #32
0
 def __init__(self, server):
     Module.__init__(self, server)
     # Should consider to use a subclass of vlcp.service.connection.tcpserver.TcpServerBase
     self.connections.append(TcpServer(self.url, MyProtocol(), self.scheduler))
     self.routines.append(MyServer(self.scheduler))
Example #33
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.routines.append(MainRoutine(self.scheduler))
Example #34
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #35
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.routines.append(MainHandler(self.scheduler))
Example #36
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self.routines.append(WebAPIHandler(self))
Example #37
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.createAPI(api(self.createnotifier))
Example #38
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.apiroutine = RoutineContainer(self.scheduler)
     self.apiroutine.main = self.main
     self.routines.append(self.apiroutine)
Example #39
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.createAPI(api(self.createnotifier))
Example #40
0
 def __init__(self, server):
     Module.__init__(self, server)
     # Should consider to use a subclass of vlcp.service.connection.tcpserver.TcpServerBase
     self.connections.append(
         TcpServer(self.url, MyProtocol(), self.scheduler))
     self.routines.append(MyServer(self.scheduler))
Example #41
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.client = RedisClient()
     self.routines.append(MainRoutine(self.client, self.scheduler))
Example #42
0
 def __init__(self, server):
     '''
     Constructor
     '''
     Module.__init__(self, server)
     self.routines.append(WebAPIHandler(self))
Example #43
0
 def __init__(self, server):
     Module.__init__(self, server)
Example #44
0
 def __init__(self, server):
     Module.__init__(self, server)
     self._tableacquire_routine = RoutineContainer(self.scheduler)
     self._tableacquire_routine.main = self._acquiretable
     self.routines.append(self._tableacquire_routine)
     self.createAPI(api(self.gettablerequest))
Example #45
0
 def __init__(self, server):
     Module.__init__(self, server)
Example #46
0
 def __init__(self, server):
     Module.__init__(self, server)
     self.client = RedisClient()
     self.routines.append(MainRoutine(self.client, self.scheduler))