DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
ADDRESS)
update_phone_by_name(axl,
"SEP001122334455", "DevAsc: adding new Desc")
print(get_phone_by_name(axl,
"SEP001122334455"))
if __name__ == '__main__':
main()

Using the CiscoAXL SDK


The Python SDK called CiscoAXL is pretty simple to use.
As of this writing, there are other SDKs available, but we
use CiscoAXL here as an example. To start with this
SDK, you need to install it by using the pip or pip3
command:


Click here to view code image


pip install ciscoaxl or pip3 install ciscoaxl

Example 10-25 shows the simplest way to invoke the
SDK and start working with it.


Example 10-25 Using the CiscoAXL SDK to Get Phone
Information


Click here to view code image


""" Using CiscoAXL SDK to get phone info"""
from ciscoaxl import axl
CUCM = '10.10.20.1'
CUCM_USER = "administrator"
CUCM_PASSWORD = "ciscopsdt"
CUCM_VERSION = '12.0'
ucm =
axl(username=CUCM_USER,password=CUCM_PASSWORD,cucm=CUCM,cucm_version=CUCM_
VERSION)
print (ucm)
for phone in ucm.get_phones():
print(phone.name)
for user in ucm.get_users():
print(user.firstName)
Free download pdf