Error running openziti management client

Hi,

  1. I have downloaded the zip from GitHub:
    GitHub - openziti-test-kitchen/openziti-edge-management-python: Python library for the Ziti Management API

  2. Updated my PYTHONPATH

  3. Run: python setup.py install --user

  4. Then run test.py as shown in README.md:
    import time
    import openziti_edge_management
    from pprint import pprint
    from openziti_edge_management.api import api_session_api
    from openziti_edge_management.model.api_error_envelope import ApiErrorEnvelope
    from openziti_edge_management.model.detail_api_session_envelope import DetailApiSessionEnvelope
    from openziti_edge_management.model.empty import Empty
    from openziti_edge_management.model.list_api_sessions_envelope import ListApiSessionsEnvelope
    configuration = openziti_edge_management.Configuration(
    host = "https://demo.ziti.dev/edge/management/v1"
    )....
    etc


I get the following error:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='demo.ziti.dev', port=443): Max retries exceeded with url: /edge/management/v1/api-sessions/id_example (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7ff7e175ba30>: Failed to resolve 'demo.ziti.dev' ([Errno -2] Name or service not known)"))

How to resolve this?

This makes me think the identity you have used doesn't have the particular service that has an intercept config providing demo.ziti.dev. Run policy-advisor and ensure the the identity used by the python app has access to dial a service that has this intercept config.

ziti edge policy-advisor identities -q

This is an example of a Ziti management API URL. You must substitute your own Ziti network's management API URL.