posture_profiles¶
The following methods allow for interaction with the ZPA Posture Profiles API endpoints.
Methods are accessible via zpa.posture_profiles
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 PostureProfilesAPI¶
Bases:
APIClientA Client object for the Posture Profiles resource.
- get_profile(profile_id)¶
Gets a specific posture profile by its unique ID.
- Parameters:
profile_id (str) – The unique identifier of the posture profile.
- Returns:
A tuple containing (list of Posture Profile instances, Response, error)
- Return type:
Tuple
Examples
>>> fetched_posture, _, err = client.zpa.posture_profile.get_profile('999999') ... if err: ... print(f"Error fetching posture by ID: {err}") ... return ... print(fetched_profile.posture_udid)
- list_posture_profiles(query_params=None)¶
Returns a list of all configured posture profiles.
- 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}: Page size for pagination.[query_params.search]{str}: Search string for filtering results.- Returns:
A list of PostureProfile instances.
- Return type:
Examples
Retrieve posture profiles with pagination parameters:
>>> posture_list, _, err = client.zpa.posture_profile.list_posture_profiles( ... query_params={'search': 'pra_console01', 'page': '1', 'page_size': '100'}) ... if err: ... print(f"Error listing posture: {err}") ... return ... print(f"Total posture profiles found: {len(posture_list)}") ... for posture in posture_list: ... print(posture.as_dict())
Retrieve posture profiles udid with:
>>> posture_list, _, err = client.zpa.posture_profile.list_posture_profiles() ... if err: ... print(f"Error listing profiles: {err}") ... return ... print("Extracted posture_udid values:") ... for profile in profile_list: ... if profile.posture_udid: ... print(profile.posture_udid)