mnoptical.ofcdemo.fakecontroller
¶
fakecontroller.py: script to test REST API
This is not intended to be a ‘real’ controller - it is an extremely simple set of proxy objects that make it easy to exercise the prototype SDN control REST API via python.
The real controller will be ONOS, and it may use GNMI or Netconf rather than REST.
Module Contents¶
Classes¶
Base proxy class |
|
Local proxy for OpenFlow switch configuration using ovs-ofctl |
|
Proxy for REST API objects/calls |
|
Base class for switching node proxies |
|
Base class for switching node proxies |
|
Local proxy for Terminal/transceiver configuration via REST |
|
Local proxy for ROADM configuration via REST |
Functions¶
|
Fetch node list using REST |
|
|
|
Fetch ROADM rules using REST |
|
Fetch ports for all nodes |
|
Fetch OSNR values |
Attributes¶
- class mnoptical.ofcdemo.fakecontroller.Proxy¶
Bases:
object
Base proxy class
- __repr__()¶
Return repr(self).
- mnoptical.ofcdemo.fakecontroller.ListenPortBase = 6653¶
- class mnoptical.ofcdemo.fakecontroller.OFSwitchProxy(name, ip='127.0.0.1', port=None)¶
Bases:
Proxy
Local proxy for OpenFlow switch configuration using ovs-ofctl
- listenPort¶
- dpctl(cmd, params='', verbose=False)¶
Invoke ovs-ofctl to program remote switch
- class mnoptical.ofcdemo.fakecontroller.RESTProxy(name=None, baseURL='http://localhost:8080/')¶
Bases:
Proxy
Proxy for REST API objects/calls
- get(path, params=None)¶
Make a REST request
- class mnoptical.ofcdemo.fakecontroller.NodeProxy(name=None, baseURL='http://localhost:8080/')¶
Bases:
RESTProxy
Base class for switching node proxies
- ports()¶
Fetch node’s switching rules if any
- class mnoptical.ofcdemo.fakecontroller.SwitchProxy(name=None, baseURL='http://localhost:8080/')¶
Bases:
NodeProxy
Base class for switching node proxies
- rules()¶
Fetch node’s switching rules if any
- class mnoptical.ofcdemo.fakecontroller.TerminalProxy(name=None, baseURL='http://localhost:8080/')¶
Bases:
SwitchProxy
Local proxy for Terminal/transceiver configuration via REST
- connect(ethPort, wdmPort, channel=None, power=None)¶
Configure terminal/transceiver
- reset()¶
- turn_on()¶
- class mnoptical.ofcdemo.fakecontroller.ROADMProxy(name=None, baseURL='http://localhost:8080/')¶
Bases:
SwitchProxy
Local proxy for ROADM configuration via REST
- connect(port1, port2, channels, action='install')¶
Configure ROADM
- reset()¶
- mnoptical.ofcdemo.fakecontroller.fetchNodes(net)¶
Fetch node list using REST
- mnoptical.ofcdemo.fakecontroller.fetchLinks(net)¶
- mnoptical.ofcdemo.fakecontroller.fetchRules(roadms)¶
Fetch ROADM rules using REST
- mnoptical.ofcdemo.fakecontroller.fetchPorts(net, nodes)¶
Fetch ports for all nodes
- mnoptical.ofcdemo.fakecontroller.fetchOSNR(net)¶
Fetch OSNR values