### Install In-Development Version Source: https://ciscocucmapi.readthedocs.io/en/latest/installation.html Install the latest in-development version directly from the GitHub repository. ```bash pip install https://github.com/jonathanelscpt/ciscocucmapi/archive/master.zip ``` -------------------------------- ### Quick Start: Initialize Connector and Add Phone Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Initialize the UCMAXLConnector with credentials and FQDN, then add a new phone with specified attributes. ```python from ciscocucmapi import UCMAXLConnector import json axl = UCMAXLConnector(username='axl', password='password', fqdn='192.168.99.99') # adding phones ipphone_attributes = { "name": "SEPDEADDEADDEAD", "product": "Cisco 8821", "devicePoolName": "US_NYC_DP", } axl.phone.add(**ipphone_attributes) ``` -------------------------------- ### Install Stable Release Source: https://ciscocucmapi.readthedocs.io/en/latest/installation.html Install the latest stable version of the ciscocucmapi package from PyPI. ```bash pip install ciscocucmapi ``` -------------------------------- ### Quick Start: Get Existing Phones Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Retrieve existing phones by name, specifying returned tags as either null-string dictionaries or lists. ```python # 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"]) ``` -------------------------------- ### Quick Start: Create Phone Template Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Create a new bot device using a template and dump the model to a JSON file for pre-processing. ```python # api endpoints can be created prior to invoking axl method-calling for pre-processing new_bot_device = axl.phone.create() # very useful API template development! with open("/path/to/templates/phone.json", "w") as _: json.dump(axl.phone.model(), _, indent=4) ``` -------------------------------- ### Quick Start: List Phones by Name Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html List phones matching specific criteria for name, device pool, and calling search space. Implicit 'return all' is available but should be used sparingly. ```python # listing phones by name nyc_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() ``` -------------------------------- ### Run all test environments in parallel Source: https://ciscocucmapi.readthedocs.io/en/latest/contributing.html Use detox to run all configured test environments concurrently. Ensure detox is installed via pip. ```bash detox ``` -------------------------------- ### Quick Start: Delete Phone Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Delete a phone using its UUID. ```python # deleting a phone axl.phone.remove(uuid=botuser15.uuid) ``` -------------------------------- ### Quick Start: Update Phone Properties Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Access and modify phone properties like calling search space, new name, and location. Update the phone using the axl.phone.update method. ```python # property-like getters and setters botuser15 = next(filter(lambda person: person.name == 'BOTUSER015', nyc_bot_devices)) botuser15.callingSearchSpaceName = "US_NYC_NATIONAL_CSS" # updating a phone botuser15.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) ``` -------------------------------- ### Quick Start: SQL Query and CSV Export Source: https://ciscocucmapi.readthedocs.io/en/latest/readme.html Perform thin AXL SQL queries, extract specific data, and export query results to a CSV file. Pathlib is also supported for destination paths. ```python # Thin AXL sql querying and execution also available numplan = axl.sql.query("SELECT * FROM numplan") directory_numbers = [row['dnorpattern'] for row in numplan] numplan.csv(destination_path="/path/to/datadump/numplan.csv") # pathlib also supported ``` -------------------------------- ### Initialize UCMAXLConnector with Direct Arguments Source: https://ciscocucmapi.readthedocs.io/en/latest/env.html Provide connection details directly as arguments to UCMAXLConnector when environment variables are not used or need to be overridden. ```python UCMAXLConnector(username='axl', password='password', fqdn='192.168.99.99') ``` -------------------------------- ### Initialize UCMAXLConnector with Environment Variables Source: https://ciscocucmapi.readthedocs.io/en/latest/env.html Use this snippet to initialize the UCMAXLConnector when environment variables like AXL_USERNAME, AXL_PASSWORD, and AXL_FQDN are set. ```python UCMAXLConnector() ``` -------------------------------- ### Run All Tests with Tox Source: https://ciscocucmapi.readthedocs.io/en/latest/development.html Execute all tests using the tox testing framework. This is the primary command for running the test suite. ```bash tox ``` -------------------------------- ### Clone the ciscocucmapi repository Source: https://ciscocucmapi.readthedocs.io/en/latest/contributing.html Clone your forked repository locally to begin development. ```git git clone git@github.com:jonathanelscpt/ciscocucmapi.git ``` -------------------------------- ### Commit and push changes Source: https://ciscocucmapi.readthedocs.io/en/latest/contributing.html Stage, commit, and push your local changes to your GitHub branch. ```git git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Combine Coverage Data on Windows Source: https://ciscocucmapi.readthedocs.io/en/latest/development.html On Windows, set the PYTEST_ADDOPTS environment variable to append coverage data before running tox. This allows for consolidated coverage reports across different test environments. ```bash set PYTEST_ADDOPTS=--cov-append tox ``` -------------------------------- ### Import Cisco CUCM API Source: https://ciscocucmapi.readthedocs.io/en/latest/usage.html Import the ciscocucmapi library to begin using its functionalities in your Python project. This is the initial step for any integration. ```python import ciscocucmapi ``` -------------------------------- ### Create a new branch for development Source: https://ciscocucmapi.readthedocs.io/en/latest/contributing.html Create a new branch for your bug fix or feature development. ```git git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Combine Coverage Data on Other Systems Source: https://ciscocucmapi.readthedocs.io/en/latest/development.html On systems other than Windows, set the PYTEST_ADDOPTS environment variable to append coverage data before running tox. This enables the aggregation of coverage reports. ```bash PYTEST_ADDOPTS=--cov-append tox ``` -------------------------------- ### Run a subset of tests with tox Source: https://ciscocucmapi.readthedocs.io/en/latest/contributing.html Execute a specific subset of tests by specifying the environment name and a pytest filter. ```bash tox -e envname -- pytest -k test_myfeature ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.