Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.51 KB

File metadata and controls

37 lines (26 loc) · 1.51 KB

ODL-REST-PythonSDK

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

Little More Details

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 specify containerName in dict format {'containerName':'default'}.
  • flow If request type is put/post and some places delete, you have to specify json parameter. flow type is dict. Internally flow is converted to json.