<div dir="ltr">Here is a link to my full script for anyone who is interested. The script prompts for a company name and creates a new local directory by that name if it doesn't already exist, then prompts for CUCM version, CUCM Pub IP address, AXL username, and AXL password. The script also uses the AXL and RisPort APIs if anyone is looking for an example of either.<div><br></div><div><a href="https://www.iptinfo.com/2018/03/23/querying-cucm-via-axl-risport-api-config-discovery-tool/">https://www.iptinfo.com/2018/03/23/querying-cucm-via-axl-risport-api-config-discovery-tool/</a><br><div><br></div><div>The script queries the pub address you entered for CUCM/IMP cluster node names and license utilization, then uses that info to query each node for application version. Once initial discovery of nodes, versions and license utilization is completed, the script presents a menu with options: 9 - Discover All and q - Quit. If you select option 9, the script will query and captures a list of basic info for configured phones (filtered to SEP devices), gateways, CTI devices (route points and ports), hunt devices, and media devices and writes output of each query to a separate worksheet in an excel workbook created with a concatenated name of the company you entered and the current date and time. <br><br><div>Note, I am not a programmer by trade and just started using Python so if anyone has suggestions or corrections, please feel free to share them. There's some validation and exception handling built in, but I've not fully implemented both yet. I started working on this about a month ago (the script and python in general) and is a work in progress so any feedback is welcome and appreciated. The script requires zeep, suds-jurko, xlsxwriter and the AXL plugin installed; this is all called out in comments in the script. <div><br></div><div>The script does not validate the SSL certs so if you need to do that, you'll want to update the script to validate the CUCM/IMP certs.<br><div><br></div><div>Bill</div><div><br></div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 21, 2018 at 4:03 PM, Bill Talley <span dir="ltr"><<a href="mailto:btalley@gmail.com" target="_blank">btalley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Lelio,<div><br></div><div>I just went through the same ordeal a few weeks ago which you're embarking on now. I'm no expert in this by any means, but know information is also hard to come by and will share whatever I can.</div><div><br></div><div>Checkout my notes here, <a href="https://www.iptinfo.com/2018/02/22/querying-cucm-via-axl-using-python-scripts-installing-python/" target="_blank">https://www.iptinfo.com/<wbr>2018/02/22/querying-cucm-via-<wbr>axl-using-python-scripts-<wbr>installing-python/</a>, but more importantly check out the links at the bottom of the page. Those are blogs I used to get started on installing and using Python to utilize AXL to query and modify CUCM.</div><div><br></div><div>Here's a link to my sample Python script which will prompt you for a client/directory name, CUCM IP address, CUCM version, CUCM AXL username and CUCM AXL password, then will query for and output a list of phone (basic info) and create a csv file containing that list of phones. I have a more complex script that queries for cluster nodes, software versions, phone devices, hunt devices, gateways, media devices, etc if you're interested in seeing something like that.</div><div><br></div><div><a href="https://www.iptinfo.com/2018/02/28/querying-cucm-via-axl-sample-python-script/" target="_blank">https://www.iptinfo.com/2018/<wbr>02/28/querying-cucm-via-axl-<wbr>sample-python-script/</a><br></div><div><br></div><div>As far as username and passwords embedded in the script, if you control the machine the script will be executed on, you could create system variables containing that info on the machine, then call the system variables from the script.</div><div><br></div><div>Lastly, here's a link to the CUCM AXL developer guides and database dictionaries. The AXL programming guides tell you the supported search criteria and response data that will be returned.</div><div><br></div><div><a href="https://developer.cisco.com/docs/axl/#previous-versions" target="_blank">https://developer.cisco.com/<wbr>docs/axl/#previous-versions</a><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>Bill</div></font></span></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Mar 21, 2018 at 3:17 PM, Lelio Fulgenzi <span dir="ltr"><<a href="mailto:lelio@uoguelph.ca" target="_blank">lelio@uoguelph.ca</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
I'm going to make a (sad) attempt to try my hand at API usage. You know, running those sweet commands against CUCM or WebEx, etc to make my life easier. I'm hoping that by starting with some simple examples, I can build what I need as time goes on.<br>
<br>
My hope is to build scripts that I can run via CLI, but also create simple web pages with buttons that execute those scripts, with or without arguments. The webpages themselves will be protected appropriately.<br>
<br>
But I'm starting from scratch. I do have a resource that I'm hoping will help out, but I'm wondering, if you were building an api box from scratch, what sort of things would you want (or need) on it to make things run smoothly?<br>
<br>
I'm guessing if I want to automate any of these scripts, I'll have no choice but to store the userID/password either in the script or read from a file. I've asked this before of a few people, but there is no real way to store a password securely and decrypt it at time of running the script.<br>
<br>
For interactive scripts, either CLI or web form, do you use the same userID/password, or are you asking for credentials and use those credentials?<br>
<br>
I know... a big ask.<br>
<br>
<br>
---<br>
Lelio Fulgenzi, B.A. | Senior Analyst<br>
Computing and Communications Services | University of Guelph<br>
Room 037 Animal Science & Nutrition Bldg | 50 Stone Rd E | Guelph, ON | N1G 2W1<br>
<a href="tel:519-824-4120%20Ext.%2056354" value="+15198244120" target="_blank">519-824-4120 Ext. 56354</a> | <a href="mailto:lelio@uoguelph.ca" target="_blank">lelio@uoguelph.ca</a><mailto:<a href="mailto:lelio@uoguelph.ca" target="_blank">lelio<wbr>@uoguelph.ca</a>><br>
<br>
<a href="http://www.uoguelph.ca/ccs" rel="noreferrer" target="_blank">www.uoguelph.ca/ccs</a><<a href="http://www.uoguelph.ca/ccs" rel="noreferrer" target="_blank">http://www<wbr>.uoguelph.ca/ccs</a>> | @UofGCCS on Instagram, Twitter and Facebook<br>
<br>
[University of Guelph Cornerstone with Improve Life tagline]<br>
<br>
<br></div></div><span class="">______________________________<wbr>_________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" rel="noreferrer" target="_blank">https://puck.nether.net/mailma<wbr>n/listinfo/cisco-voip</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>