Skip to content

ISE

wingpy.cisco.ise.CiscoISE

CiscoISE(
    *,
    base_url: str | None = None,
    username: str | None = None,
    password: str | None = None,
    verify: SSLContext | bool = True,
    timeout: int = 10,
    retries: int = 3
)

Bases: RestApiBaseClass

Interact with the Cisco Identity Service Engine (ISE) API.

Parameters:

Name Type Description Default
base_url str | None

Base URL of the API including https://.

Overrides the environment variable WINGPY_ISE_BASE_URL.

None
username str | None

Username for API authentication.

Overrides the environment variable WINGPY_ISE_USERNAME.

None
password str | None

Password for API authentication.

Overrides the environment variable WINGPY_ISE_PASSWORD.

None
verify bool | SSLContext

Boolean values will enable or disable the default SSL verification.

Use an ssl.SSLContext to specify custom Certificate Authority.

True
timeout int

Number of seconds to wait for HTTP responses before raising httpx.TimeoutException exception.

10
retries int

Number of failed HTTP attempts allowed before raising httpx.HTTPStatusError exception.

3

Examples:

from wingpy import CiscoISE
ise = CiscoISE(
    base_url="https://ise.example.com",
    username="admin",
    password="password",
    verify=False,
)
ise.get_all("/api/v1/endpoint")
Source code in src/wingpy/cisco/ise.py
def __init__(
    self,
    *,
    base_url: str | None = None,
    username: str | None = None,
    password: str | None = None,
    verify: SSLContext | bool = True,
    timeout: int = 10,
    retries: int = 3,
):
    # Allow parameters to be passed directly or fallback to environment variables
    self.ise_url: str | None = base_url or os.getenv("WINGPY_ISE_BASE_URL")
    """
    The base URL for the ISE API.

    If not provided, it will be read from the environment variable `WINGPY_ISE_BASE_URL`.

    Examples
    --------
    - https://ise.example.com
    - https://192.0.2.1:443
    """

    self.username: str | None = username or os.getenv("WINGPY_ISE_USERNAME")
    """
    The username for authentication to the ISE API.

    If not provided, it will be read from the environment variable `WINGPY_ISE_USERNAME`.
    """

    self.password: str | None = password or os.getenv("WINGPY_ISE_PASSWORD")
    """
    The password for authentication to the ISE API.

    If not provided, it will be read from the environment variable `WINGPY_ISE_PASSWORD`.
    """

    if not self.ise_url or not self.username or not self.password:
        raise ValueError(
            "ISE base_url, username and password must be provided either as arguments or environment variables"
        )

    super().__init__(
        base_url=self.ise_url,
        auth_lifetime=0,
        auth_refresh_percentage=1,
        verify=verify,
        timeout=timeout,
        retries=retries,
    )

    self.auth = httpx.BasicAuth(self.username, self.password)
    """
    The authentication credentials for the ISE API.
    """

    self.version: Version | None = None
    """
    The version of the ISE API.
    """

get

get(
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None
) -> httpx.Response

Send an HTTP GET request to the specified path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
params dict | None

URL query parameters to include in the request. will be added as ?key=value pairs in the URL.

None
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The httpx.Response object from the request.

Source code in src/wingpy/cisco/ise.py
def get(
    self,
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
) -> httpx.Response:
    """
    Send an HTTP `GET` request to the specified path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    params : dict | None, default=None
        URL query parameters to include in the request. will be added as `?key=value` pairs in the URL.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httpx.Response
        The [`httpx.Response`](https://www.python-httpx.org/api/#response) object from the request.
    """

    merged_headers = self.headers.copy()
    merged_headers.update(self._build_mimetype_headers(path=path))
    if isinstance(headers, dict):
        merged_headers.update(headers)

    response = self.request(
        "GET",
        path,
        data=None,
        params=params,
        path_params=path_params,
        headers=merged_headers,
        timeout=timeout,
        is_auth_endpoint=False,
        auth=self.auth,
    )
    return response

get_all

get_all(
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
    page_size: int = 100
) -> list[dict]

Retrieves all pages of data from an API endpoint path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
params dict | None

URL query parameters to include in the request. will be added as ?key=value pairs in the URL.

None
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None
page_size int | None

The number of items to retrieve per page.

100

Returns:

Type Description
list[dict]

A concatenated list of dictionaries represented in the JSON responses.

Source code in src/wingpy/cisco/ise.py
def get_all(
    self,
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
    page_size: int = 100,
) -> list[dict]:
    """
    Retrieves all pages of data from an API endpoint path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    params : dict | None, default=None
        URL query parameters to include in the request. will be added as `?key=value` pairs in the URL.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    page_size : int | None, default=100
        The number of items to retrieve per page.

    Returns
    -------
    list[dict]
        A concatenated list of dictionaries represented in the JSON responses.
    """

    if self.is_ers(path):
        return self.get_all_ers(
            path,
            params=params,
            path_params=path_params,
            page_size=page_size,
            headers=headers,
            timeout=timeout,
        )
    elif self.is_xml(path):
        raise InvalidEndpointError("XML endpoints do not support paging")
    else:
        return self.get_all_openapi(
            path,
            params=params,
            path_params=path_params,
            page_size=page_size,
            headers=headers,
            timeout=timeout,
        )

post

post(
    path: str,
    *,
    data: str | dict | list | _Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None
) -> httpx.Response

Send an HTTP POST request to the specified path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
data str | dict | list | _Element | None

Request payload as JSON string, Python list/dict object or XML Element.

required
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The httpx.Response object from the request.

Source code in src/wingpy/cisco/ise.py
def post(
    self,
    path: str,
    *,
    data: str | dict | list | etree._Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
) -> httpx.Response:
    """
    Send an HTTP `POST` request to the specified path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    data : str | dict | list | etree._Element | None
        Request payload as JSON string, Python list/dict object or XML Element.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httpx.Response
        The [`httpx.Response`](https://www.python-httpx.org/api/#response) object from the request.
    """

    merged_headers = self.headers.copy()
    merged_headers.update(self._build_mimetype_headers(path=path))
    if isinstance(headers, dict):
        merged_headers.update(headers)

    response = self.request(
        "POST",
        path,
        data=data,
        params=None,
        path_params=path_params,
        headers=merged_headers,
        timeout=timeout,
        is_auth_endpoint=False,
        auth=self.auth,
    )

    return response

put

put(
    path: str,
    *,
    data: str | dict | list | _Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None
) -> httpx.Response

Send an HTTP PUT request to the specified path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
data str | dict | list | _Element | None

Request payload as JSON string, Python list/dict object or XML Element.

required
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The httpx.Response object from the request.

Source code in src/wingpy/cisco/ise.py
def put(
    self,
    path: str,
    *,
    data: str | dict | list | etree._Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
) -> httpx.Response:
    """
    Send an HTTP `PUT` request to the specified path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    data : str | dict | list | etree._Element | None
        Request payload as JSON string, Python list/dict object or XML Element.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httpx.Response
        The [`httpx.Response`](https://www.python-httpx.org/api/#response) object from the request.
    """

    merged_headers = self.headers.copy()
    merged_headers.update(self._build_mimetype_headers(path=path))
    if isinstance(headers, dict):
        merged_headers.update(headers)

    response = self.request(
        "PUT",
        path,
        data=data,
        params=None,
        path_params=path_params,
        headers=merged_headers,
        timeout=timeout,
        is_auth_endpoint=False,
        auth=self.auth,
    )

    return response

patch

patch(
    path: str,
    *,
    data: str | dict | list | _Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None
) -> httpx.Response

Send an HTTP PATCH request to the specified path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
data str | dict | list | _Element | None

Request payload as JSON string, Python list/dict object or XML Element.

required
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The httpx.Response object from the request.

Source code in src/wingpy/cisco/ise.py
def patch(
    self,
    path: str,
    *,
    data: str | dict | list | etree._Element | None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
) -> httpx.Response:
    """
    Send an HTTP `PATCH` request to the specified path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    data : str | dict | list | etree._Element | None
        Request payload as JSON string, Python list/dict object or XML Element.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httpx.Response
        The [`httpx.Response`](https://www.python-httpx.org/api/#response) object from the request.
    """

    merged_headers = self.headers.copy()
    merged_headers.update(self._build_mimetype_headers(path=path))
    if isinstance(headers, dict):
        merged_headers.update(headers)

    response = self.request(
        "PATCH",
        path,
        data=data,
        params=None,
        path_params=path_params,
        headers=merged_headers,
        timeout=timeout,
        is_auth_endpoint=False,
        auth=self.auth,
    )

    return response

delete

delete(
    path: str,
    *,
    data: str | dict | list | _Element | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None
) -> httpx.Response

Send an HTTP DELETE request to the specified path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
data str | dict | list | _Element | None

Request payload as JSON string, Python list/dict object or XML Element.

None
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The httpx.Response object from the request.

Source code in src/wingpy/cisco/ise.py
def delete(
    self,
    path: str,
    *,
    data: str | dict | list | etree._Element | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
) -> httpx.Response:
    """
    Send an HTTP `DELETE` request to the specified path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    data : str | dict | list | etree._Element | None
        Request payload as JSON string, Python list/dict object or XML Element.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httpx.Response
        The [`httpx.Response`](https://www.python-httpx.org/api/#response) object from the request.
    """

    merged_headers = self.headers.copy()
    merged_headers.update(self._build_mimetype_headers(path=path))
    if isinstance(headers, dict):
        merged_headers.update(headers)

    response = self.request(
        "DELETE",
        path,
        data=data,
        params=None,
        path_params=path_params,
        headers=merged_headers,
        timeout=timeout,
        is_auth_endpoint=False,
        auth=self.auth,
    )

    return response

get_all_ers

get_all_ers(
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
    page_size: int = 100
) -> list[dict]

Retrieves all pages of data from an ERS endpoint path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
params dict | None

URL query parameters to include in the request. will be added as ?key=value pairs in the URL.

None
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None
page_size int | None

The number of items to retrieve per page.

100

Returns:

Type Description
list[dict]

A concatenated list of dictionaries, similar to the resources key in the JSON responses.

Source code in src/wingpy/cisco/ise.py
def get_all_ers(
    self,
    path: str,
    *,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None = None,
    page_size: int = 100,
) -> list[dict]:
    """
    Retrieves all pages of data from an ERS endpoint path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    params : dict | None, default=None
        URL query parameters to include in the request. will be added as `?key=value` pairs in the URL.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    page_size : int | None, default=100
        The number of items to retrieve per page.

    Returns
    -------
    list[dict]
        A concatenated list of dictionaries, similar to the `resources` key in the JSON responses.
    """

    logger.debug(f"Retrieving all pages from ERS {path}")

    first_page = self.get_page(
        path,
        params=params,
        path_params=path_params,
        page=1,
        page_size=page_size,
        headers=headers,
        timeout=timeout,
    )

    json_response_data = first_page.json()

    if "SearchResult" not in json_response_data.keys():
        raise InvalidEndpointError(f'{path} is not an ERS "Get-All" endpoint')

    result: list = json_response_data["SearchResult"]["resources"]

    total_count = int(json_response_data["SearchResult"]["total"])

    total_pages = math.ceil(total_count / page_size)

    logger.debug(
        f"Paging with {range(page_size, total_count, page_size) = } = {list(range(page_size, total_count, page_size))}"
    )

    # Prepare the pages to be retrieved in parallel
    for page in range(2, total_pages + 1):
        self.tasks.schedule(
            self.get_page,
            path,
            params=params,
            path_params=path_params,
            page=page,
            page_size=page_size,
            headers=headers,
            timeout=timeout,
        )

    page_responses = self.tasks.run()

    for page_response in page_responses.values():
        result += page_response.json()["SearchResult"]["resources"]

    logger.debug(f"Received {len(result)} items from {path}")

    return result

get_page

get_page(
    path: str,
    *,
    page: int,
    page_size: int,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None
) -> httpx.Response

Retrieves a specific page of data from a JSON path.

Parameters:

Name Type Description Default
path str

The API endpoint path to send the request to.

required
page int

Page number to retrive.

required
page_size int

The number of items to retrieve per page.

required
params dict | None

URL query parameters to include in the request. will be added as ?key=value pairs in the URL.

None
path_params dict | None

Replace placeholders like {policyId} in the URL path with actual values.

Will be combined with self.path_params before sending request.

None
headers dict | None

HTTP headers to be sent with the request.

Will be combined with self.headers before sending request.

None
timeout int | None

Override the standard timeout timer self.timeout for a single request.

None

Returns:

Type Description
Response

The response object from the request.

Source code in src/wingpy/cisco/ise.py
def get_page(
    self,
    path: str,
    *,
    page: int,
    page_size: int,
    params: dict | None = None,
    path_params: dict | None = None,
    headers: dict | None = None,
    timeout: int | None,
) -> httpx.Response:
    """
    Retrieves a specific page of data from a JSON path.

    Parameters
    ----------
    path : str
        The API endpoint path to send the request to.

    page : int
        Page number to retrive.

    page_size : int
        The number of items to retrieve per page.

    params : dict | None, default=None
        URL query parameters to include in the request. will be added as `?key=value` pairs in the URL.

    path_params : dict | None, default=None
        Replace placeholders like `{policyId}` in the URL path with actual values.

        Will be combined with [self.path_params](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.path_params) before sending request.

    headers : dict | None, default=None
        HTTP headers to be sent with the request.

        Will be combined with [self.headers](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.headers) before sending request.

    timeout : int | None, default=None
        Override the standard timeout timer [self.timeout](https://wingpy.automation.wingmen.dk/api/apic/#wingpy.cisco.ise.CiscoISE.timeout) for a single request.

    Returns
    -------
    httx.Response
        The response object from the request.
    """

    merged_params = {}
    if isinstance(params, dict):
        merged_params.update(params)

    merged_params["size"] = page_size
    merged_params["page"] = page

    response = self.get(
        path,
        params=merged_params,
        path_params=path_params,
        headers=headers,
        timeout=timeout,
    )

    if response.status_code < 300:
        logger.debug(f"Retrieved page {page} from {path}")

    return response

authenticate

authenticate() -> None

Executes the API-specific authentication process and records timestamps for session tracking.

Notes

Authentication will automatically be carried out just-in-time.

Only call this method directly if you need to authenticate proactively, outside of normal request flow.

Source code in src/wingpy/base.py
def authenticate(self) -> None:
    """
    Executes the API-specific authentication process and records timestamps
    for session tracking.

    Notes
    ----
    Authentication will automatically be carried out just-in-time.

    Only call this method directly if you need to authenticate proactively,
    outside of normal request flow.
    """

    # Authenticate
    logger.debug("Authenticating and recording token lifetime.")
    auth_response = self._authenticate()

    # Record the time of authentication
    self.auth_timestamp = arrow.utcnow()

    self._after_auth(auth_response=auth_response)

tasks instance-attribute

tasks: TaskRunner = TaskRunner(max_workers=max_workers)

Manages concurrent requests to the API server.

The number of concurrent requests is limited by the MAX_CONNECTIONS property:

  • 1 connection is reserved for the main thread used for authentication and synchronous requests.
  • The remaining connections are used for concurrent requests.
See Also

wingpy.scheduling.TaskRunner Schedule and run asynchronous tasks in parallel.

is_authenticated property

is_authenticated: bool

Check if the client is authenticated.

timeout instance-attribute

timeout: int = timeout

The timeout in seconds for each request to the API server.

MAX_CONNECTIONS class-attribute instance-attribute

MAX_CONNECTIONS = 10

The maximum number of concurrent connections opened to the ISE.

1 connection will be used for general synchronous requests.

9 connections will be used for parallel asynchronous requests.

RETRY_RESPONSES class-attribute instance-attribute

RETRY_RESPONSES = []

No explicit retry reponses are defined for Cisco ISE.

headers instance-attribute

headers: dict = headers or {}

A dictionary of HTTP headers to be sent with each request. These headers will be merged with any headers dict passed to an individual request.

path_params instance-attribute

path_params: dict = {}

A dictionary of path parameters to be used in the API path of each request.

These parameters will be merged with any path_params dict passed to the request.