ftp_control_policy¶
The following methods allow for interaction with the ZIA FTP Control Policy API endpoints.
Methods are accessible via zia.ftp_control_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 FTPControlPolicyAPI¶
Bases:
APIClientA Client object for the FTP Control Settings resource.
- get_ftp_settings()¶
Retrieves the FTP Control status and the list of URL categories for which FTP is allowed.
- Returns:
- A tuple containing:
FTPControlPolicy: The current ftp control settings object.
Response: The raw HTTP response returned by the API.
error: An error message if the request failed; otherwise, None.
- Return type:
Examples
Retrieve and print the current mobile settings:
>>> settings, _, err = client.zia.ftp_control_policy.get_ftp_settings() >>> if err: ... print(f"Error fetching ftp control settings: {err}") ... return ... print("Current ftp control settings fetched successfully.") ... print(settings)
- update_ftp_settings(**kwargs)¶
Updates the FTP Control settings.
- Parameters:
settings (
FTPControlPolicy) – An instance of FTPControlPolicy containing the updated configuration.
- Supported attributes:
ftp_over_http_enabled (bool): Indicates whether to enable FTP over HTTP.
- ftp_enabled (bool): Indicates whether to enable native FTP.
When enabled, users can connect to native FTP sites and download files.
url_categories (list[str]): List of URL categories that allow FTP traffic
urls (list[str]): Domains or URLs included for the FTP Control settings
- Returns:
FTPControlPolicy: The updated ftp control policy object.
Response: The raw HTTP response returned by the API.
error: An error message if the update failed; otherwise, None.
- Return type:
Examples
Update mobile setting options:
>>> ftp_settings, _, err = client.zia.ftp_control_policy.update_ftp_settings( ... ftp_over_http_enabled = True, ... ftp_enabled = True, ... url_categories = ["ADULT_THEMES", "ADULT_SEX_EDUCATION"], ... urls = ["zscaler.com", "zscaler.net"], ... ) >>> if err: ... print(f"Error fetching ftp settings: {err}") ... return ... print("Current ftp settings fetched successfully.") ... print(ftp_settings)