web_policy¶
The following methods allow for interaction with the ZCC Web Policy API endpoints.
Methods are accessible via zcc.web_policy
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 WebPolicyAPI¶
Bases:
APIClient- activate_web_policy(**kwargs)¶
Enables or disables a policy or app profile for the company by platform (iOS, Android, Windows, macOS, and Linux).
- Parameters:
device_type – (int):
policy_id – (int):
- Returns:
A tuple containing the updated Activation Web Policy, response, and error.
- Return type:
Examples
Activate Web Policy in the Client Connector Portal to the console:
>>> web_policy, _, error = client.zcc.web_policy.activate_web_policy( ... device_type='3', ... policy_id='1', ... ) >>> if error: ... print(f"Error activating web policy: {error}") ... return ... print(f"web policy Info activated successfully: {web_policy.as_dict()}")
- delete_web_policy(policy_id)¶
Deletes the specified Web Policy.
- list_by_company(query_params=None)¶
Returns the list of Web Policy By Company ID in the Client Connector Portal.
- Parameters:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.page]{int}: Specifies the page offset.[query_params.page_size]{int}: Specifies the page size.[query_params.device_type]{str}: Filter by device operating system type. Valid options are:ios, android, windows, macos, linux.
[query_params.search]{str}: The search string used to partially match.[query_params.search_type]{str}: The search string used to partially match.- Returns:
A list containing Web Policy By Company ID in the Client Connector Portal.
- Return type:
Examples
Prints Web Policy By Company ID in the Client Connector Portal to the console:
>>> policy_list, _, err = client.zcc.web_policy.list_by_company(query_params={'device_type': 'windows'}) >>> if err: ... print(f"Error listing company policies: {err}") ... return ... for policy in policy_list: ... print(policy.as_dict())