Python SDK for OpenDaylight Controller Rest API.
All REST api are collected from https://wiki.opendaylight.org/view/OpenDaylight_Controller:REST_Reference_and_Authentication
This SDK requires 'requests'
. Install it by using 'pip install requests'
This is easy to use,
#Intialize controller ip-address
collection = CollectionApi(ipaddress='192.168.56.101')
#Pass the parameter at URL
url_params = {'containerName':'default'}
#collect the result from REST api
result = collection.statistics_get_all_node(url_params)
print result.json()
My Blog is [http://net-ed.blogspot.in/] 1
I am looking for help to come up with good method names. Ping me if you have any suggestions
CollectionApi
has ipaddress, port, username, password, http
for initialization.
After initialization call method. Method internally calls REST api and returns response object.
Parameters for each method are, url_params and flow
url_params
inside a raw url for e.g/controller/nb/v2/topology/{containerName}/userLinks
You have to specifycontainerName
in dict format{'containerName':'default'}
.
flow
If request type isput/post
and some placesdelete
, you have to specify json parameter. flow type is dict. Internally flow is converted to json.