This tool is a low-level vehicle to transmit arbitrary AXL requests to Cisco Unified Communications Manager (CUCM). The user needs to understand AXL and write the XML requests themselves. Understanding the AXL documentation and translating it into valid XML is necessary. The tool is 'self-contained' and has no external runtime dependencies. It can be compiled for Linux/Windows/Mac OS etc. The tool can be used in different operating modes.
A few things to point out:
-k
option-s 10.0
for exampleaddRoutePartition
) in this exampleThere are three operating modes available:
addRP.xml: <addRoutePartition> <routePartition> <name>AXL_PT</name> </routePartition> </addRoutePartition>
./axl -cucm 10.10.20.1 -u axladmin -p cisco123 -xml addRP.xml
As a variation, you can also issue a get request and print the formatted XML output to the console:
smart.xml: <getSmartLicenseStatus></getSmartLicenseStatus>
./axl -cucm 10.10.20.1 -u axladmin -p cisco123 -xml smart.xml -pp
{{var n}} syntax
(n refers to the CSV column, starting at 0):addRPs.xml: <addRoutePartition> <routePartition> <name>{{var 0 }}</name> <description>{{var 1}}</description> </routePartition> </addRoutePartition>
routepartitions.csv:
PT_One,First Partition
PT_Two,Second Partition
PT_Three,Third Partition
./axl -cucm 10.10.20.1 -u axladmin -p cisco123 -xml addRPs.xml -csv routepartitions.csv
axlsql.xml: <executeSQLQuery> <sql>SELECT n.dnorpattern, n.description, rp.name AS routepartition FROM numplan n LEFT JOIN routepartition rp ON rp.pkid=n.fkroutepartition</sql> </executeSQLQuery>
./axl -cucm 10.10.20.1 -u axladmin -p cisco123 -xml axlsql.xml -savesql result.csv
In order to successfully build the tool yourself you need to have the Go tool installed. Note that Go does not need to be installed to just run the compiled binary. After installing Go (and git), you can follow these steps on the command line / in the terminal:
This will download the project into a new subdirectory.
git clone https://github.com/sy9/go-axl.git
cd go-axl
go build ./cmd/axl
You should have the compiled binary in your current directory which can be used directly (try ./axl -v
).
-u
username of user with AXL permissions-p
password for this user-cucm
IP address or FQDN of CUCM publisher / first node-xml
filename of XML file which includes AXL request-pp
pretty-print successful XML response-dump
dump HTTP request and response (incl. full body)-csv <filename>
run in bulk mode using specified CSV file-savesql <filename>
save executeSQLQueryResponse data as CSV in specified file-k
ignore TLS certificate-s <schema-version>
AXL schema version (default is 12.5)If you execute an executeSQLQuery
AXL request you can use the -savesql myfile.csv
command to save the response in CSV format. The first line will be a comment (starting with #
) documenting the column names. You can use this CSV file for later AXL requests if needed.
If something goes wrong you should see an error code explaining the reason. Here are some common ones sent by CUCM:
12.5
, change with -s
option)These are HTTP error codes. If one of these errors is seen, or any network error in general, bulk operation stops. The tools continues operation in case of any AXL errors (e.g. "Duplicate value in UNIQUE INDEX" etc.).
In bulk mode (using a CSV file), the tool logs one line per CSV line to stdout per default. The content of the first column is included in the log line per default. To include other CSV columns, use the {{varlog n}}
syntax, where n refers to the CSV column (again starting as 0). Each CSV column mentioned by varlog
will be included in the log output.
The rules are as follows:
&
with &
)CSV file specifics:
,
)#
) at the very beginning are ignored#
at the beginning (e.g. route pattern in first column) - escape the value with "
- example: "#00345599!"
"
if they happen to contain the delimiter character"John ""Hero"" Smith"
)-savesql
assumes that CUCM returns each row with every column (even empty ones) and in the same order for every record. Our testing so far confirmed this behavior.To dump the requests and responses to stdout, use -dump
. Note that the complete body will also be printed.
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community