DevNet Documents

Video: How to Create Brocade SDN Controller RESTConf/Postman Dev Environment:

by JimBurns on ‎05-11-2015 03:15 PM - edited on ‎03-20-2017 11:06 AM by Community Manager (1,422 Views)

This video shows how to set your system up to create RESTConf applications and how to use the Google Chrome Postman extension to exercise the RESTConf interface.

 

 

Transcript
 
0:00
20 folks and this video we're gonna teach her how to create a rest comp
0:04
application
0:05
on top at the Brocade pay a controller for
0:08
a net comp capable network device home in a previous video we showed you how to
0:12
do
0:13
14 an OpenFlow capable device obviously they're not mutually exclusive
0:17
so honored to do our application we have a few prerequisites one you're gonna
0:22
need BBC installed
0:24
other link in the upper right corner haven't done that already also you're
0:27
gonna need a net comp capable device
0:29
arm were gonna be using the buy at a the router 5600 with the non
0:35
evaluation license that's the one that actually support netcom
0:38
okay so let me go through the window set up a recoger
0:42
three windows and over on the break got a browser in a min just go to the IP
0:46
address for my BBC port 9000
0:48
a login with admin admin and then
0:52
home go to the API browser
0:55
and then on the upper left corner here I'm gonna SSH into my by Anna
0:59
5600 arm and then from there I'm gonna just
1:03
make sure I got netcom capabilities and I do that by
1:07
big figure and then show services and
1:10
in the services near the bottom you should find a copy if you don't then
1:13
you're probably running an evaluation
1:15
persian have the BC 5600 and that's not gonna work
1:19
so we're gonna do something a little bit different in this application from our
1:23
previous open for application and said according to wreck lead to the rest
1:26
interface
1:26
are actually going to use a library called P Y
1:30
BBC her pie BBC um all that does is a wrap those rest interfaces and make it a
1:36
little bit easier to use
1:37
so number first gonna go grab that and begin using
1:41
okay so let's go grab pie BBC
1:44
gotta git hub will do a search on pipe PVC
1:47
will grab the one from to public arm it is in fact a framework for working with
1:51
the Brocade by and a controller
1:52
here's the instruction to install it were assuming you have Python and Pip
1:56
installed so we do a pseudo pip install pie BBC
2:00
your password you can see it's installing pie BBC as well as a number
2:04
of other dependencies
2:05
associated to it arm that's required for pie BBC to run
2:09
to pay BBC is basically a library you can go get you can just clone that
2:12
and see the source code if you want to actually see it but we also
2:16
are gonna grab one of these applications were in a crap I BBC samples
2:20
armed actually demonstrated to demonstrate programming and that comp to
2:24
face by the BBC we're just gonna grab one of these pied BBC sample
2:28
applications that already does that
2:30
so first let's go
2:33
back to the get herb and do a search on pie BBC samples
2:37
there it is but some sample applications used to pay BBC library
2:41
and we're just going to clone it so we're gonna grab its clone URL
2:45
and then do it get cloning and then that RL on Apple actually create
2:49
a directory with by BBC samples in
2:54
so we have pie BBC samples which uses pie BBC library
2:57
and has a number of samples one of them his programming
3:01
firewalls we're gonna demonstrate okay so in our pie
3:05
BBC samples folder you see a number files I'm some have dot why am I always
3:09
an extension summed up you i'd up you are asleep iPhone application so I am
3:13
now
3:13
are you able files and %um a files are just configuration files that have a
3:18
sort of a variable name in a value for that problem
3:21
arm what we're gonna be demonstrating today is setting
3:24
a firewall on the view 5600 the beer over 5600
3:29
so up in upper left on my be router 5600
3:32
a show the security fire on you can see I have non currently program
3:36
me to go ahead and run the Python application BR underscore firewall to
3:41
CPI why
3:42
you can see what it's doing is it's creating a connection to the controller
3:45
connection to the router
3:47
and then it's connecting to the router to the controller
3:50
I still have no firewall you see is creating some definitions for a firewall
3:54
and lo and behold there some firewalls now programs on my V
3:58
5600 router arm if we keep watching
4:02
it's going to actually delete those now arm
4:06
and after its done deleting its gonna demonstrate
4:09
I'll go ahead and get the fire walls up there's one left
4:13
now there's none left so that demonstrated in fact
4:16
creating and deleting firewall
4:19
okay so let's walk through the code I'm just gonna open my text editor here
4:23
to I'm opening the BR firewall P Y
4:27
I'm you can see at the very top we import the P Y BBC library and a number
4:32
elements from it then the section what we're doing is we're reading that camel
4:36
filing getting configuration
4:37
there are a number of delays in the application on purpose
4:41
just for readability so here we are we're actually creating a controller
4:45
instance we pass information about the controller then we created rerouted 5610
4:50
to pass information about it
4:51
um there we go we sleep 'em
4:55
and then were gonna add the be router net comp device to the controller
5:00
are and then we're going to check and make sure that its connection status is
5:04
up arm to make sure that things are actually connected
5:08
arm and then we're going to this is just for the viewer
5:12
we're gonna show the firewall configuration this demonstrates their
5:17
aren't any firewalls yet arm to people who are actually being a
5:20
it's just chase on way to stop it on the screen here we are creating a firewall
5:25
that is creating a firewall definition so we create a firewall
5:28
then we create a rule percent overall sorry
5:32
and then we create the rule we've had and action this is obviously the meet a
5:36
bit
5:36
and a source address and we had that rule to rules and then we take
5:40
and add those rules to the firewall we built up firewall
5:43
and then we basically create a firewall instance
5:47
on the router and then we do the same thing again for another
5:51
firewall and then we actually apply the firewall
5:55
to an interface on the router so in this case were attaching it to a data plan
6:00
interface
6:01
and then the rest to the application is pretty much to leading okay so
6:06
what next um well couple suggestions
6:09
you could explore the source code for the pie BBC
6:13
arm they would just be going to a git clone of Pi BBC
6:17
and then explore the Python source files that are there
6:21
on that will basically show you what rest commands were used to actually do
6:25
the functions that were
6:27
shown in the example
6:29
arm you could text just instead over if you're not interested in
6:32
actually learning about the rest commands you could just explore what
6:35
functions are available in part BBC
6:37
I'm just go to get herb repository for pie BBC scroll down to the bottom
6:42
there's a link to all up documentation for the functions themselves
6:47
arm you could explore either a the
6:50
applications that use by BBC to see how does what it does
6:54
you take up I BBC samples for pie BBC commands both
6:57
you can grab and get help get clone them um
7:01
you could expand the functions you could
7:06
request that we had more functions or net comp devices that you need
7:10
arm for pie BBC you could forget yourself
7:14
do it yourself you could actually add code and do a pull request we can add it
7:18
to pay BBC
7:19
harm and then finally you could create an automation
7:22
application using pie BBC on your net comp devices
Contributors