Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
prob_of_net-cucm_pt2
import ssl
from suds.client import Client
import logging
# ignore ssl pain
ssl._create_default_https_context = ssl._create_unverified_context
# setup creds for auth
username = 'admin'
passwd = 'lab_password'
# setup access to the wdsl and the pub
#
# NOTE: this has localhost:8000 for the wsdl.
# the wsdl isnt available on the server (why i will never know)
#
# two choices:
# 1) host the wsdl online somewhere you know, and refer to that
# 2) in another terminal browse to the AXLToolkit/schema/10.5/ folder
# run 'python -m SimpleHTTPServer' in that dir.
# that spins up a mini web server you can read the wsdl from...
wsdl_url = 'http://localhost:8000/schema/10.5/AXLAPI.wsdl'
service_url = 'https://10.1.1.10/axl/'
# Create an object to communicate with the API called cucm_server.
# this is how we pull and push data into CUCM via XML.
cucm_server = Client(wsdl_url, location = service_url, username=username, password=passwd)
# read some data in.
#
# create a new object called users and read in the user details based on our query to SoapUI
users = cucm_server.service.listUser({'userid':'user%'},{'userid':'', 'firstName':'', 'lastName':'', 'department':'','directoryUri':'', 'status':''})
# spit that data back to me on the screen.
for user in users['return']['user']:
print user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment