I use REST in Mininet.
But since I found about Bottle I'm trying to use it instead.
The first code works all right as shown below.
from
mininet.net import Mininet
from mininet.node import OVSController
from mininet.topo import SingleSwitchTopo
from mininet.link import Link, TCLink
from bottle import route, run, template
from bottle import get, post, request # or route
net = Mininet(topo=SingleSwitchTopo(2), link=TCLink,controller = OVSController)
@get('/cmd/<node>/<cmd>')
def cmd( node='h1', cmd='ifconfig%20h1-eth0' ):
out, err, code = net.get( node ).pexec( cmd )
return out + err
@route('/stop')
def stop():
net.stop()
run(host='localhost', port=8080 )
But when I try to access a switch I receive 200 (OK) but nothing returns.
Somebody hep me, please.