Keyword | Definition |
---|---|
Inventory | List of network devices that the Controller has access to. |
Network Device | Routers, switches, etc. |
Controller | Service that intermediates between client applications and network devices. E.g. ODL, COSC |
ODL | Open Day Light |
COSC | Cisco Open Source Controller, enhanced ODL |
Mount | Introduce a Network Device to a Controller. |
Capability | A feature of a network device that is dynamically discovered. |
This page explores the connection from a Controller to multiple network devices. The topics are:
If the Learning Lab team have provided you with either:
then please proceed. Otherwise, please follow the instructions on web page: How to set up your computer
Import the Python module named learning_lab
.
In [1]:
import learning_lab
from inspect import getsource
from importlib import import_module
In [2]:
script = import_module('01_inventory_mount', 'learning_lab')
In [3]:
help(script)
In [4]:
print(getsource(script.main))
In [5]:
script.main()
The HTTP requests for this script can be examined here
The HTTP requests for this script are the same as for:
In [6]:
script = import_module('01_inventory', 'learning_lab')
In [7]:
help(script)
In [8]:
print(getsource(script.main))
In [9]:
script.main()
The HTTP requests for this script can be examined here
In [10]:
script = import_module('01_device_dismount', 'learning_lab')
In [11]:
help(script)
In [12]:
print(getsource(script.main))
In [13]:
script.main()
The HTTP requests for this script can be examined here.
In [14]:
script = import_module('01_inventory_unmounted', 'learning_lab')
In [15]:
help(script)
In [16]:
print(getsource(script.main))
In [17]:
script.main()
The HTTP request for this script is the same as 01_inventory_mounted.py.
In [18]:
script = import_module('01_inventory_mounted', 'learning_lab')
In [19]:
help(script)
In [20]:
print(getsource(script.main))
In [21]:
script.main()
The HTTP requests for this script can be examined here.
In [22]:
script = import_module('01_inventory_mount', 'learning_lab')
In [23]:
help(script)
In [24]:
print(getsource(script.main))
In [25]:
script.main()
The HTTP requests for this script can be examined here.
In [26]:
script = import_module('01_inventory_summary', 'learning_lab')
In [27]:
help(script)
In [28]:
print(getsource(script.main))
In [29]:
script.main()
The HTTP request for this script is the same as 01_inventory.py.
In [30]:
script = import_module('01_inventory_summary_html', 'learning_lab')
In [31]:
help(script)
In [32]:
print(getsource(script.main))
In [33]:
%%capture console
script.main()
In [34]:
from IPython.core.display import HTML
HTML(console.stdout)
Out[34]:
The HTTP request for this script is the same as 01_inventory.py.
In [35]:
script = import_module('01_inventory_json', 'learning_lab')
In [36]:
help(script)
In [37]:
print getsource(script.main)
In [38]:
script.main()
The HTTP requests for this script can be examined here.
Function inventory_summary()
requests a HTTP response of type XML instead of JSON. The processing of XML versus JSON is similar yet different.
In [39]:
from basics.inventory import inventory_xml, inventory_summary_from_xml
print(getsource(inventory_summary_from_xml))
inventory_summary_from_xml(inventory_xml())
Out[39]:
In [40]:
script = import_module('01_inventory_connected', 'learning_lab')
In [41]:
help(script)
In [42]:
print(getsource(script.main))
In [43]:
script.main()
The HTTP request for this script is the same as 01_inventory.py.
In [44]:
script = import_module('01_inventory_unreachable', 'learning_lab')
In [45]:
help(script)
In [46]:
print(getsource(script.main))
In [47]:
script.main()
The HTTP requests for this script are the same as for:
In [48]:
script = import_module('01_inventory_not_connected', 'learning_lab')
In [49]:
help(script)
In [50]:
print(getsource(script.main))
In [51]:
script.main()
The HTTP request for this script is the same as 01_inventory.py.
In [52]:
script = import_module('01_inventory_integrity', 'learning_lab')
In [53]:
help(script)
In [54]:
print(getsource(script.main))
In [55]:
script.main()
The HTTP requests for this script are the same as for:
In [56]:
script = import_module('01_device_mounted', 'learning_lab')
In [57]:
help(script)
In [58]:
print(getsource(script.main))
In [59]:
script.main()
The HTTP request for this script is here
In [60]:
script = import_module('01_device_connected', 'learning_lab')
In [61]:
help(script)
In [62]:
print(getsource(script.main))
In [63]:
script.main()
The HTTP request for this script is here
The inventory was obtained from the Controller and examined. Network devices were mounted on the Controller then dis-mounted. The inventory data was shown to be lengthy and a demonstration of reduction was applied to both JSON and XML data. The connection status and the number of capabilities were extracted. Data available for groups of network devices was shown to be also available for individual network devices. The details of each HTTP request and response were published in reference tables.