### Install dnacentersdk using PIP Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Instructions for installing the dnacentersdk Python package using pip. This is the primary method for obtaining the library for use in your projects. ```bash pip install dnacentersdk ``` -------------------------------- ### Configuring Logging for dnacentersdk Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Provides an example of how to configure logging for the dnacentersdk. This allows you to monitor the SDK's activity, debug issues, and track API interactions. ```python import logging from dnacentersdk import DNACenterAPI # Configure basic logging logging.basicConfig(level=logging.INFO) dnac = DNACenterAPI(log_level=logging.DEBUG) # Set SDK's internal log level try: response = dnac.devices.get_device_list() print(response) except Exception as e: logging.error(f"An error occurred: {e}") ``` -------------------------------- ### Get dnacentersdk Source Code Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Instructions on how to obtain the source code for the dnacentersdk. This is useful for developers who want to contribute to the project or inspect the code. ```bash git clone ``` -------------------------------- ### Making API Calls with dnacentersdk Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index A basic example of making an API call to Cisco DNA Center using the dnacentersdk. This demonstrates the fundamental pattern for retrieving data or performing actions via the SDK. ```python from dnacentersdk import DNACenterAPI dnac = DNACenterAPI() # Example: Get device list response = dnac.devices.get_device_list() print(response) ``` -------------------------------- ### Create DNACenterAPI Connection Object Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Example of creating a connection object for the DNACenterAPI using the dnacentersdk. This object is essential for authenticating and interacting with the Cisco DNA Center. ```python from dnacentersdk import DNACenterAPI dnac = DNACenterAPI(username='your_username', password='your_password', base_url='https://your-dna-center-ip', verify=False) # Or using environment variables: dnac = DNACenterAPI() ``` -------------------------------- ### Upgrade dnacentersdk using PIP Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Instructions for upgrading an existing installation of the dnacentersdk Python package to the latest version using pip. This ensures you have the most recent features and bug fixes. ```bash pip install --upgrade dnacentersdk ``` -------------------------------- ### Set DNA Center Credentials as Environment Variables Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Demonstrates how to set Cisco DNA Center credentials as environment variables. This is a common and recommended practice for securely managing sensitive information when interacting with the API. ```bash export DNA_CENTER_USERNAME='your_username' export DNA_CENTER_PASSWORD='your_password' export DNA_CENTER_BASE_URL='https://your-dna-center-ip' export DNA_CENTER_PORT='443' ``` -------------------------------- ### Working with Returned Objects in dnacentersdk Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Demonstrates how to access and process the data returned from API calls made using the dnacentersdk. The SDK often returns structured objects that can be easily manipulated. ```python from dnacentersdk import DNACenterAPI dnac = DNACenterAPI() response = dnac.devices.get_device_list() if response and 'response' in response: for device in response['response']: print(f"Device Name: {device.get('hostname')}, Management IP: {device.get('managementIpAddress')}") ``` -------------------------------- ### Catching Exceptions with dnacentersdk Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Shows how to handle potential exceptions that may occur during API calls made with the dnacentersdk. Proper error handling is crucial for robust applications. ```python from dnacentersdk import DNACenterAPI from dnacentersdk.exceptions import DNACenterException dnac = DNACenterAPI() try: response = dnac.devices.get_device_list() print(response) except DNACenterException as e: print(f"An error occurred: {e}") ``` -------------------------------- ### Accessing Package Constants in dnacentersdk Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index Illustrates how to access default constants provided by the dnacentersdk package. These constants can be useful for configuring SDK behavior or understanding default settings. ```python from dnacentersdk.base.api_client import DEFAULT_DEBUG, DEFAULT_VERSION, DEFAULT_BASE_URL, DEFAULT_SINGLE_REQUEST_TIMEOUT, DEFAULT_WAIT_ON_RATE_LIMIT, DEFAULT_VERIFY, DEFAULT_VERIFY_USER_AGENT print(f"Default Debug: {DEFAULT_DEBUG}") print(f"Default Version: {DEFAULT_VERSION}") ``` -------------------------------- ### DNACenterAPI v2.3.5.3 Endpoints Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index This section details the API endpoints available in DNACenterAPI version 2.3.5.3. ```APIDOC ## DNACenterAPI v2.3.5.3 Endpoints ### Description This section lists the available API modules and their functionalities for DNACenterAPI version 2.3.5.3. ### Modules - `application_policy` - `applications` - `authentication_management` - `cisco_dna_center_system` - `clients` - `command_runner` - `compliance` - `configuration_archive` - `configuration_templates` - `device_onboarding_pnp` - `device_replacement` - `devices` - `discovery` - `eox` - `event_management` - `fabric_wireless` - `file` - `health_and_performance` - `itsm` - `itsm_integration` - `issues` - `lan_automation` - `licenses` - `network_settings` - `path_trace` - `platform` - `reports` - `sda` - `security_advisories` - `sensors` - `site_design` - `sites` - `software_image_management_swim` - `system_settings` - `tag` - `task` - `topology` - `user_and_roles` - `users` - `wireless` ``` -------------------------------- ### DNACenterAPI v3.1.3.0 Endpoints Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index This section details the API endpoints available in DNACenterAPI version 3.1.3.0. ```APIDOC ## DNACenterAPI v3.1.3.0 Endpoints ### Description This section lists the available API modules and their functionalities for DNACenterAPI version 3.1.3.0. ### Modules - `ai_endpoint_analytics` - `application_policy` - `applications` - `authentication_management` - `backup` - `cisco_i_m_c` - `cisco_trusted_certificates` - `clients` - `command_runner` - `compliance` - `configuration_archive` - `configuration_templates` - `device_onboarding_pnp` - `device_replacement` - `devices` - `disaster_recovery` - `discovery` - `eox` - `event_management` - `fabric_wireless` - `file` - `health_and_performance` - `itsm` - `itsm_integration` - `industrial_configuration` - `issues` - `know_your_network` - `lan_automation` - `licenses` - `network_settings` - `path_trace` - `platform` - `reports` - `restore` - `sda` - `security_advisories` - `sensors` - `site_design` - `sites` - `software_image_management_swim` - `system_settings` - `tag` - `task` - `topology` - `userand_roles` - `users` - `wired` ``` -------------------------------- ### DNACenterAPI v2.3.7.6 Endpoints Source: https://dnacentersdk.readthedocs.io/en/latest/index.html/index This section details the API endpoints available in DNACenterAPI version 2.3.7.6. ```APIDOC ## DNACenterAPI v2.3.7.6 Endpoints ### Description This section lists the available API modules and their functionalities for DNACenterAPI version 2.3.7.6. ### Modules - `ai_endpoint_analytics` - `application_policy` - `applications` - `authentication_management` - `cisco_trusted_certificates` - `clients` - `command_runner` - `compliance` - `configuration_archive` - `configuration_templates` - `device_onboarding_pnp` - `device_replacement` - `devices` - `disaster_recovery` - `discovery` - `eox` - `event_management` - `fabric_wireless` - `file` - `health_and_performance` - `itsm` - `itsm_integration` - `issues` - `lan_automation` - `licenses` - `network_settings` - `path_trace` - `platform` - `reports` - `sda` - `security_advisories` - `sensors` - `site_design` - `sites` - `software_image_management_swim` - `system_settings` - `tag` - `task` - `topology` - `user_and_roles` - `users` - `wireless` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.