policy_export¶
The following methods allow for interaction with the ZIA Policy Export API endpoints.
Methods are accessible via zia.policy_export
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 PolicyExportAPI¶
Bases:
APIClientA Client object for exporting ZIA policy rules to JSON files.
- policy_export(policy_types=None, output_file=None)¶
Exports the rules for the specified policy types. The server typically returns a ZIP file containing one JSON file per policy type.
- Parameters:
- Returns:
(export_content, error)
export_content (bytes): The raw ZIP file bytes from the server (or raw JSON if only one type).
error (str): Any error message, or None on success.
- Return type:
Example
>>> export_content, err = client.zia.policy_export.policy_export( ... policy_types=["BA","URL_FILTERING"], ... output_file="policy_export.zip" ... ) >>> if err: ... print(f"Error exporting policies: {err}") ... else: ... print("Policies exported successfully.")