The following scripts are available for download:
Python 2.7 Script
n ArubaXMLDemo.py: This is a Python 2.7 script. This script demonstrates the basic functionality of the XML
API. Using this script, you can send XML requests to add, delete, authenticate, blacklist, query, or log out a
user.
Bourne Shell Scripts
n xml_user_add.sh: This script adds a user using the user_add command.
n xml_user_del_or_logout.sh: The user_delete part of the script deletes an existing user from the switch user
table. The user_logout part of the script reverts an existing user to the initial role in the AAA profile.
n xml_user_query.sh: This script fetches the status and details of a user connected in the network using the
user_query command.
The Bourne Shell scripts work on most Unix, Linux, and Mac operating systems. To run on Windows, you can install
Cygwin.
All scripts require cURL to be installed on the XML API server. cURL is an open source command line tool and library
for transferring data with URL syntax. You can download cURL from http://curl.haxx.se/download.html.
XML API using Python 2.7
The information covered in the following section is based on running the ArubaXMLDemo.py script on a
Windows 8.1 64-bit and Python 2.7.
Understanding Request and Response
The switch processes the XML API request and sends the response to the XML API server. The XML response
contains the status of the request and a code in case of an error.
Request format: <script_name> <switch-ip> <secret_key> <command> [options]
Understanding XML API Request Parameters
The Table 266 lists all parameters that you can use in a request.
Parameter Description
script_name The name of the script executable.
switch-ip The IP address of the switch that will receive the XML requests.
secret_key The password used to validate the authentication request from your authentication
server. See Configuring the XML API Server on page 1076 for more information.
Table 266: XML API Request Parameters and Descriptions
AOS-W 6.5.3.x | User Guide External User Management | 1081