account_details¶
The following methods allow for interaction with the ZTW Account Details API endpoints.
Methods are accessible via ztw.account_details
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 AccountDetailsAPI¶
Bases:
APIClientA Client object for the AccountDetails resource.
- get_public_account_details(account_id, query_params=None)¶
Returns information for the public (Cloud Connector) cloud account information for the specified ID.
- Parameters:
**account_id (str, optional) – Account or subscription ID of public cloud account.
**platform_id (string) – Public cloud platform (AWS or Azure).
- Keyword Arguments:
{dict} (query_params) –
Optional query parameters.
[query_params.page]{int}: Specifies the page offset.[query_params.page_size]{int}: Specifies the page size. The default size is 250.- Returns:
The requested public account record.
- Return type:
Tuple
Examples
>>> location = ztw.provisioning.get_public_account_details('97456691')
- list_public_account_details(query_params=None)¶
Returns a list of public cloud account information.
- Keyword Arguments:
{dict} (query_params) –
Optional query parameters.
[query_params.page]{int}: Specifies the page offset.[query_params.page_size]{int}: Specifies the page size. The default size is 250.- Returns:
List of configured public account details.
- Return type:
Tuple
Examples
List locations, returning 200 items per page for a maximum of 2 pages:
Examples
Gets a list of all public account details.
>>> public_account_details_list, _, error = ztw.account_details.list_public_account_details() ... if error: ... print(f"Error listing account groups: {error}") ... return ... print(f"Total account groups found: {len(account_groups_list)}") ... for account_group in account_groups_list: ... print(account_group.as_dict())
- list_public_account_details_lite(query_params=None)¶
Returns a subset of public (Cloud Connector) cloud account information.
- Keyword Arguments:
{dict} (query_params) –
Optional query parameters.
[query_params.page]{int}: Specifies the page offset.[query_params.page_size]{int}: Specifies the page size. The default size is 250.- Returns:
A lite list of public account details.
- Return type:
Tuple
Examples
List accounts with default settings:
>>> for account in ztw.provisioning.list_public_account_details_lite(): ... print(account)
List accounts, limiting to a maximum of 10 items:
>>> for account in ztw.provisioning.list_public_account_details_lite(max_items=10): ... print(account)
List accounts, returning 200 items per page for a maximum of 2 pages:
>>> for account in ztw.provisioning.list_public_account_details_lite(page_size=200, max_pages=2): ... print(account)
- list_public_account_status()¶
Returns a List of public (Cloud Connector) cloud account status information (enabled/disabled).
- Returns:
List of configured public account status.
- Return type:
Tuple
Examples
List public account status: >>> status = ztw.provisioning.list_public_account_status() … print(status)
- update_public_account_status(**kwargs)¶
Update an existing public account status.
- Keyword Arguments:
- Returns:
The updated public account status details.
- Return type:
Tuple
Examples
Update the public account status:
print(ztw.provisioning.update_public_account_status(account_id_enabled=True, sub_id_enabled=False))