Skip to main content

ciscoisesdk

ciscoisesdk is a community developed Python library for working with the Identity Services Engine APIs. Our goal is to make working with Cisco Identity Services Engine in Python a native and natural experience!

The quickest way to check that your credentials and API settings work is to ask ISE for its version and patch level:

from ciscoisesdk import IdentityServicesEngineAPI

api = IdentityServicesEngineAPI(username='admin',
                                password='C1sco12345',
                                uses_api_gateway=True,
                                base_url='https://198.18.133.27',
                                verify=True,
                                uses_csrf_token=False)

print(api.version_and_patch.get_ise_version_and_patch().response)
# {'OperationResult': {'resultValue': [{'value': '3.4.0.608', 'name': 'version'},
#                                      {'value': '3', 'name': 'patch information'}]}}

The same check with certificate-based (mTLS) authentication, available since Cisco ISE 3.3:

api = IdentityServicesEngineAPI(base_url='https://198.18.133.27',
                                uses_api_gateway=True,
                                client_cert='apiuser-cert.pem',
                                client_key='apiuser-key.pem',
                                verify=False,
                                uses_csrf_token=False)

print(api.version_and_patch.get_ise_version_and_patch().response)

A more complete example:

from ciscoisesdk import IdentityServicesEngineAPI
from ciscoisesdk.exceptions import ApiError

# Create a IdentityServicesEngineAPI connection object;
# it uses ISE custom URL, username, and password, with ISE API version 3.3_patch_1
# and its API Gateway enabled,
# verify=True to verify the server's TLS certificate
# with debug logs disabled
# and without using the CSRF token
api = IdentityServicesEngineAPI(username='admin',
                                password='C1sco12345',
                                uses_api_gateway=True,
                                base_url='https://198.18.133.27',
                                version='3.3_patch_1',
                                verify=True,
                                client_cert='/path/to/client.crt',
                                client_key='/path/to/client.key',
                                debug=False,
                                uses_csrf_token=False)
# NOTE: This collection assumes that the ERS APIs and OpenAPIs are enabled.
# For mTLS, you can also set verify to a CA bundle path:
# verify='/path/to/ca-bundle.pem'
# If your ISE is configured for certificate-only API auth, you can omit
# username/password and encoded_auth when using client_cert/client_key.

# Get allowed protocols (first page)
search_result = api.allowed_protocols.get_all().response.SearchResult
if search_result and search_result.resources:
  for resource in search_result.resources:
    resource_detail = api.allowed_protocols.get_by_id(
                        resource.id
                      ).response.AllowedProtocols
    print("Id {}\nName {}\nallowChap {}\n".format(resource_detail.id,
                                                  resource_detail.name,
                                                  resource_detail.allowChap))
print("----------")

# Handle pagination with a generator
allowed_protols_gen = api.allowed_protocols.get_all_generator()
for allowed_protocols_page_resp in allowed_protols_gen:
  allowed_protols_result = allowed_protocols_page_resp.response.SearchResult
  for resource in allowed_protols_result.resources:
    resource_detail = api.allowed_protocols.get_by_id(
                        resource.id
                      ).response.AllowedProtocols
    print("Id {}\nName {}\nallowChap {}\n".format(resource_detail.id,
                                                  resource_detail.name,
                                                  resource_detail.allowChap))

# Create network device
try:
    network_device_response = api.network_device.create(
                                name='ISE_EST_Local_Host_19',
                                network_device_iplist=[{"ipaddress": "127.35.0.1", "mask": 32}])
    print("Created, new Location {}".format(network_device_response.headers.Location))
except ApiError as e:
    print(e)

# Filter network device
device_list_response = api.network_device.get_all(filter='name.EQ.ISE_EST_Local_Host_19')
device_responses = device_list_response.response.SearchResult.resources
if len(device_responses) > 0:
    device_response = device_responses[0]

    # Get network device detail
    device_response_detail = api.network_device.get_by_id(device_response.id).response.NetworkDevice

# Advance usage example using Custom Caller functions
## Define a Custom caller named function
## Call them with:
##    get_created_result(network_device_response.headers.Location)
def get_created_result(location):
    return api.custom_caller.call_api('GET', location)

## Define the get_created_result function
## under the custom_caller wrapper.
## Call them with:
##    api.custom_caller.get_created_result(network_device_response.headers.Location)
def setup_custom():
    api.custom_caller.add_api('get_created_result',
                                lambda location:
                                api.custom_caller.call_api('GET', location)
                              )

# Add the custom API calls to the connection object under the custom_caller wrapper
setup_custom()

# Call the newly added functions
created_device_1 = get_created_result(network_device_response.headers.Location)
created_device_2 = api.custom_caller.get_created_result(network_device_response.headers.Location)
print(created_device_1.response == created_device_2.response)

if len(device_responses) > 0:
    device_response = device_responses[0]

    # Delete network device
    delete_device = api.network_device.delete_by_id(device_response.id)

Introduction

Installation

Installing and upgrading ciscoisesdk is easy:

Install via PIP

$ pip install ciscoisesdk

Upgrading to the latest Version

$ pip install ciscoisesdk --upgrade

Compatibility matrix

The following table shows the supported versions.

Cisco ISE version

Python “ciscoisesdk” version

3.1.0

1.2.0

3.1_Patch_1

2.0.12

3.2_beta

2.1.2

3.3_patch_1

2.3.1

3.5.0

2.4.x

If your SDK is older please consider updating it first.

Documentation

Excellent documentation is now available at: https://ciscoisesdk.readthedocs.io

Check out the Quickstart to dive in and begin using ciscoisesdk.

Release Notes

Please see the releases page for release notes on the incremental functionality and bug fixes incorporated into the published releases.

Questions, Support & Discussion

ciscoisesdk is a community developed and community supported project. If you experience any issues using this package, please report them using the issues page.

Contribution

ciscoisesdk is a community development projects. Feedback, thoughts, ideas, and code contributions are welcome! Please see the Contributing guide for more information.

Inspiration

This library is inspired by the webexteamssdk library

Change log

All notable changes to this project will be documented in the CHANGELOG file.

The development team may make additional name changes as the library evolves with the ISE APIs.

Copyright (c) 2021 Cisco and/or its affiliates.

Metadata

Release files for ciscoisesdk 2.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ciscoisesdk 2.4.7
File Size Uploaded
ciscoisesdk-2.4.7.tar.gz 2.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ciscoisesdk 2.4.7
File Interpreter ABI Platform
ciscoisesdk-2.4.7-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 MB

Release files / ciscoisesdk-2.4.7.tar.gz

Download URL ciscoisesdk-2.4.7.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
5ac8c67db1e2f3442d9568b68817d1b5a4d8d72a8026274b0f12500a975d8edd
BLAKE2b-256 checksum
How to use checksums
d2019d9cb91c18459dfc5a52ddf8709680e4dfe3200e43563404d9857cc146cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Darwin/25.2.0

Release files / ciscoisesdk-2.4.7-py3-none-any.whl

Download URL ciscoisesdk-2.4.7-py3-none-any.whl
Size 6.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
12b1de806c2504b90a76634fc8f619f127b5db0e8b81c5f663efe3433e280b66
BLAKE2b-256 checksum
How to use checksums
06cb1ca65bd55d95e47ac5ec5fbccfdebc606b1ef0bd3e7d43a72b0a78fa813f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Darwin/25.2.0

Release history Release notifications | RSS feed

This release

2.4.7 This release

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.12

2 release files

2.0.11

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page