by
0
7
4,629
14
Top 1% !
Popular
Famous
Tagged
Specified
Debate
OpenSource
Popularity: 2010th place

Published on:

Architecturex86_64
LanguagePython
LicenseMIT_X11
Target FrameworkOpenDaylight

Basic OpenDaylight Python API

This code shows a simple ODL API to connect to the server, to handle json response, to report error conditions etc...

See more on ODL:


OpenDaylight main site: [http://www.opendaylight.org/] (http://www.opendaylight.org/)

OpenDaylight example project on github: [https://github.com/dwcarder/python-OpenDaylight/] (https://github.com/dwcarder/python-OpenDaylight/)

Source link: [http://destinationunreachable.net/2013/07/22/opendaylight-with-python/] (http://destinationunreachable.net/2013/07/22/opendaylight-with-python/)
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/11300/Basic-OpenDaylight-Python-API?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
from OpenDaylight import OpenDaylight from OpenDaylight import OpenDaylightFlow odl = OpenDaylight() odl.setup['hostname'] = '10.10.10.1' odl.setup['username'] = 'admin' odl.setup['password'] = 'admin' SWITCH_1 = '99:99:99:00:00:00:01:00' flow = OpenDaylightFlow(odl) node = OpenDaylightNode(odl) odl_test_flow_1 = {u'actions': u'DROP', u'etherType': u'0x800', u'ingressPort': u'1', u'installInHw': u'true', u'name': u'odl-test-flow1', u'node': {u'@id': SWITCH_1, u'@type': u'OF'}, u'priority': u'500'} # add the flow flow.add(self.odl_test_flow_1) # get this flow flow.get(node_id=SWITCH_1, flow_name='odl-test-flow1') # get all flows flow.get() # delete the flow flow.delete(SWITCH_1, 'odl-test-flow1')
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus