pra_credential_pool

The following methods allow for interaction with the ZPA Privileged Remote Access Credential Pool API endpoints.

Methods are accessible via zpa.pra_credential_pool

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 PRACredentialPoolAPI

Bases: APIClient

A Client object for the Privileged Remote Access Credential Pool resource.

add_credential_pool(**kwargs)

Adds a new Privileged Credential Pool.

Parameters:
  • name (str) – The name of the credential.

  • credential_type (str) – The type of credential (‘USERNAME_PASSWORD’, ‘SSH_KEY’, ‘PASSWORD’).

  • credentials (list) – List of credential IDs

Returns:

PRACredentialPoolController: The created Privileged Credential Pool object.

Return type:

Tuple

Examples

>>> add_pool, _, err = client.zpa.pra_credential_pool.update_credential_pool(
...    name='New_Credential_Pool',
...    credential_ids=['124545', '12545'],
...    credential_type='USERNAME_PASSWORD'
... if err:
...     print(f"Error updating Privileged credential pool: {err}")
...     return
... print(f"Privileged credential pool added successfully: {add_pool.as_dict()}")
delete_credential_pool(pool_id, microtenant_id=None)

Deletes the specified privileged credential pool.

Parameters:
  • pool_id (str) – The unique id for the privileged credential pool to be deleted.

  • microtenant_id (str) – The unique identifier of the Microtenant for the ZPA tenant.

Returns:

A tuple containing (None, Response, error)

Return type:

tuple

Examples

>>> _, _, err = client.zpa.pra_credential_pool.delete_credential_pool(
...     pool_id='999999'
... )
... if err:
...     print(f"Error deleting privileged credential pools: {err}")
...     return
... print(f"privileged credential pools with ID {'999999'} deleted successfully.")
get_credential_pool(pool_id, query_params=None)

Gets information on the specified Privileged credential pool.

Parameters:
  • pool_id (str) – The unique identifier of the Privileged credential pool.

  • query_params (dict, optional) – Map of query parameters for the request. [query_params.microtenant_id] {str}: The microtenant ID, if applicable.

Returns:

PRACredentialPoolController: The corresponding PRA Credential Pool object.

Return type:

Tuple

Example

Retrieve details of a specific Privileged credential pool

>>> fetched_pool, _, err = client.zpa.pra_credential_pool.get_credential_pool('999999')
... if err:
...     print(f"Error fetching Privileged credential pool by ID: {err}")
...     return
... print(f"Fetched Privileged credential pool by ID: {fetched_pool.as_dict()}")
get_credential_pool_info(pool_id, query_params=None)

Given Privileged credential pool id gets mapped privileged credential info

Parameters:
  • pool_id (str) – The unique identifier of the Privileged credential pool.

  • query_params (dict, optional) – Map of query parameters for the request. [query_params.microtenant_id] {str}: The microtenant ID, if applicable.

Returns:

PRACredentialPoolController: The corresponding PRA Credential Pool object.

Return type:

Tuple

Example

Retrieve details of a specific Privileged credential pool

>>> fetched_pool, _, err = client.zpa.pra_credential_pool.get_credential_pool_info('999999')
... if err:
...     print(f"Error fetching Privileged credential pool by ID: {err}")
...     return
... print(f"Fetched Privileged credential pool by ID: {fetched_pool.as_dict()}")
list_credential_pool(query_params=None)

Returns a list of all privileged remote access credential pool details.

Parameters:

{dict} (query_params) – Map of query parameters for the request. [query_params.page] {str}: Specifies the page number. [query_params.page_size] {int}: Page size for pagination. [query_params.search] {str}: Search string for filtering results. [query_params.microtenant_id] {str}: ID of the microtenant, if applicable. [query_params.sort_by] {str}: Indicates the parameter to sort by. [query_params.sort_dir] {str}: Specifies the sort direction. Supported Values: ASC and DESC

Returns:

A tuple containing (list of PrivilegedRemoteAccessCredential instances, Response, error)

Return type:

tuple

Examples

>>> credential_list, _, err = client.zpa.pra_credential.list_credential_pool(
... query_params={'search': 'pra_console01', 'page': '1', 'page_size': '100'})
... if err:
...     print(f"Error listing pra credentials: {err}")
...     return
... print(f"Total pra credentials found: {len(credential_list)}")
... for pra in credential_list:
...     print(pra.as_dict())
reformat_params = [('credential_ids', 'credentials')]
update_credential_pool(pool_id, **kwargs)

Updates a Privileged credential pool.

Parameters:
  • pool_id (str) – The unique identifier for the Privileged credential pool.

  • microtenant_id (str) – The unique identifier of the Microtenant for the ZPA tenant.

Returns:

A tuple containing (PRACredentialPoolController, Response, error)

Return type:

Tuple

Examples

>>> update_pool, _, err = client.zpa.pra_credential_pool.update_credential_pool(
...    pool_id="999999",
...    name='Update_Credential_Pool',
...    credential_ids=['124545', '12545'],
...    credential_type='USERNAME_PASSWORD'
... if err:
...     print(f"Error updating Privileged credential pool: {err}")
...     return
... print(f"Privileged credential pool added successfully: {update_pool.as_dict()}")