Cisco Identity Services Engine Platform SDK

2.4.3 · active · verified Wed Apr 15

The `ciscoisesdk` is a community-developed Python SDK for interacting with Cisco Identity Services Engine (ISE) APIs. It provides a Pythonic wrapper around the RESTful ISE APIs, simplifying tasks like network device management, user authentication, and policy configuration. The library is currently at version 2.4.3 and sees frequent minor and patch releases, indicating active development.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the `IdentityServicesEngineAPI` client using environment variables for credentials and then make a basic API call to retrieve all configured network devices. It includes error handling for API-specific and general exceptions. Remember to replace placeholder values or set environment variables.

import os
from ciscoisesdk import IdentityServicesEngineAPI, ApiError

# Set these environment variables for authentication
# IDENTITY_SERVICES_ENGINE_USERNAME
# IDENTITY_SERVICES_ENGINE_PASSWORD
# IDENTITY_SERVICES_ENGINE_BASE_URL
# IDENTITY_SERVICES_ENGINE_VERSION (e.g., '3.3_patch_1' or '3.5.0')

username = os.environ.get('IDENTITY_SERVICES_ENGINE_USERNAME', 'YOUR_ISE_USERNAME')
password = os.environ.get('IDENTITY_SERVICES_ENGINE_PASSWORD', 'YOUR_ISE_PASSWORD')
base_url = os.environ.get('IDENTITY_SERVICES_ENGINE_BASE_URL', 'https://your-ise-server.example.com')
version = os.environ.get('IDENTITY_SERVICES_ENGINE_VERSION', '3.3_patch_1')

try:
    # Create a connection object
    api = IdentityServicesEngineAPI(
        username=username,
        password=password,
        base_url=base_url,
        version=version,
        uses_api_gateway=True, # Often True for modern ISE deployments
        verify=False # Set to True in production with proper CA-signed certs
    )

    # Example: Get all network devices
    print(f"Attempting to retrieve network devices from {base_url} (ISE version: {version})...")
    network_devices_response = api.network_device.get_all()

    if network_devices_response and network_devices_response.response:
        print("Successfully retrieved network devices:")
        for device in network_devices_response.response:
            print(f"  ID: {device.get('id')}, Name: {device.get('name')}")
    else:
        print("No network devices found or unexpected response.")

except ApiError as e:
    print(f"API Error: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

view raw JSON →