All right, let's do another example this time on Aruba Central automation. Let's review how to use python. Before we log into equipment, let's first take a look at a default installation of python. If you install python on your system, it will install a python shell and IDLE as a default editor. Typically it's helpful to start with a simple bit of code. So, let's define a variable with a string value of Hello world. Then we'll try to print this variable. You can see that's working fine without any compiling. So you can run python from a shell interface or even a simple text file. We can even run python from within An Aruba cx switch. First, I'll log in and then execute the command, start shell. This opens a Linux shell where we can use an editor like Vim to create a file. For example, test.py. And inside this text file, we'll use the same commands that we did in the python editor. Back on the Aruba cx terminal. I can run the script using the command, python3 for the version followed by the text file I just created. And the script runs. Because python can execute REST API calls, this means that through your scripting you can access features on this CX switch or other switches in the network, simply by using python commands. So, let's try then to run some python scripts to access features in Aruba Central. Here's an example of a script to do exactly that. Before I can run the script, I need to grab the access token I previously generated for central. I'll select Aruba Central and then go to global settings for the API Gateway. From here I select my apps and tokens, check my access token by selecting, download and copy the token. from here I jump into the python IDLE editor for the test script and update the central token field. And then save the script. Before I run the script, let's do a quick walkthrough on what the script is actually saying. The, from py central base library is where we're going to import a function called Aruba Central base. Of course, this only works if you actually have the library, pycentral.base installed. This is easy enough to download through Windows PowerShell. Open PowerShell and type PIP for py installed packets and then install Pie Central. The results show that I've already installed this library on this machine. And once that's done, I can now call functions from py central. Next I'm defining the class central and inside this class I'm expecting a token, then I'll assign a self token variable. On specifying the base URL for central and central info. We'll next define a login function under the same class and define a central request function. This login function will utilize the imported Aruba Central Base pulled from py central base. Then with the Central request function, there is the API path pointing to monitoring API version one and access points. So, where did we find this path? Again from the central swagger interface. If we switch back to swagger for central and select list access points under the AP reference, then you'll see the URL for listing the access points on central. Back to the python script. We're using the GET method with some additional parameters there. And finally we can initiate the request and wait for the response to return. Everything above is the defined classes and functions needed for the script. Now, we create our main function where we're creating an object with the name Central. I'm using the class with the name central passing my token and initiating the login process. Then we get our response from central and this variable. And lastly, we'll print the responses from central using a simple four loop to apply labels to the information were interested in. So, let's go ahead and see if we can run this now. Click on run module. First, we got in token air but after copying it correctly we should get the desired results. And it looked like it worked. We got both the APs, models, status as up and each of their individual IP addresses. This is the same information that we normally would have to log in to the central GUI in order to get. And once these scripts are written, they're pulling this information in the desired format to be imported much faster than through a web interface. So, if you want to grab everything about these devices, you can easily go back and edit these python scripts. Here I'm trying to just print the base rep variable. Let's try running the script again. You can see that, without parsing for particular interested fields, you can get a lot more output that can then later be filtered or parsed. So you can search for serial numbers or you can look for Mac addresses or any other parameters that the central rest API returns. You can reuse all of this information in part of your code. For example, here you can change the API path to gather data from other Aruba central calls and features. Or you can adjust the method from GET to DELETE, then just re-initiate this call and request to use across other applications in your environment. So, this was a quick demonstration, a python with central. But sometimes REST API functions may not have the required functionality you want. And in these cases, you can run python to interact directly with the central web interface as a typical user. With just a python request module, you can send a request to central user page and you may be able to capture the desired data output that you're looking for that way. And this would give python an additional flexibility for use cases even outside of the normal REST API calls that we were demonstrating.