Package: ciscocucmapi
Python Wrappers for Cisco CUCM SOAP APIsFree software: MIT licenseFeaturesThe ciscocucmapi package is inspired by the most excellentwebexteamssdkPython API wrapper for Cisco Spark.  The library wraps apython-zeepclient to manage CUCM SOAP connections (specifically for AXL) and CRUD operations for common API endpoints.OverviewSimplified Pythonic wrappings of Cisco UC SOAP APIspython-zeep-based client under the hood - much faster thansuds.  WSDL caching is enabled by default.Complete abstraction of AXL SOAP API - no xml!Native Python tooling includes:Native returned AXL data objects modelled with adict-like interface and characteristicsxml order is honoured due toOrderedDictimplementationAXL crud operations supported using both Python objects and native AXL calling requirementsTransparent sourcing of AXL credentials from local environment variablesEasy, template-able reading and writing to JSON objects, making Cisco UC DevOps implementations a realityInstallationpip install ciscocucmapiYou can also install the in-development version with:pip install https://github.com/jonathanelscpt/ciscocucmapi/archive/master.zipDocumentationhttps://ciscocucmapi.readthedocs.io/Quick StartfromciscocucmapiimportUCMAXLConnectorimportjsonaxl=UCMAXLConnector()# env vars for connection params# adding phonesipphone_attributes={"name":"SEPDEADDEADDEAD","product":"Cisco 8821","devicePoolName":"US_NYC_DP",}axl.phone.add(**ipphone_attributes)# api endpoints can be created prior to invoking axl method-calling for pre-processingnew_bot_device=axl.phone.create()# very useful API template development!withopen("/path/to/templates/phone.json","w")as_:json.dump(axl.phone.model(),_,indent=4)# getting existing phones with null-string dicts or lists of `returnedTags`dead_device=axl.phone.get(name="SEPDEADDEADDEAD",returnedTags={"name":"","devicePoolName":"","callingSearchSpaceName":""})beefy_device=axl.phone.get(name="SEPBEEFBEEFBEEF",returnedTags=["name","devicePoolName","callingSearchSpaceName"])# listing phones by namenyc_bot_attrs={"name":"BOT%","devicePoolName":"US_NYC%","callingSearchSpaceName":"US_%"}nyc_bot_devices=axl.phone.list(searchCriteria=nyc_bot_attrs,returnedTags=["name","description","lines"])# implicit "return all" available for `searchCriteria` and `returnedTags`# use sparingly for large data sets!all_devices=axl.phone.list()# property-like getters and settersbotuser15=next(filter(lambdaperson:person.name=='BOTUSER015',nyc_bot_devices))botuser15.callingSearchSpaceName="US_NYC_NATIONAL_CSS"# updating a phonebotuser15.callingSearchSpaceName="US_NYC_INTERNATIONAL_CSS"botuser15.newName="BOTJONELS"botuser15.locationName="Hub_None"axl.phone.update(name=botuser15.name,newName=botuser15.newName,callingSearchSpaceName=botuser15.callingSearchSpaceName,locationName=botuser15.locationName)# deleting a phoneaxl.phone.remove(uuid=botuser15.uuid)# Thin AXL sql querying and execution also availablenumplan=axl.sql.query("SELECT * FROM numplan")directory_numbers=[row['dnorpattern']forrowinnumplan]numplan.csv(destination_path="/path/to/datadump/numplan.csv")# pathlib also supportedConnector Environment VariablesThe following env vars are supported for ease of use:AXL_USERNAMEAXL_PASSWORDAXL_WSDL_URLAXL_FQDNAXL WSDLThe package includes the AXL wsdl for ease of use.  The schema will be updated regularly to match the latest CUCM
releases.  By default, unless an AXL version is specified, thecurrentWSDL will be used.Due to the strictness ofpython-zeep’s WSDL and .xsd parsing, numerous AXL defects have been encountered during
development and testing.  As a result, the packaged WSDL and .xsd filesmayinclude patches to mitigate defects
where applicable.  Known AXL defects which have resulted in patches are catalogued in
AXL_DEFECTS.rst.If you require a more up-to-date WSDL, or are uncomfortable with using a patched schema, allUCSOAPConnectoraccept a direct path to a local WSDL file as input.API Endpoint SupportNot all API Endpoints are supported, as API and data models are required to mitigate inconsistencies in the
AXL API.  If you’d like to extend API support, please create a pull request, or raise a GitHub issue and I’ll add
an enhancement.I am not currently back-testing all version support, and do not intend to test against pre-9 UCM versions.  The package
has been developed primarily against UCM 11.5.  If any API definitions interfere with the backwards compatibility of
AXL for prior versions, please raise a GitHub issue and I will address this.Supported Languages and AXL VersionsCurrently only Python 3.6+ is supported.   There are no plans to support Python 2.7.All AXL versionsshouldbe supported, however only 11.5 has been currently tested.  All AXL data models include
static metadata on mandatory params foraddcalls.  It  is not expected that these should change across AXL
schema versions.  Please raise a defect if you encounter any issues.Other API methods should contain reliable schema-driven metadata and attributes.DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxDonateIf this library has helped you, or if you would like to support future development, donations are most welcome:CryptocurrencyAddressBTC38c7QWggrB2HLUJZFmhAC2zh4t8C57c1ecETH0x01eD3b58a07c6d005281Db76e6c1AE2bfF2226ADSupportI’m open to discussing ad-hoc commercial support or custom DevOps implementations. Please contact me atjonathanelscpt@gmail.comfor more information. Note that asking questions or reporting bugs via this e-mail address
may not receive responses. Please rather create GitHub issues for this.Changelog0.0.0 (2019-12-30)First alpha release.