The AXL Philosophy and Objective
We, as programmers, typically have a look at an API with wild goals about constructing dazzling user-facing functions that encourage jaw-dropping amazement. That’s simply how we’re constructed. And the AXL API has the ability to allow you to do this.
One phrase… DON’T.
AXL isn’t an API for user-facing functions. It’s an administration and configuration API. You don’t need to push an end-user software constructed on AXL to 1,000 customers. And when you do, you’re going to have a foul time.
Consider AXL as a programmatic method to carry out internet GUI administration and configuration duties. For instance, within the internet GUI, you add an finish consumer this manner.
- Choose the Person Administration menu
- Choose Finish Person
- Click on on +Add New
- Fill out the shape
- Save.
Now, programming which may appear foolish and extra work than utilizing the net GUI. However consider it this manner. You might have a textual content file with an inventory of names, electronic mail addresses, telephone numbers, assigned firm telephone extension and different private knowledge of recent staff. Now you may write an software that reads the file and creates and configures an end-user account for every of the individuals and creates and configures strains and telephones entries for them. That’s automating an administration and configuration job in a method that makes your life as an administrator simpler.
The Fundamentals
AXL is a SOAP-based API. There’s no REST for the depraved right here.
Probably the most typically used AXL APIs fall into the next teams:
- addSomething (e.g., add a telephone)
- getSomething (e.g., get a telephone’s data and settings)
- updateSomething (e.g., change a telephone’s data and settings)
- applySomething (e.g., apply the modifications you made for the telephone)
- removeSomething (e.g., take away a telephone)
- listSomething (e.g., record all telephones)
There are a number of different AXL APIs not in these teams that you just’ll want at occasions, however these are essentially the most often used operations.
Getting Began: Preparation
One of the best ways to get aware of AXL is to make use of a free, open-source device referred to as SoapUI. SoapUI makes it straightforward to experiment with the AXL API. However first, that you must obtain the recordsdata you’ll use with SoapUI.
Log into Name Supervisor as an administrator. Below the Utility menu, choose Plugins.
Click on the Discover button (not proven on this display screen shot). The primary merchandise is the Cisco AXL Toolkit. Click on on Obtain and reserve it someplace.
The saved file ought to appear to be this:
Open the zip file to see its contents
Open the schema listing.
Decide the model of Name Supervisor you might be utilizing. On this pattern, we’ll decide present.
Copy the three recordsdata above to a working listing. I selected C:SOAP.
Obtain and set up the open-source SoapUI from this web page. You’re finished with preparation. Now, it’s time to create an AXL venture to play with the API.
Set Up a SoapUI AXL Challenge
Click on on the File menu and select New SOAP Challenge.
Decide a reputation in your venture. Set the Preliminary WSDL to level to the AXLAPI.wsdl file you saved to a working listing earlier. Click on OK.
Within the left column, it’s best to see this (assuming you used the identify New AXL Check, in any other case search for the identify you selected).
Proper click on on AXLAPIBinding and choose Present Interface Viewer. It’s best to see this Dialog Field.
Click on on the Service Endpoints tab and also you’ll see the place you may enter data for AXLAPI binding.
Kind what you see within the Endpoint discipline, besides level to your server the place it says YOURSERVER. Assuming it’s secure in your work setting to do, enter your Administrator username and password within the acceptable fields. You possibly can create an Administrator account in Name Supervisor particularly to be used with the AXL API, or you need to use your major Administrator account.
You possibly can shut this dialog field now.
Now let’s play with one of many requests. Within the left column, discover listPhone and click on on its plus signal. Then double-click on Request 1. It’s best to see all of the XML for this request pop up in a brand new dialog.
The listPhone request has a number of potential hangups which are good to discover ways to keep away from. Any listSomething request goes to return, properly, an inventory of issues. Scroll right down to the underside of the request XML and also you’ll see these choices. These provide the choice to skip quite a lot of outcomes, or outline the start line. We don’t need to mess with these choices proper now, so choose them and delete them.
On the prime, search for what I’ve chosen right here, choose it and delete it. This attribute will be helpful, and also you don’t at all times need to delete it, however on this case, you’ll must take away the ‘sequence=”?”’ for the request to work correctly.
There’s yet one more factor. Eliminate what you see chosen on this display screen shot. Choose it and delete it.
There are method too many values to specify, so let’s chop down the request to appear to be this. Make certain to place a % signal within the <identify></identify> tag. This can be a wild card, which implies it’s going to record ALL the telephones. You need to begin easy, so it is a simplified listPhone operation.
Now’s the time to attempt it out. Click on on the inexperienced “run” icon within the higher left. It’s best to see the correct aspect of the request change to this:
That is an unlucky bug within the present model of SoapUI. It ought to present you the XML response by default, but it surely as an alternative exhibits you uncooked data. Till the app is fastened, you’ll need to click on on the higher left XML tab to view the response.
The response would possibly look one thing like this:
With that, you now have sufficient fundamental information to experiment with any of the AXL APIs. Hey now, you’re an all-star, get your sport on, go play.
As soon as you might be aware of how the API works, attempt programming with the API:
Programming Tip
And when you actually need to run with the large boys, right here’s a tip for operating a number of AXL request sequentially. Each time you make an AXL request, Name Supervisor launches a Tomcat session. Once you make many requests in a row, Name Supervisor will launch a number of Tomcat classes, which deplete CPU and RAM.
Right here’s a method round that. On the backside of the response, open up the headers and also you’ll see a cookie named JSESSIONID and its worth.
When you set the JSESSIONID cookie and use the identical worth in your subsequent AXL request, Name Supervisor will re-use the Tomcat session as an alternative of launching a brand new one.
What to Keep away from and Frequent Errors
Many requests have an inventory of optionally available search parameter tags, generally <identify> and <uuid>. You’ll often have to decide on one and delete the others.
As logical as it could appear, you may’t carry out a getPhone, change some values, after which copy and paste the modified XML into an updatePhone request. getPhone and updatePhone XML tags are usually not mirror pictures.
Watch out when utilizing APIs that offer you direct entry to the Name Supervisor database, like executeSqlQuery. Difficult joins could also be intelligent, however they’ll additionally suck up CPU and reminiscence the scale of a spy balloon, and that eats into the efficiency of each different operation.
Assets
We’d love to listen to what you suppose.
Ask a query or go away a remark beneath.
And keep related with Cisco DevNet on social!
LinkedIn | Twitter @CiscoDevNet | Fb | YouTube Channel
Share: