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 Overrides the environment variable |
None
|
username
|
str | None
|
Username for API authentication. Overrides the environment variable |
None
|
password
|
str | None
|
Password for API authentication. Overrides the environment variable |
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
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 |
None
|
path_params
|
dict | None
|
Replace placeholders like 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 |
Source code in src/wingpy/cisco/ise.py
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 |
None
|
path_params
|
dict | None
|
Replace placeholders like 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
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 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 |
Source code in src/wingpy/cisco/ise.py
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 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 |
Source code in src/wingpy/cisco/ise.py
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 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 |
Source code in src/wingpy/cisco/ise.py
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 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 |
Source code in src/wingpy/cisco/ise.py
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 |
None
|
path_params
|
dict | None
|
Replace placeholders like 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 |
Source code in src/wingpy/cisco/ise.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
|
get_all_openapi
¶
get_all_openapi(
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 OpenAPI 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 |
None
|
path_params
|
dict | None
|
Replace placeholders like 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 root list in the JSON responses. |
Raises:
Type | Description |
---|---|
InvalidEndpointError
|
If the specified path is not a valid OpenAPI "Get all" endpoint. |
Source code in src/wingpy/cisco/ise.py
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
|
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 |
None
|
path_params
|
dict | None
|
Replace placeholders like 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
authenticate
¶
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
tasks
¶
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.
MAX_CONNECTIONS
¶
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.
headers
¶
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
¶
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.