# serviceability-python-zeep-samples **Repository Path**: mirrors_CiscoDevNet/serviceability-python-zeep-samples ## Basic Information - **Project Name**: serviceability-python-zeep-samples - **Description**: Sample scripts demonstrating usage of various Cisco CUCM Serviceability APIs using Python and the Zeep SOAP library - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-22 - **Last Updated**: 2026-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # serviceability-python-zeep-samples ## Overview Sample scripts demonstrating usage of various Cisco CUCM Serviceability APIs using Python and the Zeep SOAP library. https://developer.cisco.com/site/sxml/ ## Available samples * `risport70_selectCmDevice.py` - Demonstrates querying for all device registrations using Risport (``) * `perfmonPort_collect_counter_data.py` - Demonstrates retrieving and parsing performance counter data via the Perfmon `` request * `services_getProductInformationList.py` - Use Control Center Services to retrieve a list of the installed Products and versions (``) * `perfmonPort_collectSession_data.py` - (Mac/Linux only) Uses Perfmonport to start a collection session, add example counters, then periodically retrieve/parse the results (``, ``,``) * `logCollection_GetOneFile.py` - Performs a listing of log files available for a specific service (Cisco Audit Logs), retrieves the contents of the latest file, then parses/prints a few lines of the results (``, ``) * `services_soapGetServiceStatus.py` - Performs a `` request using the Zeep SOAP library. * `services_doControlServices.py` - Performs a `` request using the Zeep SOAP library, periodically checks the status using `` and parses/prints the results in a simple table output. Tested using: * Ubuntu 21.04 / Python 3.9.5 * Mac OS 11.4 / Python 3.9.6 ## Getting started * Install Python 3 (On Windows, choose the option to add to PATH environment variable) * Clone this repository: ```bash git clone https://www.github.com/CiscoDevNet/serviceability-python-zeep-samples cd serviceability-python-zeep-samples ``` * (Optional) Create/activate a Python virtual environment named `venv`: ```bash python3 -m venv venv source venv/bin/activate ``` * Install needed dependency packages: ```bash pip install -r requirements.txt ``` * Open the project in Visual Studio Code: ```bash code . ``` * Rename the file `.env.example` to `.env` and edit to specify your CUCM address and [Serviceability API user credentials](https://d1nmyq4gcgsfi5.cloudfront.net/site/sxml/help/faq/#sec-1) * The Serviceability SOAP API WSDL files for CUCM v12.5 are included in this project. If you'd like to use a different version, replace the files in `schema/` with the versions from your CUCM, which can be retrieved at: * CDRonDemand: `https://{cucm}/CDRonDemandService2/services/CDRonDemandService?wsdl` * Log Collection: `https://{cucm}:8443/logcollectionservice2/services/LogCollectionPortTypeService?wsdl` * PerfMon: `https://{cucm}:8443/perfmonservice2/services/PerfmonService?wsdl` * RisPort70: `https://{cucm}:8443/realtimeservice2/services/RISService70?wsdl` * Control Center Services: `https://{cucm}:8443/controlcenterservice2/services/ControlCenterServices?wsdl` * Control Center Services Extended: `https://{cucm}:8443/controlcenterservice2/services/ControlCenterServicesEx?wsdl` ## Hints * You can get a 'dump' of an API WSDL to see how Zeep interprets it, for example by running (Mac/Linux): ```bash python -mzeep schema/PerfmonService.wsdl > PerfmonServiceWsdl.txt ``` This can help with identifying the proper object structure to send to Zeep * Elements which contain a list, such as: ```xml ``` are represented a little differently than expected by Zeep. Note that `` becomes an array, not ``: ```python { 'members': { 'member': [ { 'subElement1': 'value', 'subElement2': 'value' }, { 'subElement1': 'value', 'subElement2': 'value' } ] } } ```