Skip to main content

Cisco Identity Services Engine Platform SDK

Project description

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!

from ciscoisesdk import IdentityServicesEngineAPI
from ciscoisesdk.exceptions import ApiError

api = IdentityServicesEngineAPI(verify=False, debug=False)

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

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

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

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

# Create network device
try:
    network_device_response = api.network_device.create_networkdevice(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)

# 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)

Introduction

Installation

Installing and upgrading ciscoisesdk is easy:

Install via PIP

$ pip install ciscoisesdk

Upgrading to the latest Version

$ pip install ciscoisesdk --upgrade

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ciscoisesdk-0.1.2.tar.gz (165.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ciscoisesdk-0.1.2-py3-none-any.whl (530.4 kB view details)

Uploaded Python 3

File details

Details for the file ciscoisesdk-0.1.2.tar.gz.

File metadata

  • Download URL: ciscoisesdk-0.1.2.tar.gz
  • Upload date:
  • Size: 165.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.3 Darwin/20.3.0

File hashes

Hashes for ciscoisesdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e883e7cf0931f83c3638e87f3bab54e3fd182d70e5fea14416a69b059bacb0ec
MD5 ecabe783a5ce4379453fff9c9640b7a0
BLAKE2b-256 d7f66f4e0a912771db22d45dc33a3bfcac3b4aec86b453d350b7292b1d7db103

See more details on using hashes here.

File details

Details for the file ciscoisesdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ciscoisesdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 530.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.3 Darwin/20.3.0

File hashes

Hashes for ciscoisesdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d8fcbadfbf6c0adf90211768360793080fe2a4f0674874b0ba95ff627e484fe
MD5 bc7c243e68be8ced3d2c70d254cfbe9e
BLAKE2b-256 d9f50f4eb42db404a57022e3b9955e9f8e32415acb7f5e8a7cba94b78595cdfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page