trusted_networks¶
The following methods allow for interaction with the ZPA Trusted Networks API endpoints.
Methods are accessible via zpa.trusted_networks
Copyright (c) 2023, Zscaler Inc.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- class TrustedNetworksAPI¶
Bases:
APIClientA client object for the Trusted Networks resource.
- get_network(network_id)¶
Returns information on the specified trusted network.
- Parameters:
network_id (str) – The unique identifier for the trusted network.
- Returns:
The corresponding trusted network object.
- Return type:
TrustedNetwork
Examples
>>> fetched_network, _, err = client.zpa.trusted_networks.get_network('999999') ... if err: ... print(f"Error fetching network by ID: {err}") ... return ... print(fetched_network.network_id)
- list_trusted_networks(query_params=None)¶
Returns a list of all configured trusted networks.
- Keyword Arguments:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.page]{str}: Specifies the page number.[query_params.page_size]{int}: Specifies the page size.If not provided, the default page size is 20. The max page size is 500.
[query_params.search]{str}: The search string used to support search by features and fields for the API.- Returns:
A list of TrustedNetwork instances.
- Return type:
Examples
Retrieve trusted networks with pagination parameters:
>>> network_list, _, err = client.zpa.trusted_networks.list_trusted_networks( ... query_params={'search': 'pra_console01', 'page': '1', 'page_size': '100'}) ... if err: ... print(f"Error listing trusted networks: {err}") ... return ... print(f"Total trusted networks found: {len(network_list)}") ... for network in network_list: ... print(network.as_dict())
Retrieve posture profiles udid with:
>>> network_list, _, err = client.zpa.trusted_networks.list_trusted_networks() ... if err: ... print(f"Error trusted networks: {err}") ... return ... print("Extracted network_id values:") ... for profile in network_list: ... if profile.network_id: ... print(profile.network_id)