Coding Skills 101: How to call REST APIs from Python and jQuery

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so this class is going to be our coding 101 it's all about getting started with rest and making some rest calls from Python and jQuery so they get back to my beginning so I'm Amanda Whaley I'm a community manager for Deb net and if you need any of the samples or anything you're not able to get the materials from this class you can definitely email me directly and I'll be able to get those out to you they're all available for download when you're here on the dev net zone Wi-Fi so and we'll have links and stuff throughout that course alright so what are we going to cover this is really is coding 101 it's really for the target audience of people who maybe have never used a REST API or maybe played with a little bit but need some getting started how to jump into it how to start working with rest and then specifically how to call rest from Python and then we're also gonna look at jQuery and the next UI toolkit a little bit so um who is it for it's for new coders it's for returning coders that maybe did stuff on other platforms other languages a while ago and are kind of coming back to it if you are a JavaScript ninja you've been using REST API for years this is not the course for you go go do something else go find something else to do cuz you won't get a lot out of it we don't want to waste your time but if you're curious about those and wanting to get started then this is you're in the right place alright so one of the things that I want to put out there is that because this is a coding 101 class all of the sample code is written to be clear and be educational and be sample code ish not production or best practice or the most elegant efficient code that you'll find it's really written with the emphasis of let's be really clear about what we're doing and then you guys can take it and be awesome and take it to the next level later so okay so if you brought your laptop and you want to do the exercises with us as we work through these are some of the things that you'll need to download I would start with the coding 101 zip that's got the slides and samples and some of the URLs and things in it that you'll need you'll also need chrome postman which is a rest client a text editor and then if you want to run the Python examples you'll need Python installed on your machine so we've got some people that can help with that out in the audience so if you are coding along you get stuck or have a problem just raise your hand and they're gonna come and help and then also if you have a question for me raise your hand and we've got the mic and they'll bring it to you and you can ask your question because it just might be a little bit hard to hear it's not too bad right now crowd noise why so we might be able to hear you anyway but please make this really interactive it's supposed to be a hands-on interactive kind of thing so stop me and ask questions whenever you need to okay alright so a little bit more on the if you're doing the hands-on portion of it um the Learning Labs which are all of the great learning labs are over on those computers over there some of you guys may have tried some how many people have done the Learning Lab while they've been in definite zone cool so you can get to those on dev net Wi-Fi on your own computer too some of them are you can do on your own device so that's the URL if you want to do those on your own device and then these two URLs we're going to use those to make our rest calls those are our demo servers that we've got set up for this particular session so we'll be using those if you're coding along and the audience you may want to grab those and just put them in an easy to cut and paste text file because you'll probably be using those as we go okay those URLs are also inside of the coding 101 zip in coding 101 links file it's got those URLs and that's it and um for future as materials like this and information on all the api's as they are officially released you can go developer dot cisco comm that's also a great way to just to get in touch with the dev net team if there's something you want more information on or a particular topic you think that we need to give more information to developer on there you have some feedback go to developers let's go calm and get in touch with us through that site and that goes directly to the team that I work on and we're here to help you guys have all the stuff you need to build great things with Cisco technology there ok so first let's start really basic what is the rest web service and what is a web service so a web service is at the simplest level of way for two systems to communicate through a defined interface so there's an interface that's deploying and they can talk to each other um historically there's been two major types soap and rest so it kind of came first there were a lot of great web services a lot of cool stuff was built using soap but it was kind of cumbersome it's a little bit hard to work with rest has really taken off because it's so easy to work with and it's easy to call from any platform you can call REST API is super easily from mobile apps console apps web apps desktop apps in any language that you want basically because it basically comes down to making an HTTP request and getting some information back so because of the simplicity of using REST API is there's been this explosion of all these api's which have really powered a lot of the cool like apps that you may have on your phone if you have an app that pulls information and shows things from like a picture service or a social network many many of those have REST API is behind them that's how the phone is talking to the service in a lot of cases and then it's also spurred tons of growth with integrations between systems all kinds of systems are talking to each other now developers can do mashups of really interesting things by putting all these api's together so it's a great topic to learn I think once you get into it you will find so many places where you're going to want to consume and then maybe you will actually start architecting and writing rest api stew alright so at the core of rust it's great because it's such a simple concept it's basically like I have my third-party application yeah you know I'm kind of new to the whole programming part of this but right yeah you know with you know rest are some of these api's would I be able to make kind of like a module that I could have other people my team go to and they can just run they can hit a button I will display show commands and all that stuff for them you know your you can definitely make applications for your team and it will show things that are available through the API so if you're thinking about its particular feature that you want to implement you need to look at the API Doc's look at what features are there and you'll know what kind of interaction what kind of data you can get back and forth you can do yeah and then there's ways to do things that you would normally do through some command to actually do that through like we're gonna look at creating a policy as an example through this and do it through the API okay thank you that make sense yeah yeah okay so the basic idea is that your third-party app makes a request to the API and the API send some information back that information could be data that you're going to use and display and do something with or it could be a hey this this worked it was successful or it didn't work there was an error but that's really the basic concept so the most simple example we're gonna look at is I want a list of hosts we're going to use the a pickie em API we're gonna say give me a list of hosts and it returns the list of hosts so it's a really straightforward example so this is just a little bit more detail about that request and response and basically when you're working with a REST API you have the URL that you are calling that's the end point of the API that you're calling and that's how we're saying that we want host that's how we're telling it what we want and then there's the method and we'll talk more about this and the method is the HTTP request method let's get post put and it tells it it's also part of telling that you have what you want to do and then the information is returned to the third party app usually in JSON how many people have used JSON before a little bit here and there okay so if you think about how many people use XML okay so ii think xml but easier easier to use easier to work with easier to parse easier to do stuff with but same idea in a lot of ways that you're getting that information back so let's look at an example um we are gonna hop over to postman and getting all kinds of notifications okay so how's the size on this can you guys see that relatively okay the font okay okay so um this is a tool it's a an app you can load up in in Chrome and Tom postman I think the URL is get postman comm and it's a really great tool for testing REST API so if you're saying I want to use this API in my application I need to understand the way it works I want to get a look at what it does the best thing to do is get get the documentation for that API which tells you the endpoints and what kind of stuff you can do with it get postman and start making some test calls so that you can see okay I this is how I build up the request this is what I get back and that's exactly what we're going to do so um and this one you can see we've got that our URL the ten not ten but 20.1 that's our URL for our a pick IAM controller so that's we're going to use a pick IAM api's for all of our examples so they're all gonna start with that control or address and then api and then version zero and then the host because we're trying to get the list and post about and so let me type that in you specify what the method is that you're going to use again is usually for retrieving information read-only retrieving stuff a post or put is for creating or modifying data there's also delete if you're gonna delete something yeah a web service that's running on some device it's like this is running this is a web service that's running on my a --pqm controller okay so many time during that service and you're doing this HTTP call well it has to be a rest Web Services conforms to this and all of the markets and all the stuff that is the data is there this is returning in it's returning it right which we're gonna do right now I think it'll it'll help so we're gonna push send we're gonna send them requests over today a pic in controller and now we got back JSON so this is this is our JSON this is our data we got back and if you take a look at it um there's a top level response element and then underneath that you have basically an array of all the hosts that came back right and for each element in the array you've got all the attributes of that like host IP and hostname and all the things that you would want to find out about that host does that basic concept make sense see how that works that's kind of the whole deal like that's the main the main concept that we're gonna work with and is asking for this getting back the JSON and then we build on it and things get more a little more complicated so mmm we're gonna do a couple more of these and we're gonna kind of kind of build up on them first I just want to go over one other thing yeah so when you did that that get statement and that information that was populated it it pull it for something else or was that array already populated in some database yeah that's in the the database it's behind they think in controller that has all the network information in it okay so the information you got look a lot like saying as an MP so so that information was already in the database so if we wanted to and maybe I'm just going too far ahead but the database would have to query whatever it was we're trying to get that information from that I can do the gift statement from the database is that weird oh yeah so there's a database and there is a service that keeps pulling all the devices right on the you know background you don't even see that any cubes of in database as he goes and that's how you know it's very fast because you don't need to go to every device because database already is populated with that information right but there's a service that you know at the frequency that keeps pulling on devices information and the great thing about it is that you've got that layer of abstraction where you're not having to go and like check all those devices right you're going to the centralized place I'm getting it and it's through this really nice unifying interface that gives you so if something changes with those or the way that information is returned changes it still gets fed up through that same interface your application doesn't have to change right cuz you built an API so okay to talk about the controller right yeah the API is are offered by a controller but you could have some other method or some other thing maybe it's my sequel database or something anything that's the service there it returns in a JSON format well you have to have the API service sitting in front of it right but in this case you're tied by the controller but I could have any other service sure my-my-my web app that has a database of like my favorite shoes and if I wanted to write a REST API that says get me a get list mandis shoes then it could return my list of shoes right so you can make that for whatever in the way that it's because it's so popular growing so quick is because just like it's Mario's standard stuff it comes back in that format you know how you so when you're sending it from the API you got if you're an API that you've written you got to send it back in that format because the person is asking for it wants to see in that for exact okay so they know I'm expecting to get back and out you know something the inside of my element representing the hose called host IP and I'm gonna look for that and I'm gonna use that and if you change it and change the name to something else then you broke our interface and I'm mad at you so okay good questions awesome so the main parts of a request when you're building up a request in postman or when you're doing it in your application and calling it it's the same thing you gotta have the same parts you have a method that the get post put delete there's some other ones to you but those are the most common the URL most important a lot most important but Chinese central um usually you have that one of the first things you need to know is the authentication method for the API right because you're calling an API the API service needs to recognize your application and know that you're authorized to get that information so API dedication is really important there's several different types there's basic HTTP there's oo-ahh there's many many many different types there's also no authentication which is what we're using just in our little demo thing right now we're saying if you're on our special little demo network it's okay you can call it because we built it for you to be here at this event normally that would not be the case right of course normally you're not worried about navigation but since we wanted it to be for getting started we want to make it easy and then custom headers a lot of times you have to put there's different headers that would be specified by the interface that you need to include and then if you are doing something where you are not just retrieving data the API but you're going to create something or modify data you need to send information to the API and you put that in the request body and that's usually JSON or XML and we'll do some examples like that too all right so let's look at a few more examples and okay so oh did you get one more so what we looked at what was in the response and we'll look at this in more detail when we do these examples but the response you get back a status code and those are the the normal HTTP status codes 200 success you know 500 internal server error laugh 201 created and people can define custom ones too right so but that's really important you always want to look at that part of your response to know with my API with my call to the safety I just did it work or did something go wrong and I could not Finnick eight or whatever and then you get back usually some information in the request body that's either the data that you were trying to get back like in the example we looked at or in it could just be like this one saying yeah we it was successful we did something it worked and here's some ideas about what we're created something like that okay no we're gonna try it postman is what I'm using there are lots of other clients you can use to test rest interfaces if you like Firefox there's a tool called rest at Firefox rest clients you can do it from curl if you want to do it from curl with a little more cumbersome but you can totally do all this from from curl if you want to soap UI which is the tool that people have used a lot for testing soap interfaces they have a rest like kind of plugins and new feature that allows you to do testing with rest and that's really great for automated testing if you're trying to really do a lot of automated testing with it and then a lot of IDs or building and stuff like this to baby alright so here's some more of the apec iam ap is that we're gonna use in this class kind of building things up and if you are trying this on your laptop try these out in postman take a minute you know put in the URL that we're using which I'll put on the screen again but try them out so there's the get the list of hosts oops sorry get the network devices and get the list of policies and get the figured application so these are all simple gets give us back those information but then we would start to think about you know how we could do something interesting with that in an application right so we'll take a look at those so let's do devices so bigger so you can see we've got the same IP address and port for our a pic am controller same beginning to the URL and then network device and this is still again because we're just retrieving the list of those so we'll push then we get back a really similar structure with the array of devices but um we've got different attributes of this right so now we've got something where is it network device ID is network device ID so we're gonna we're gonna use that one but there's lots of information about each actual device right let's do policies so this is same same idea right still our controller now reads poly still again it's this one okay now we bought the array of policies and we've got the information about each policy cool and we've also got applications so configured application let's get the list of this here's our list of configured applications so do the starting to kind of make sense that overall pattern of how you can how you can do that yeah okay next we want to do something a little take it to the next what we would want to do which is instead of just retrieve information we actually want to create some information or change some information so on this one what we're going to do is we're going to create a policy so remember the list of policies that we got back this time we're going to actually create a policy so this is going to be a post using the post method because we're creating something we're sending information over and we're gonna send JSON that tells it what policy to create so we we specify it back to the API think then this is what I want you to create so let's take a look at that so you'll notice it's the same URL we used us to get the list of policies right but this time the method is post so the API knows we're trying to do something different than when we did the get on that same URL right because we're just doing a post we need to specify a header and when you tell it the content type that we're going to send to you is application slash JSON so that the API knows what kind of information we're sending to is to do something with and then this part the new part this is our request body so when we did it get we didn't send any information but when we're doing at post we need to say what we're going to do so if you were looking at the APM API Docs you would find an example of like here's an example of what you send in the request to create a policy and then you can modify it to do what you need to do the basic things are we're gonna say if the action is denied so we're basically blocking some ports in this policy we're gonna give it a policy name policy owner this is where we specify the host that we want the policy to act on and then we have a port range in the in the protocol so we're gonna do this yeah I was just wondering it's the only different if you were editing that same policy so let's say you prevent do that next all right so let me get a host that's actually real oh here we go okay so we're gonna this is the host that we got out of our list when we did get host and we're gonna block this these ports we're gonna send and we got back this is the ID of the policy that was created so now we've got that ID we could do something further with it if we want to and we got back the message saying yeah it worked and we got back status of 201 creating so we know hey we were we were successful that worked that information was there now if you tried to you know use those ports on that host you they would be blunt we actually I signal a did that in a demo with the other day it kind of broke our system so it's pretty cool if if we try to do this again like so a policy has to be a unique combination of the the host and the ports and the name so if we just did this again we're gonna get a different result which is we get a status code of 4/9 conflict and then we get information about saying hey this already exists you can't create this policy again does that make sense cuz you might run into that if you're working along you needed to change the ports be sure and use hi ports like about 40,000 or something far demo so that's that's the basic idea with with creating one to modify one like you were saying it's the similar idea except to use the put method saying I'm gonna modify this using the put method and then there's JSON that you've happen and one of the parts of that is the policy ID so you're saying I'm going to modify this particular policy ID and apply these attributes to it what's the best way to find out that the structure that you should be using is it the SDKs or is it it would be in the the documentation for the API yeah which could be part of the SDK err well there when this is released it'll be you know available on developer.android.com and they've got example requests in response and then they've got examples on how to use it they give you all the information you need to specify the request system so you may want to take a look at those Doc's and try some more calls and postman on your own as you work through it all right oh so another little handy tool that I wanted to show you that I forgot is that um so sometimes when you're doing this kind of testing feel like you're learning how to use the to create or modify something or got the docs and you're trying it out and you've got to build up this JSON that you're going to use um sometimes these can get really long and hard to tell you know if you have all your braces in the right place and whatever if you're building up the string so there's a handy tool called JSON JSON lint and basically it will I know that font is tiny let me see if I can zoom in so you can put your JSON in say validate and it'll tell you if it's valid and it'll help you find any problems that you have and it will also if you do something and get back like a big nasty uninvented json string and you're trying to figure out what's in it there's a handy tool you can paste it in there and it'll like pretty print it for you so it's easy to look at and read so when you're testing it's it's really handy and can save you a lot of time it's JSON lint there's several of these this is just one that I use the most all right okay one other thing I wanted to show in postman is a lot of times when you're getting started an easy mistake to make is if you've forgot to put in the header that you need so like I'm going to get rid of our header our content type header and let me change this to be something to print and we're gonna send this and you can see we get back an error that's telling us hey the posts method is not supported which it really is but we forgot the content-type header and so you can just dot it causes problems as you get weird errors you need to have that contact content type pattern there for a post or put any time when you're sending information so that's it that's a common way all right what's next okay yeah question this presentation on your website it's available for download right now while you're on the DEM net is own Wi-Fi here and I'll put the link up again at the end it's also the link is on those little monitors out there and we'll have it on developer Docs is cocom as soon as I think there's some preview release information that we kind of have to wait before we can put it publicly out there so we'll have it up there as soon as we can but you can definitely get it and you can also my emails at the end and if you want to email me to get a copy of it you can alright so the next thing we're going to do that's kind of the overall intro we got we did some gets we got back information we've created a policy and now what we want to take a look at is how would we do this in Python so you can see like okay let's take it out of the testing tool and do something real in a program with this information so we're gonna jump into the Python part of it and this starts from assuming that you don't really know Python starts from really basic so don't worry if you're not a Python person if you are bear with us with the you know beginning nature of it there's um some these are some links that you might want to check on later if you are trying to set up your environment and you're new to Python right so we're going to make our first rest call from Python and this is all it takes like that's pretty easy huh we're gonna do our get host and get back our list of hosts and the the parts to it are we're gonna use a library called request this is a library that you can install open source and it makes it easy for you to make rest calls in Python so they built a lot of nice features to help you with that and we're going to take a look at example of that specify our URL just like we did yeah quick question can you explain why in Python a popular one movies like PHP so what we're doing right here is we're just doing Python to run kind of as a console application PHP you'd be more like you can do rest from PHP for sure if you're building a web application and you want to build it in PHP I mean you do it in anything you can do it in this t-shirt Java but what's I mean I read a little bit about Python but what is it that's so special about Python just another language I mean there I don't I'm kind of platform agnostic I program on lots of platforms sharable it's like pick the right tool for what your you're doing I think Python has a lot of it's very attractive to people writing the kinds of apps where they might be using these a fijian api is because it's very pretty quick to learn it's pretty elegant language it's nice for systems kind of work all right Bruno you in it do you anything I love to learn a new one I'm just a curious it's definitely picking up tons of momentum okay like do you know Perl like a lot of people like curl but python is easier to learn being do a lot of stands job to paint it um okay so next we're gonna do the call so we're gonna say um this is our library request docket that's where we're saying use the get method here's the URL we want to get and that's gonna return back an object that represents the response that we got and then for this easy one we're just gonna print out that text and take a look at it so all you need to do this is some kind of text editor whatever you like this is a little tool called PyCharm and then there's a community edition of it that's kind of a nice Python editor but there's lots of them so here's what we just looked at and I put in our URL to our a pick um controller and we're going to go to our command line and we're gonna run it Python and here we go boom here's the JSON that we got back that giant list of is not very pretty it's not very useful but we did successfully make that call and get the information back right so now it's like kind of where where do you go from there what are the next step and if we if we wanted to take this giant piece of JSON paste it into JSON letting Prensa to look at it you could write but there's other ways we can handle that too so that's kind of the first step the next one and all these samples are in the download that you can get so this is basically the same idea but just a tiny bit further along we're going to use the network device API in this one and we're going to be using this URL like a lot of times for all of our API calls so let's create a variable to hold it and then we can easily build up the the URLs that we want so same thing we're gonna request on get here's the URL we're gonna get it back and print out that text and this is still going to be the ugly hard to read text yeah yeah oh okay yeah yeah yeah so this one oh I'll skip ahead so we don't have to look at the ugly stuff again this one goes one foot one step further so on this one we're going to after we get back their response object we're going to use the dot JSON method to say I don't just want the the text of that I want like a JSON object that I can manipulate and do stuff with so I'm going to get that object back and then for this one all we're gonna do is we're actually gonna dump it out but we're going to use a method where we can kind of pretty print it and have it indented so this one looks better but still not all the way where we want to go but this one would be better if you were trying to troubleshoot and see the JSON so this one a little bit easier to tell what's going on because we were able to do that right but that's still not really the interesting thing that we want to do what we actually want to do is we want to get information out of that JSON and do something with it like we want the ID or the name or the type for something right so we have to we have to be able to read specific things out of the JSON not just print the string so this one goes that goes to that next level starts off exactly the same way do the get get the response get the JSON and then this parts new this part we're saying I'm going to create a variable that's gonna reference that remember the very top level element that we got back in the JSON called response so we're getting like a reference to that and then we're saying I'm gonna loop through all the items in that array basically and print out the item and I want to look at the network device ID attribute of that so this one a little more useful we're gonna get a just a list of all the IDs for the devices on our network Sara take the sinus stuff but so that one now we have we pulled out all those IDs and put and put them out so you can imagine maybe maybe in a fancier situation you take those and those are displayed on a webpage and now people can select those devices and do something with them or find out more information about them or something like that that makes sense yeah really that's kind of like that's it that's the whole thing that on other languages it's the same thing find a library to help you make over a request to a REST API get back the information and use whatever library in that language is the easiest to do the JSON parsing and you can usually find those out pretty easily questions that is that one no did you everyone yes yeah you want to see the code again just the original Jason to see where first it was okay devices so what we were looking for is this network device ID is what we've pulled out of the JSON for each one and you just mentioned on the response mm-hmm that's right you're matching her okay cool so what time is it oh man I got finished okay so I'm gonna speed up a little bit that's the main idea the next thing we want to do actually is take a look at how do we do the post so this is where we created the policy okay this one is a little of it we're gonna do a couple things we're gonna get in the list of policies and see how many there are then we're gonna add a new one get the list again so we can tell hey there's there's one more now right so we're gonna do the same the same thing there so this one puts together a couple of things one we're gonna get the list of hosts and then we're gonna get a specific host out of that array I'm just picking three if you were writing a real program you probably have the user choose it right but I'm just keeping it simple for demo and then that's gonna print out tell if that was our host we selected and then we're gonna get a list of policies print those out the same way we just did with the network devices but we're going to show the policy ID and then we're gonna count how many are in that array so buddy know how many we had but here's the really new part so now we want to make that post we want to do the post to create a new policy so one we have to define our JSON that we're gonna send so basically I just picked what I'm defining and then I'm plugging in that selected host variable so that it'll be one of the hosts from the list create your headers and then here's where we make the the call to the API so it's same request library dot post this time because I want to make a post send in the URL send in the JSON for the request body send in the headers so you can see it's all the same ESA's we had in postman write the request body the headers URL and if you had authentication you would put that information into and then we're gonna and then we're gonna run it so let's take a look at that one [Music] Oh yes Oh whoops hi song that's not gonna work okay so on this one you can see here's where it started we got our this is the host we selected from the list here's the current list of policies there were 27 hairs that our results which we were able to successfully create it and then now here's our list and now there's there's 28 so we really did create one right and so those are kind of all the basic building blocks and you can keep putting those together you can build more and more complicated stuff but it all kind of goes back to those basic concepts okay [Music] so like I said all these are available for download you can get to them and the last thing I want to do is I just want to give a quick view into the next UI toolkit so we're gonna switch gears we did all that great Python stuff you're gonna have all the samples you can take it off and play with it I'm gonna be around most of the day you can find me over in like the lounge area around the Learning Labs if you've got questions and want to try something out but I want to show you this because this is it this is another cool piece and it kind of shows something else you can do with the API so the next to my toolkit has a lot of things in it but the one of the coolest things is it makes it really easy for you to build a web application to display and visualize network topologies so it's a JavaScript library you can include that makes it like where you can get your topology and like boom show like this really cool drawing of your network and it's something Cisco's working on it this is the first time we've shown it we love to get your feedback if it's something that you want us you know to keep going with it's pretty cool so we're gonna do a quick a quick look at that so here's an example of what you can do basically so we're switching to JavaScript now so switch your brain over to JavaScript from Python okay basically you can give it a set of data representing the nodes on the network and then it creates diagrams like this that show you like the topology and there's lots of different things you can set about how it's displayed there's all kinds of themes and icons and all kinds of cool stuff you can do I'm running short on time so I'm just gonna give you a really quick demo with that all right so here is some data that we're gonna pops to it so nodes there's an array of nodes that has like their ID and their coordinates and their name and then links that say how those nodes are linked together right so what we're going to do is we're going to take that we're gonna include all of the JavaScript and CSS files that go with next we're gonna include that data we're gonna set up a new topology in next and we're going to give it that data and that's basically it this is like really short right not a lot of code and then we're gonna open it in our browser boom there's our thing and it's cool you've got it's already built in where you can like pan around you can zoom you can change the name of these just by changing the data there's a lot of different configuration options so that's cool but even cooler is if we can do the same thing but we're gonna get our data from a pic TM instead so we're gonna make a call to say hey I want the physical topology from my a pickie and API and I'm gonna feed that into that same visualization right so this is making a rest call in in jQuery and tons of information about this out on the web you can totally find it happy to go over it with you all so basically we get back that data and we're going to put it into that same call where we create a topology and share goes rym so this one's big we've got lots of lots of nodes on it right compared to the simple one it's very zoomed out but if we zoom in we start to get more detail you can move them around you can also click and you can see this is all the information remember when we did the network device ID and got back all those attributes this is like the same thing and it's automatically fed in and displayed into this diagram so there's a huge time-saver like if you wrote all this JavaScript yourself you'd be writing it for a long time yeah can you show that an API call again it was a little bit different yes yeah yeah I do want to show I'm actually gonna show it a postman really quick so it's topology slash physical and it's just to get so same thing we've been doing all the other ones and we're gonna do send and you see remember when we looked at the static data that we use to make the little first diagram and there were nodes and links that came that were in that data this has the same structure basically you get back that array of nodes but it's got a lot more information in it than we specified in our little static one and then it's also if we go down far enough there's a lot of things on this test network you can see there there's the link section which says how the nodes are linked together so we can make that call we can get that we can feed it into that next - I - okay and start to build really interesting useful you know Network kind of applications that allow people to select nodes operate on visually visualize them things like that so that's that's a fun thing to play with there's a learning lab on the next stuff where you can kind of play with that and go through a lot of that yourself so go check out the learning lab on that if you want if you want more there's also ability to overlay it onto an actual map you can give it like latitude longitude and I do map overlays with it so last thing slide this is a bunch of the references that were used throughout it and might be handy to you and last thing is my favorite group which is those who never fail or those who never try and that's a great quote for learning to program because there's tons of trial and error right so don't get frustrated keep trying double check your spelling you know all that stuff and so there's my contact information you can find me on twitter at mandy Whaley you can email me directly if you need information and love to hear about your experiences the subnet love to hear about your experiences using developer cisco comm and what you need from cisco to help you be a successful developer because we're here to help with that so thanks a lot I'll see you guys around [Applause] you
Info
Channel: Cisco DevNet
Views: 61,968
Rating: 4.8857141 out of 5
Keywords: Application Programming Interface (Literature Subject), Python (Programming Language), Computer Programming (Conference Subject), Representational State Transfer (Internet Protocol)
Id: hmbgNZjTdPM
Channel Id: undefined
Length: 48min 19sec (2899 seconds)
Published: Mon Jun 30 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.