import logging
from mininet.log import setLogLevel
from emuvim.dcemulator.net import DCNetwork
-from emuvim.api.zerorpcapi import ZeroRpcApiEndpoint
+from emuvim.api.zerorpc.compute import ZeroRpcApiEndpoint
+from emuvim.api.sonata import SonataDummyGatekeeperEndpoint
logging.basicConfig(level=logging.INFO)
dc1 = net.addDatacenter("dc1")
dc2 = net.addDatacenter("dc2")
s1 = net.addSwitch("s1")
- net.addLink(dc1, s1)
- net.addLink(dc2, s1)
+ net.addLink(dc1, s1, delay="10ms")
+ net.addLink(dc2, s1, delay="20ms")
- # create a new instance of a endpoint implementation
+ # add the command line interface endpoint to each DC
zapi1 = ZeroRpcApiEndpoint("0.0.0.0", 4242)
- # connect data centers to this endpoint
zapi1.connectDatacenter(dc1)
zapi1.connectDatacenter(dc2)
# run API endpoint server (in another thread, don't block)
zapi1.start()
- # TODO add "fake gatekeeper" api endpoint and connect it to both dcs
+ # add the SONATA dummy gatekeeper to each DC
+ sdkg1 = SonataDummyGatekeeperEndpoint("0.0.0.0", 5000)
+ sdkg1.connectDatacenter(dc1)
+ sdkg1.connectDatacenter(dc2)
+ # run the dummy gatekeeper (in another thread, don't block)
+ sdkg1.start()
# start the emulation platform
net.start()
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()