resource_servers¶
The following methods allow for interaction with the Zidentity Resource Servers API endpoints.
Methods are accessible via zidentity.resource_servers
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 ResourceServersAPI¶
Bases:
APIClientA Client object for the Resource Servers API resource.
- get_resource_server(resource_id)¶
Retrieves details about a specific resource server using the server ID.
- Parameters:
resource_id (int) – Unique identifier of the resource server to retrieve.
- Returns:
A tuple containing ResourceServersRecord instance, Response, error).
- Return type:
Examples
Print a specific Resource Servers
>>> fetched_resource, _, error = client.zidentity.resource_servers.get_resource_server( '1254654') >>> if error: ... print(f"Error fetching Resource Server by ID: {error}") ... return ... print(f"Fetched Resource Server by ID: {fetched_resource.as_dict()}")
- list_resource_servers(query_params=None)¶
Retrieves a paginated list of resource servers with an optional query parameters for pagination
See the Zidentity Resource Servers API reference for further detail on optional keyword parameter structures.
- Parameters:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.offset]{int}: The starting point for pagination,with the number of records that can be skipped before fetching results.
[query_params.limit]{str}: The maximum number of records to return per request. Minimum: 0, Maximum: 1000[query_params.name[like]]{str}: Filters results by group name using a case-insensitive partial match.- Returns:
A tuple containing (list of ResourceServers instances, Response, error)
- Return type:
Examples
List resource servers using default settings:
>>> resource_list, response, error = zidentity.resource_servers.list_resource_servers(): ... if error: ... print(f"Error listing resource servers: {error}") ... return ... for resource in resource_list.records: ... print(resource.as_dict())
List resource servers, limiting to a maximum of 10 items:
>>> resource_list, response, error = zidentity.resource_servers.list_resource_servers(query_params={'limit': 10}): ... if error: ... print(f"Error listing resource servers: {error}") ... return ... for resource in resource_list.records: ... print(resource.as_dict())