ciscoisesdk


Nameciscoisesdk JSON
Version 2.2.0 PyPI version JSON
download
home_pagehttps://ciscoisesdk.readthedocs.io/en/latest/
SummaryCisco Identity Services Engine Platform SDK
upload_time2024-04-24 23:36:48
maintainerNone
docs_urlNone
authorJose Bogarin Solano
requires_python<4.0,>=3.6
licenseMIT
keywords cisco identity services engine sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============
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!

.. code-block:: python

    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,
                                    debug=False,
                                    uses_csrf_token=False)
    # NOTE: This collection assumes that the ERS APIs and OpenAPIs are enabled.

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

.. code-block:: bash

    $ pip install ciscoisesdk

**Upgrading to the latest Version**

.. code-block:: bash

    $ pip install ciscoisesdk --upgrade


Compatibility matrix
--------------------
The following table shows the supported versions.

.. list-table::
   :widths: 50 50
   :header-rows: 1

   * - 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.2.0

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.*

.. _Introduction: https://ciscoisesdk.readthedocs.io/en/latest/api/intro.html
.. _ciscoisesdk.readthedocs.io: https://ciscoisesdk.readthedocs.io
.. _Quickstart: https://ciscoisesdk.readthedocs.io/en/latest/api/quickstart.html
.. _ciscoisesdk: https://github.com/CiscoISE/ciscoisesdk
.. _issues: https://github.com/CiscoISE/ciscoisesdk/issues
.. _pull requests: https://github.com/CiscoISE/ciscoisesdk/pulls
.. _releases: https://github.com/CiscoISE/ciscoisesdk/releases
.. _the repository: ciscoisesdk_
.. _pull request: `pull requests`_
.. _Contributing: https://github.com/CiscoISE/ciscoisesdk/blob/master/docs/contributing.rst
.. _webexteamssdk: https://github.com/CiscoDevNet/webexteamssdk
.. _CHANGELOG: https://github.com/CiscoISE/ciscoisesdk/blob/main/CHANGELOG.md

            

Raw data

            {
    "_id": null,
    "home_page": "https://ciscoisesdk.readthedocs.io/en/latest/",
    "name": "ciscoisesdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.6",
    "maintainer_email": null,
    "keywords": "Cisco, Identity Services Engine, SDK",
    "author": "Jose Bogarin Solano",
    "author_email": "jbogarin@cloverhound.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/48/a9e5b5c455698229834fb654f178bcc7fbb8412133ba32548c3d0e8f2b9e/ciscoisesdk-2.2.0.tar.gz",
    "platform": null,
    "description": "=============\nciscoisesdk\n=============\n\n**ciscoisesdk** is a *community developed* Python library for working with the Identity Services Engine APIs. \nOur goal is to make working with Cisco Identity Services Engine in Python a *native* and *natural* experience!\n\n.. code-block:: python\n\n    from ciscoisesdk import IdentityServicesEngineAPI\n    from ciscoisesdk.exceptions import ApiError\n\n    # Create a IdentityServicesEngineAPI connection object;\n    # it uses ISE custom URL, username, and password, with ISE API version 3.3_patch_1\n    # and its API Gateway enabled,\n    # verify=True to verify the server's TLS certificate\n    # with debug logs disabled\n    # and without using the CSRF token\n    api = IdentityServicesEngineAPI(username='admin',\n                                    password='C1sco12345',\n                                    uses_api_gateway=True,\n                                    base_url='https://198.18.133.27',\n                                    version='3.3_patch_1',\n                                    verify=True,\n                                    debug=False,\n                                    uses_csrf_token=False)\n    # NOTE: This collection assumes that the ERS APIs and OpenAPIs are enabled.\n\n    # Get allowed protocols (first page)\n    search_result = api.allowed_protocols.get_all().response.SearchResult\n    if search_result and search_result.resources:\n      for resource in search_result.resources:\n        resource_detail = api.allowed_protocols.get_by_id(\n                            resource.id\n                          ).response.AllowedProtocols\n        print(\"Id {}\\nName {}\\nallowChap {}\\n\".format(resource_detail.id,\n                                                      resource_detail.name,\n                                                      resource_detail.allowChap))\n    print(\"----------\")\n\n    # Handle pagination with a generator\n    allowed_protols_gen = api.allowed_protocols.get_all_generator()\n    for allowed_protocols_page_resp in allowed_protols_gen:\n      allowed_protols_result = allowed_protocols_page_resp.response.SearchResult\n      for resource in allowed_protols_result.resources:\n        resource_detail = api.allowed_protocols.get_by_id(\n                            resource.id\n                          ).response.AllowedProtocols\n        print(\"Id {}\\nName {}\\nallowChap {}\\n\".format(resource_detail.id,\n                                                      resource_detail.name,\n                                                      resource_detail.allowChap))\n\n    # Create network device\n    try:\n        network_device_response = api.network_device.create(\n                                    name='ISE_EST_Local_Host_19',\n                                    network_device_iplist=[{\"ipaddress\": \"127.35.0.1\", \"mask\": 32}])\n        print(\"Created, new Location {}\".format(network_device_response.headers.Location))\n    except ApiError as e:\n        print(e)\n\n    # Filter network device\n    device_list_response = api.network_device.get_all(filter='name.EQ.ISE_EST_Local_Host_19')\n    device_responses = device_list_response.response.SearchResult.resources\n    if len(device_responses) > 0:\n        device_response = device_responses[0]\n\n        # Get network device detail\n        device_response_detail = api.network_device.get_by_id(device_response.id).response.NetworkDevice\n\n    # Advance usage example using Custom Caller functions\n    ## Define a Custom caller named function\n    ## Call them with:\n    ##    get_created_result(network_device_response.headers.Location)\n    def get_created_result(location):\n        return api.custom_caller.call_api('GET', location)\n\n    ## Define the get_created_result function\n    ## under the custom_caller wrapper.\n    ## Call them with:\n    ##    api.custom_caller.get_created_result(network_device_response.headers.Location)\n    def setup_custom():\n        api.custom_caller.add_api('get_created_result',\n                                    lambda location:\n                                    api.custom_caller.call_api('GET', location)\n                                  )\n\n    # Add the custom API calls to the connection object under the custom_caller wrapper\n    setup_custom()\n\n    # Call the newly added functions\n    created_device_1 = get_created_result(network_device_response.headers.Location)\n    created_device_2 = api.custom_caller.get_created_result(network_device_response.headers.Location)\n    print(created_device_1.response == created_device_2.response)\n\n    if len(device_responses) > 0:\n        device_response = device_responses[0]\n\n        # Delete network device\n        delete_device = api.network_device.delete_by_id(device_response.id)\n\n\n\nIntroduction_\n\n\nInstallation\n------------\n\nInstalling and upgrading ciscoisesdk is easy:\n\n**Install via PIP**\n\n.. code-block:: bash\n\n    $ pip install ciscoisesdk\n\n**Upgrading to the latest Version**\n\n.. code-block:: bash\n\n    $ pip install ciscoisesdk --upgrade\n\n\nCompatibility matrix\n--------------------\nThe following table shows the supported versions.\n\n.. list-table::\n   :widths: 50 50\n   :header-rows: 1\n\n   * - Cisco ISE version\n     - Python \"ciscoisesdk\" version\n   * - 3.1.0\n     - 1.2.0\n   * - 3.1_Patch_1\n     - 2.0.12\n   * - 3.2_beta\n     - 2.1.2\n   * - 3.3_patch_1\n     - 2.2.0\n\nIf your SDK is older please consider updating it first.\n\nDocumentation\n-------------\n\n**Excellent documentation is now available at:**\nhttps://ciscoisesdk.readthedocs.io\n\nCheck out the Quickstart_ to dive in and begin using ciscoisesdk.\n\n\nRelease Notes\n-------------\n\nPlease see the releases_ page for release notes on the incremental functionality and bug fixes incorporated into the published releases.\n\n\nQuestions, Support & Discussion\n-------------------------------\n\nciscoisesdk is a *community developed* and *community supported* project.  If you experience any issues using this package, please report them using the issues_ page.\n\n\nContribution\n------------\n\nciscoisesdk_ is a community development projects.  Feedback, thoughts, ideas, and code contributions are welcome!  Please see the `Contributing`_ guide for more information.\n\n\nInspiration\n------------\n\nThis library is inspired by the webexteamssdk_  library\n\nChange log\n----------\n\nAll notable changes to this project will be documented in the CHANGELOG_ file.\n\nThe development team may make additional name changes as the library evolves with the ISE APIs.\n\n\n*Copyright (c) 2021 Cisco and/or its affiliates.*\n\n.. _Introduction: https://ciscoisesdk.readthedocs.io/en/latest/api/intro.html\n.. _ciscoisesdk.readthedocs.io: https://ciscoisesdk.readthedocs.io\n.. _Quickstart: https://ciscoisesdk.readthedocs.io/en/latest/api/quickstart.html\n.. _ciscoisesdk: https://github.com/CiscoISE/ciscoisesdk\n.. _issues: https://github.com/CiscoISE/ciscoisesdk/issues\n.. _pull requests: https://github.com/CiscoISE/ciscoisesdk/pulls\n.. _releases: https://github.com/CiscoISE/ciscoisesdk/releases\n.. _the repository: ciscoisesdk_\n.. _pull request: `pull requests`_\n.. _Contributing: https://github.com/CiscoISE/ciscoisesdk/blob/master/docs/contributing.rst\n.. _webexteamssdk: https://github.com/CiscoDevNet/webexteamssdk\n.. _CHANGELOG: https://github.com/CiscoISE/ciscoisesdk/blob/main/CHANGELOG.md\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Cisco Identity Services Engine Platform SDK",
    "version": "2.2.0",
    "project_urls": {
        "Homepage": "https://ciscoisesdk.readthedocs.io/en/latest/",
        "Repository": "https://github.com/CiscoISE/ciscoisesdk"
    },
    "split_keywords": [
        "cisco",
        " identity services engine",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7a91541651354900c191c68069f1c3d7900e2bebd78f2e9d04a27cff14a57de",
                "md5": "cb1c415e513175a04e889625175ab0d4",
                "sha256": "f6387fe3f172eb539d9ef9d1ce617146c03b4dc3734f10629c689e7b480be8b0"
            },
            "downloads": -1,
            "filename": "ciscoisesdk-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb1c415e513175a04e889625175ab0d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.6",
            "size": 4868120,
            "upload_time": "2024-04-24T23:36:44",
            "upload_time_iso_8601": "2024-04-24T23:36:44.296394Z",
            "url": "https://files.pythonhosted.org/packages/a7/a9/1541651354900c191c68069f1c3d7900e2bebd78f2e9d04a27cff14a57de/ciscoisesdk-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a48a9e5b5c455698229834fb654f178bcc7fbb8412133ba32548c3d0e8f2b9e",
                "md5": "73ef43208319345ab4fe620c83b9dcd0",
                "sha256": "95b0af267977e90c8b94d8eb5674f78897bda52ab296dfbedab10a7a101c233d"
            },
            "downloads": -1,
            "filename": "ciscoisesdk-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "73ef43208319345ab4fe620c83b9dcd0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.6",
            "size": 2224005,
            "upload_time": "2024-04-24T23:36:48",
            "upload_time_iso_8601": "2024-04-24T23:36:48.913864Z",
            "url": "https://files.pythonhosted.org/packages/5a/48/a9e5b5c455698229834fb654f178bcc7fbb8412133ba32548c3d0e8f2b9e/ciscoisesdk-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 23:36:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CiscoISE",
    "github_project": "ciscoisesdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ciscoisesdk"
}
        
Elapsed time: 0.25241s