zscaler-sdk-python 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. zscaler-sdk-python-0.1.0/CHANGELOG.md +9 -0
  2. zscaler-sdk-python-0.1.0/LICENSE.md +21 -0
  3. zscaler-sdk-python-0.1.0/LONG_DESCRIPTION.md +232 -0
  4. zscaler-sdk-python-0.1.0/MANIFEST.in +8 -0
  5. zscaler-sdk-python-0.1.0/PKG-INFO +243 -0
  6. zscaler-sdk-python-0.1.0/README.md +232 -0
  7. zscaler-sdk-python-0.1.0/docsrc/Makefile +185 -0
  8. zscaler-sdk-python-0.1.0/docsrc/conf.py +225 -0
  9. zscaler-sdk-python-0.1.0/docsrc/index.rst +136 -0
  10. zscaler-sdk-python-0.1.0/docsrc/zs/guides/examples.rst +94 -0
  11. zscaler-sdk-python-0.1.0/docsrc/zs/guides/index.rst +13 -0
  12. zscaler-sdk-python-0.1.0/docsrc/zs/guides/support.rst +27 -0
  13. zscaler-sdk-python-0.1.0/docsrc/zs/guides/troubleshooting.rst +9 -0
  14. zscaler-sdk-python-0.1.0/docsrc/zs/zia/activate.rst +14 -0
  15. zscaler-sdk-python-0.1.0/docsrc/zs/zia/admin_and_role_management.rst +13 -0
  16. zscaler-sdk-python-0.1.0/docsrc/zs/zia/apptotal.rst +13 -0
  17. zscaler-sdk-python-0.1.0/docsrc/zs/zia/audit_logs.rst +13 -0
  18. zscaler-sdk-python-0.1.0/docsrc/zs/zia/authentication_settings.rst +13 -0
  19. zscaler-sdk-python-0.1.0/docsrc/zs/zia/cloud_apps.rst +14 -0
  20. zscaler-sdk-python-0.1.0/docsrc/zs/zia/device_management.rst +14 -0
  21. zscaler-sdk-python-0.1.0/docsrc/zs/zia/dlp.rst +14 -0
  22. zscaler-sdk-python-0.1.0/docsrc/zs/zia/firewall.rst +13 -0
  23. zscaler-sdk-python-0.1.0/docsrc/zs/zia/forwarding_control.rst +13 -0
  24. zscaler-sdk-python-0.1.0/docsrc/zs/zia/index.rst +12 -0
  25. zscaler-sdk-python-0.1.0/docsrc/zs/zia/isolation_profile.rst +13 -0
  26. zscaler-sdk-python-0.1.0/docsrc/zs/zia/locations.rst +14 -0
  27. zscaler-sdk-python-0.1.0/docsrc/zs/zia/rule_labels.rst +14 -0
  28. zscaler-sdk-python-0.1.0/docsrc/zs/zia/sandbox.rst +14 -0
  29. zscaler-sdk-python-0.1.0/docsrc/zs/zia/security.rst +14 -0
  30. zscaler-sdk-python-0.1.0/docsrc/zs/zia/ssl_inspection.rst +13 -0
  31. zscaler-sdk-python-0.1.0/docsrc/zs/zia/traffic.rst +14 -0
  32. zscaler-sdk-python-0.1.0/docsrc/zs/zia/url_categories.rst +23 -0
  33. zscaler-sdk-python-0.1.0/docsrc/zs/zia/url_filtering.rst +13 -0
  34. zscaler-sdk-python-0.1.0/docsrc/zs/zia/users.rst +14 -0
  35. zscaler-sdk-python-0.1.0/docsrc/zs/zia/web_dlp.rst +14 -0
  36. zscaler-sdk-python-0.1.0/docsrc/zs/zia/workload_groups.rst +13 -0
  37. zscaler-sdk-python-0.1.0/docsrc/zs/zia/zpa_gateway.rst +13 -0
  38. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/app_segments.rst +14 -0
  39. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/app_segments_inspection.rst +14 -0
  40. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/app_segments_pra.rst +14 -0
  41. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/certificates.rst +13 -0
  42. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/cloud_connector_groups.rst +14 -0
  43. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/connectors.rst +14 -0
  44. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/emergency_access.rst +14 -0
  45. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/idp.rst +13 -0
  46. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/index.rst +13 -0
  47. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/inspection.rst +14 -0
  48. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/isolation_profile.rst +14 -0
  49. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/lss.rst +14 -0
  50. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/machine_groups.rst +14 -0
  51. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/policies.rst +13 -0
  52. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/posture_profiles.rst +14 -0
  53. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/privileged_remote_access.rst +14 -0
  54. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/provisioning.rst +13 -0
  55. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/saml_attributes.rst +14 -0
  56. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/scim_attributes.rst +14 -0
  57. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/scim_groups.rst +14 -0
  58. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/segment_groups.rst +14 -0
  59. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/server_groups.rst +14 -0
  60. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/servers.rst +14 -0
  61. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/service_edges.rst +14 -0
  62. zscaler-sdk-python-0.1.0/docsrc/zs/zpa/trusted_networks.rst +14 -0
  63. zscaler-sdk-python-0.1.0/requirements.txt +33 -0
  64. zscaler-sdk-python-0.1.0/setup.cfg +10 -0
  65. zscaler-sdk-python-0.1.0/setup.py +54 -0
  66. zscaler-sdk-python-0.1.0/tests/__init__.py +0 -0
  67. zscaler-sdk-python-0.1.0/tests/conftest.py +35 -0
  68. zscaler-sdk-python-0.1.0/tests/integration/zia/conftest.py +65 -0
  69. zscaler-sdk-python-0.1.0/tests/integration/zia/test_activation.py +52 -0
  70. zscaler-sdk-python-0.1.0/tests/integration/zia/test_admin_and_role_management.py +74 -0
  71. zscaler-sdk-python-0.1.0/tests/integration/zia/test_authentication_settings.py +72 -0
  72. zscaler-sdk-python-0.1.0/tests/integration/zia/test_cloud_firewall_ip_destination_groups.py +107 -0
  73. zscaler-sdk-python-0.1.0/tests/integration/zia/test_cloud_firewall_ip_source_groups.py +102 -0
  74. zscaler-sdk-python-0.1.0/tests/integration/zia/test_cloud_firewall_rule.py +145 -0
  75. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_dictionary.py +107 -0
  76. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_engines.py +118 -0
  77. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_icap_server.py +73 -0
  78. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_idm_profile.py +77 -0
  79. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_incident_receiver.py +78 -0
  80. zscaler-sdk-python-0.1.0/tests/integration/zia/test_dlp_web_rule.py +102 -0
  81. zscaler-sdk-python-0.1.0/tests/integration/zia/test_isolation_profile.py +79 -0
  82. zscaler-sdk-python-0.1.0/tests/integration/zia/test_location_group.py +121 -0
  83. zscaler-sdk-python-0.1.0/tests/integration/zia/test_location_management.py +343 -0
  84. zscaler-sdk-python-0.1.0/tests/integration/zia/test_rule_labels.py +103 -0
  85. zscaler-sdk-python-0.1.0/tests/integration/zia/test_sandbox.py +168 -0
  86. zscaler-sdk-python-0.1.0/tests/integration/zia/test_security.py +121 -0
  87. zscaler-sdk-python-0.1.0/tests/integration/zia/test_traffic_gre_tunnel.py +364 -0
  88. zscaler-sdk-python-0.1.0/tests/integration/zia/test_traffic_static_ip.py +103 -0
  89. zscaler-sdk-python-0.1.0/tests/integration/zia/test_traffic_vpn_credential.py +124 -0
  90. zscaler-sdk-python-0.1.0/tests/integration/zia/test_url_categories.py +265 -0
  91. zscaler-sdk-python-0.1.0/tests/integration/zia/test_url_filtering_rule.py +125 -0
  92. zscaler-sdk-python-0.1.0/tests/integration/zia/test_users.py +221 -0
  93. zscaler-sdk-python-0.1.0/tests/integration/zpa/__init__.py +0 -0
  94. zscaler-sdk-python-0.1.0/tests/integration/zpa/conftest.py +64 -0
  95. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_access_policy_forwarding_rules.py +107 -0
  96. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_access_policy_rules.py +133 -0
  97. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_access_policy_timeout_rules.py +107 -0
  98. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_app_connector_groups.py +120 -0
  99. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_application_segment.py +168 -0
  100. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_application_servers.py +104 -0
  101. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_ba_certificates.py +82 -0
  102. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_enrolment_certificates.py +68 -0
  103. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_idp.py +79 -0
  104. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_isolation_profile.py +74 -0
  105. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_machine_groups.py +83 -0
  106. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_posture_profiles.py +87 -0
  107. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_pra_approval.py +219 -0
  108. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_pra_credential.py +113 -0
  109. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_pra_portal.py +118 -0
  110. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_provisioning_key_app_connector_group.py +147 -0
  111. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_provisioning_key_service_edge_group.py +148 -0
  112. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_saml_attributes.py +90 -0
  113. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_scim_attributes.py +78 -0
  114. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_scim_groups.py +76 -0
  115. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_segment_groups.py +102 -0
  116. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_server_groups.py +130 -0
  117. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_service_edge_groups.py +134 -0
  118. zscaler-sdk-python-0.1.0/tests/integration/zpa/test_trusted_networks.py +86 -0
  119. zscaler-sdk-python-0.1.0/tests/test_utils.py +102 -0
  120. zscaler-sdk-python-0.1.0/tox.ini +10 -0
  121. zscaler-sdk-python-0.1.0/zscaler/__init__.py +26 -0
  122. zscaler-sdk-python-0.1.0/zscaler/cache/__init__.py +0 -0
  123. zscaler-sdk-python-0.1.0/zscaler/cache/cache.py +105 -0
  124. zscaler-sdk-python-0.1.0/zscaler/cache/no_op_cache.py +68 -0
  125. zscaler-sdk-python-0.1.0/zscaler/cache/zscaler_cache.py +161 -0
  126. zscaler-sdk-python-0.1.0/zscaler/constants.py +26 -0
  127. zscaler-sdk-python-0.1.0/zscaler/errors/__init__.py +0 -0
  128. zscaler-sdk-python-0.1.0/zscaler/errors/error.py +10 -0
  129. zscaler-sdk-python-0.1.0/zscaler/errors/http_error.py +20 -0
  130. zscaler-sdk-python-0.1.0/zscaler/errors/zscaler_api_error.py +24 -0
  131. zscaler-sdk-python-0.1.0/zscaler/exceptions/__init__.py +1 -0
  132. zscaler-sdk-python-0.1.0/zscaler/exceptions/exceptions.py +101 -0
  133. zscaler-sdk-python-0.1.0/zscaler/logger.py +57 -0
  134. zscaler-sdk-python-0.1.0/zscaler/ratelimiter/__init__.py +0 -0
  135. zscaler-sdk-python-0.1.0/zscaler/ratelimiter/ratelimiter.py +39 -0
  136. zscaler-sdk-python-0.1.0/zscaler/user_agent.py +23 -0
  137. zscaler-sdk-python-0.1.0/zscaler/utils.py +577 -0
  138. zscaler-sdk-python-0.1.0/zscaler/zia/__init__.py +657 -0
  139. zscaler-sdk-python-0.1.0/zscaler/zia/activate.py +51 -0
  140. zscaler-sdk-python-0.1.0/zscaler/zia/admin_and_role_management.py +342 -0
  141. zscaler-sdk-python-0.1.0/zscaler/zia/apptotal.py +71 -0
  142. zscaler-sdk-python-0.1.0/zscaler/zia/audit_logs.py +95 -0
  143. zscaler-sdk-python-0.1.0/zscaler/zia/authentication_settings.py +98 -0
  144. zscaler-sdk-python-0.1.0/zscaler/zia/client.py +88 -0
  145. zscaler-sdk-python-0.1.0/zscaler/zia/cloud_apps.py +406 -0
  146. zscaler-sdk-python-0.1.0/zscaler/zia/device_management.py +90 -0
  147. zscaler-sdk-python-0.1.0/zscaler/zia/dlp.py +784 -0
  148. zscaler-sdk-python-0.1.0/zscaler/zia/errors.py +37 -0
  149. zscaler-sdk-python-0.1.0/zscaler/zia/firewall.py +1104 -0
  150. zscaler-sdk-python-0.1.0/zscaler/zia/forwarding_control.py +271 -0
  151. zscaler-sdk-python-0.1.0/zscaler/zia/isolation_profile.py +83 -0
  152. zscaler-sdk-python-0.1.0/zscaler/zia/labels.py +180 -0
  153. zscaler-sdk-python-0.1.0/zscaler/zia/locations.py +661 -0
  154. zscaler-sdk-python-0.1.0/zscaler/zia/sandbox.py +180 -0
  155. zscaler-sdk-python-0.1.0/zscaler/zia/security.py +236 -0
  156. zscaler-sdk-python-0.1.0/zscaler/zia/ssl_inspection.py +175 -0
  157. zscaler-sdk-python-0.1.0/zscaler/zia/traffic.py +853 -0
  158. zscaler-sdk-python-0.1.0/zscaler/zia/url_categories.py +442 -0
  159. zscaler-sdk-python-0.1.0/zscaler/zia/url_filtering.py +310 -0
  160. zscaler-sdk-python-0.1.0/zscaler/zia/users.py +386 -0
  161. zscaler-sdk-python-0.1.0/zscaler/zia/web_dlp.py +295 -0
  162. zscaler-sdk-python-0.1.0/zscaler/zia/workload_groups.py +58 -0
  163. zscaler-sdk-python-0.1.0/zscaler/zia/zpa_gateway.py +187 -0
  164. zscaler-sdk-python-0.1.0/zscaler/zpa/README.md +40 -0
  165. zscaler-sdk-python-0.1.0/zscaler/zpa/__init__.py +683 -0
  166. zscaler-sdk-python-0.1.0/zscaler/zpa/app_segments.py +331 -0
  167. zscaler-sdk-python-0.1.0/zscaler/zpa/app_segments_inspection.py +311 -0
  168. zscaler-sdk-python-0.1.0/zscaler/zpa/app_segments_pra.py +310 -0
  169. zscaler-sdk-python-0.1.0/zscaler/zpa/certificates.py +234 -0
  170. zscaler-sdk-python-0.1.0/zscaler/zpa/client.py +113 -0
  171. zscaler-sdk-python-0.1.0/zscaler/zpa/cloud_connector_groups.py +75 -0
  172. zscaler-sdk-python-0.1.0/zscaler/zpa/connectors.py +518 -0
  173. zscaler-sdk-python-0.1.0/zscaler/zpa/emergency_access.py +178 -0
  174. zscaler-sdk-python-0.1.0/zscaler/zpa/errors.py +37 -0
  175. zscaler-sdk-python-0.1.0/zscaler/zpa/idp.py +83 -0
  176. zscaler-sdk-python-0.1.0/zscaler/zpa/inspection.py +1012 -0
  177. zscaler-sdk-python-0.1.0/zscaler/zpa/isolation_profile.py +87 -0
  178. zscaler-sdk-python-0.1.0/zscaler/zpa/lss.py +568 -0
  179. zscaler-sdk-python-0.1.0/zscaler/zpa/machine_groups.py +79 -0
  180. zscaler-sdk-python-0.1.0/zscaler/zpa/policies.py +848 -0
  181. zscaler-sdk-python-0.1.0/zscaler/zpa/posture_profiles.py +122 -0
  182. zscaler-sdk-python-0.1.0/zscaler/zpa/privileged_remote_access.py +867 -0
  183. zscaler-sdk-python-0.1.0/zscaler/zpa/provisioning.py +271 -0
  184. zscaler-sdk-python-0.1.0/zscaler/zpa/saml_attributes.py +100 -0
  185. zscaler-sdk-python-0.1.0/zscaler/zpa/scim_attributes.py +117 -0
  186. zscaler-sdk-python-0.1.0/zscaler/zpa/scim_groups.py +135 -0
  187. zscaler-sdk-python-0.1.0/zscaler/zpa/segment_groups.py +191 -0
  188. zscaler-sdk-python-0.1.0/zscaler/zpa/server_groups.py +217 -0
  189. zscaler-sdk-python-0.1.0/zscaler/zpa/servers.py +202 -0
  190. zscaler-sdk-python-0.1.0/zscaler/zpa/service_edges.py +404 -0
  191. zscaler-sdk-python-0.1.0/zscaler/zpa/trusted_networks.py +127 -0
  192. zscaler-sdk-python-0.1.0/zscaler_sdk_python.egg-info/PKG-INFO +243 -0
  193. zscaler-sdk-python-0.1.0/zscaler_sdk_python.egg-info/SOURCES.txt +195 -0
  194. zscaler-sdk-python-0.1.0/zscaler_sdk_python.egg-info/dependency_links.txt +1 -0
  195. zscaler-sdk-python-0.1.0/zscaler_sdk_python.egg-info/requires.txt +19 -0
  196. zscaler-sdk-python-0.1.0/zscaler_sdk_python.egg-info/top_level.txt +1 -0
@@ -0,0 +1,9 @@
1
+ # Zscaler Python SDK Changelog
2
+
3
+ ## 0.1.0 (April, 18 2024)
4
+
5
+ ### Notes
6
+
7
+ - Python Versions: **v3.8, v3.9, v3.10, v3.11**
8
+
9
+ 🎉 **Initial Release** 🎉
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 [Zscaler](https://github.com/zscaler)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,232 @@
1
+ # Official Python SDK for the Zscaler Products
2
+
3
+ [![CI/CD](https://github.com/zscaler/zscaler-sdk-python/actions/workflows/ci.yml/badge.svg)](https://github.com/zscaler/zscaler-sdk-python/actions/workflows/ci.yml)
4
+ [![Documentation Status](https://readthedocs.org/projects/zscaler-sdk-python/badge/?version=latest)](https://zscaler-sdk-python.readthedocs.io/en/latest/?badge=latest)
5
+ [![License](https://img.shields.io/github/license/zscaler/zscaler-sdk-python.svg)](https://github.com/zscaler/zscaler-sdk-python)
6
+ [![Latest version released on PyPi](https://img.shields.io/pypi/v/zscaler-sdk-python.svg)](https://pypi.org/project/zscaler-sdk-python)
7
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/zscaler-sdk-python.svg)](https://pypi.python.org/pypi/zscaler-sdk-python/)
8
+ [![GitHub Release](https://img.shields.io/github/release/zscaler/zscaler-sdk-python.svg)](https://github.com/zscaler/zscaler-sdk-python/releases/)
9
+ [![Zscaler Community](https://img.shields.io/badge/zscaler-community-blue)](https://community.zscaler.com/)
10
+
11
+ ## Support Disclaimer
12
+
13
+ -> **Disclaimer:** Please refer to our [General Support Statement](docs/guides/support.md) before proceeding with the use of this provider. You can also refer to our [troubleshooting guide](docs/guides/troubleshooting.md) for guidance on typical problems.
14
+
15
+ ## Zscaler Python SDK Overview
16
+
17
+ This repository contains the Zscaler SDK for Python. This SDK can be used to interact with several Zscaler services such as:
18
+
19
+ * Zscaler Private Access (ZPA)
20
+ * Zscaler Internet Access (ZIA)
21
+ * [Documentation](http://zscaler-sdk-python.readthedocs.io)
22
+
23
+ -----
24
+
25
+ Each Zscaler product has separate developer documentation and authentication methods. This SDK aims to simplify
26
+ software development using the Zscaler API for both customers and partners.
27
+
28
+ - [Release Status](#release-status)
29
+ - [Need help?](#need-help)
30
+ - [Getting Started](#getting-started)
31
+ - [Pagination](#pagination)
32
+ - [Logging](#logging)
33
+ - [Rate Limiting](#rate-limiting)
34
+ - [Environment variables](#environment-variables)
35
+ - [Building the SDK](#building-the-sdk)
36
+ - [Contributing](#contributing)
37
+
38
+ > Requires Python version 3.8.0 or higher.
39
+
40
+ ## Need help?
41
+
42
+ If you run into problems using the SDK, you can:
43
+
44
+ - Ask questions on the [Zenith Community][zenith]
45
+ - Post [issues on GitHub][github-issues] (for code errors)
46
+ - Support [customer support portal][zscaler-support]
47
+
48
+ ## Getting started
49
+
50
+ To install the Zscaler Python SDK in your project:
51
+
52
+ ```sh
53
+ pip install zscaler-sdk-python
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ Before you can interact with any of the Zscaler APIs, you need to generate API keys or retrieve tenancy information for each product that you are interfacing with. Once you have the requirements and you have installed Zscaler SDK Python, you're ready to go.
59
+
60
+ ### Quick ZIA Example
61
+
62
+ ```python
63
+ from zscaler import ZIAClientHelper
64
+ from pprint import pprint
65
+
66
+ zia = ZIAClientHelper(username='ZIA_USERNAME', password='ZIA_PASSWORD', api_key='ZIA_API_KEY', cloud='ZIA_CLOUD')
67
+ for user in zia.users.list_users():
68
+ pprint(user)
69
+ ```
70
+
71
+ ### Quick ZPA Example
72
+
73
+ ```python
74
+ from zscaler import ZPAClientHelper
75
+ from pprint import pprint
76
+
77
+ zpa = ZPAClientHelper(client_id='ZPA_CLIENT_ID', client_secret='ZPA_CLIENT_SECRET', customer_id='ZPA_CUSTOMER_ID', cloud='ZPA_CLOUD')
78
+ for app_segment in zpa.app_segments.list_segments():
79
+ pprint(app_segment)
80
+ ```
81
+
82
+ ~> **NOTE** The `ZPA_CLOUD` environment variable is optional and only required if your project needs to interact with any other ZPA cloud other than production cloud. In this case, use the `ZPA_CLOUD` environment variable followed by the name of the corresponding environment: `ZPA_CLOUD=BETA`, `ZPA_CLOUD=ZPATWO`, `ZPA_CLOUD=GOV`, `ZPA_CLOUD=GOVUS`, `ZPA_CLOUD=PREVIEW`, `ZPA_CLOUD=DEV`.
83
+
84
+ ## Pagination
85
+
86
+ This SDK provides methods that retrieve a list of resources from the API, which return paginated results due to the volume of data. Each method capable of returning paginated data is prefixed as `list_` and handles the pagination internally by providing an easy interface to iterate through pages. The user does not need to manually fetch each page; instead, they can process items as they iterate through them.
87
+
88
+ ### Example of Iterating Over Paginated Results
89
+
90
+ The following example shows how you can list ZPA items using this SDK, processing each item one at a time. This pattern is useful for operations that need to handle large datasets efficiently.
91
+
92
+ ```python
93
+ from zscaler import ZPAClientHelper
94
+ from pprint import pprint
95
+
96
+ # Initialize the client
97
+ zpa = ZPAClientHelper(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, customer_id=CUSTOMER_ID, cloud=CLOUD)
98
+
99
+ for apps in zpa.app_segments.list_segments():
100
+ pprint(apps)
101
+ ```
102
+
103
+ ### Customizing Pagination Parameters
104
+
105
+ While pagination is handled automatically, you can also customize pagination behavior by specifying parameters such as data_per_page and max_items. These parameters give you control over the volume of data fetched per request and the total amount of data to process. This is useful for limiting the scope of data fetched
106
+
107
+ * `max_pages`: controls the number of items fetched per API call (per page).
108
+ * `max_items`: controls the total number of items to retrieve across all pages.
109
+
110
+ ```python
111
+ from zscaler import ZPAClientHelper
112
+ from pprint import pprint
113
+
114
+ # Initialize the client
115
+ zpa = ZPAClientHelper(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, customer_id=CUSTOMER_ID, cloud=CLOUD)
116
+
117
+ pagination_params = {
118
+ 'max_pages': 1,
119
+ 'max_items': 5
120
+ }
121
+
122
+ # Fetch data using custom pagination settings
123
+ segments = zpa.app_segments.list_segments(**pagination_params)
124
+ for segment in segments:
125
+ pprint(segment)
126
+ ```
127
+
128
+ ### Efficient Pagination Handling
129
+
130
+ For more details on each pagination parameter see:
131
+ [ZPA Pagination Parameters](zscaler/zpa/README.md)
132
+ [ZIA Pagination Parameters](zscaler/zia/README.md)
133
+
134
+ ## Logging
135
+
136
+ The Zscaler SDK Python, provides robust logging for debug purposes.
137
+ Logs are disabled by default and should be enabled explicitly via custom environment variable:
138
+
139
+ * `ZSCALER_SDK_LOG` - Turn on logging
140
+ * `ZSCALER_SDK_VERBOSE` - Turn on logging in verbose mode
141
+
142
+ ```sh
143
+ export ZSCALER_SDK_LOG=true
144
+ export ZSCALER_SDK_VERBOSE=true
145
+ ```
146
+
147
+ **NOTE**: DO NOT SET DEBUG LEVEL IN PRODUCTION!
148
+
149
+ You should now see logs in your console. Notice that API tokens are **NOT** logged to the console; however, we still advise to use caution and never use `DEBUG` level logging in production.
150
+
151
+ What it being logged? `requests`, `responses`, `http errors`, `caching responses`.
152
+
153
+ ### Environment variables
154
+
155
+ Each one of the configuration values above can be turned into an environment variable name with the `_` (underscore) character and UPPERCASE characters. The following are accepted:
156
+
157
+ - `ZSCALER_CLIENT_CACHE_ENABLED` - Enable or disable the caching mechanism within the clien
158
+ - `ZSCALER_CLIENT_CACHE_DEFAULT_TTL` - Duration (in seconds) that cached data remains valid. By default data is cached in memory for `3600` seconds.
159
+ - `ZSCALER_CLIENT_CACHE_DEFAULT_TTI` - This environment variable sets the maximum amount of time (in seconds) that cached data can remain in the cache without being accessed. If the cached data is not accessed within this timeframe, it is removed from the cache, regardless of its TTL. The default TTI is `1800` seconds (`30 minutes`)
160
+ - `ZSCALER_SDK_LOG` - Turn on logging
161
+ - `ZSCALER_SDK_VERBOSE` - Turn on logging in verbose mode
162
+
163
+ ## Rate Limiting
164
+
165
+ Zscaler provides unique rate limiting numbers for each individual product. Regardless of the product, a 429 response will be returned if too many requests are made within a given time.
166
+ Please see:
167
+ * [ZPA Rate Limiting][rate-limiting-zpa] for rate limiting requirements.
168
+ * [ZIA Rate Limiting][rate-limiting-zia] for a complete list of which endpoints are rate limited.
169
+
170
+ When a 429 error is received, the `Retry-After` header will tell you the time at which you can retry. This section discusses the method for handling rate limiting with this SDK.
171
+
172
+ ### Built-In Retry
173
+
174
+ This SDK uses the built-in retry strategy to automatically retry on 429 errors. The default Maximum Retry Attempts for both ZIA and ZPA explicitly limits the number of retry attempts to a maximum of `5`.
175
+
176
+ Retry Conditions: The client for both ZPA and ZIA retries a request under the following conditions:
177
+
178
+ * HTTP status code 429 (Too Many Requests): This indicates that the rate limit has been exceeded. The client waits for a duration specified by the `Retry-After` header, if present, or a default of `2 ` seconds, before retrying.
179
+
180
+ * Exceptions during request execution: Any requests.RequestException encountered during the request triggers a retry, except on the last attempt, where the exception is raised.
181
+
182
+ ## Building the SDK
183
+
184
+ In most cases, you won't need to build the SDK from source. If you want to build it yourself, you'll need these prerequisites:
185
+
186
+ - Clone the repo
187
+ - Run `make build:dist` from the root of the project (assuming Python is installed)
188
+ - Ensure tests run succesfully.
189
+ - Install `tox` if not installed already using: `pip install tox`.
190
+ - Run tests using `tox` in the root directory of the project.
191
+
192
+ ## Contributing
193
+
194
+ At this moment we are not accepting contributions, but we welcome suggestions on how to improve this SDK or feature requests, which can then be added in future releases.
195
+
196
+ [zenith]: https://community.zscaler.com/
197
+ [zscaler-support]: https://help.zscaler.com/contact-support
198
+ [github-issues]: https://github.com/zscaler/zscaler-sdk-python/issues
199
+ [rate-limiting-zpa]: https://help.zscaler.com/zpa/understanding-rate-limiting
200
+ [rate-limiting-zia]: https://help.zscaler.com/zia/understanding-rate-limiting
201
+
202
+ Contributors
203
+ ------------
204
+
205
+ - William Guilherme - [willguibr](https://github.com/willguibr)
206
+ - Eddie Parra - [eparra](https://github.com/eparra)
207
+ - Paul Abbot - [abbottp](https://github.com/abbottp)
208
+
209
+ ## License
210
+ MIT License
211
+
212
+ =======
213
+
214
+ Copyright (c) 2023 [Zscaler](https://github.com/zscaler)
215
+
216
+ Permission is hereby granted, free of charge, to any person obtaining a copy
217
+ of this software and associated documentation files (the "Software"), to deal
218
+ in the Software without restriction, including without limitation the rights
219
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
220
+ copies of the Software, and to permit persons to whom the Software is
221
+ furnished to do so, subject to the following conditions:
222
+
223
+ The above copyright notice and this permission notice shall be included in all
224
+ copies or substantial portions of the Software.
225
+
226
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
227
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
228
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
229
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
230
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
231
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
232
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include CHANGELOG.md LICENSE.md README.md LONG_DESCRIPTION.md tox.ini requirements.txt
2
+
3
+ recursive-include tests *
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
6
+
7
+ recursive-include docsrc *.rst conf.py Makefile
8
+
@@ -0,0 +1,243 @@
1
+ Metadata-Version: 2.1
2
+ Name: zscaler-sdk-python
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Zscaler Products
5
+ Home-page: https://github.com/zscaler/zscaler-sdk-python
6
+ Author: Zscaler Technology Alliances
7
+ Author-email: devrel@zscaler.com
8
+ Requires-Python: >=3.8,<4.0
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.md
11
+
12
+ # Official Python SDK for the Zscaler Products
13
+
14
+ [![CI/CD](https://github.com/zscaler/zscaler-sdk-python/actions/workflows/ci.yml/badge.svg)](https://github.com/zscaler/zscaler-sdk-python/actions/workflows/ci.yml)
15
+ [![Documentation Status](https://readthedocs.org/projects/zscaler-sdk-python/badge/?version=latest)](https://zscaler-sdk-python.readthedocs.io/en/latest/?badge=latest)
16
+ [![License](https://img.shields.io/github/license/zscaler/zscaler-sdk-python.svg)](https://github.com/zscaler/zscaler-sdk-python)
17
+ [![Latest version released on PyPi](https://img.shields.io/pypi/v/zscaler-sdk-python.svg)](https://pypi.org/project/zscaler-sdk-python)
18
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/zscaler-sdk-python.svg)](https://pypi.python.org/pypi/zscaler-sdk-python/)
19
+ [![GitHub Release](https://img.shields.io/github/release/zscaler/zscaler-sdk-python.svg)](https://github.com/zscaler/zscaler-sdk-python/releases/)
20
+ [![Zscaler Community](https://img.shields.io/badge/zscaler-community-blue)](https://community.zscaler.com/)
21
+
22
+ ## Support Disclaimer
23
+
24
+ -> **Disclaimer:** Please refer to our [General Support Statement](docs/guides/support.md) before proceeding with the use of this provider. You can also refer to our [troubleshooting guide](docs/guides/troubleshooting.md) for guidance on typical problems.
25
+
26
+ ## Zscaler Python SDK Overview
27
+
28
+ This repository contains the Zscaler SDK for Python. This SDK can be used to interact with several Zscaler services such as:
29
+
30
+ * Zscaler Private Access (ZPA)
31
+ * Zscaler Internet Access (ZIA)
32
+ * [Documentation](http://zscaler-sdk-python.readthedocs.io)
33
+
34
+ -----
35
+
36
+ Each Zscaler product has separate developer documentation and authentication methods. This SDK aims to simplify
37
+ software development using the Zscaler API for both customers and partners.
38
+
39
+ - [Release Status](#release-status)
40
+ - [Need help?](#need-help)
41
+ - [Getting Started](#getting-started)
42
+ - [Pagination](#pagination)
43
+ - [Logging](#logging)
44
+ - [Rate Limiting](#rate-limiting)
45
+ - [Environment variables](#environment-variables)
46
+ - [Building the SDK](#building-the-sdk)
47
+ - [Contributing](#contributing)
48
+
49
+ > Requires Python version 3.8.0 or higher.
50
+
51
+ ## Need help?
52
+
53
+ If you run into problems using the SDK, you can:
54
+
55
+ - Ask questions on the [Zenith Community][zenith]
56
+ - Post [issues on GitHub][github-issues] (for code errors)
57
+ - Support [customer support portal][zscaler-support]
58
+
59
+ ## Getting started
60
+
61
+ To install the Zscaler Python SDK in your project:
62
+
63
+ ```sh
64
+ pip install zscaler-sdk-python
65
+ ```
66
+
67
+ ## Usage
68
+
69
+ Before you can interact with any of the Zscaler APIs, you need to generate API keys or retrieve tenancy information for each product that you are interfacing with. Once you have the requirements and you have installed Zscaler SDK Python, you're ready to go.
70
+
71
+ ### Quick ZIA Example
72
+
73
+ ```python
74
+ from zscaler import ZIAClientHelper
75
+ from pprint import pprint
76
+
77
+ zia = ZIAClientHelper(username='ZIA_USERNAME', password='ZIA_PASSWORD', api_key='ZIA_API_KEY', cloud='ZIA_CLOUD')
78
+ for user in zia.users.list_users():
79
+ pprint(user)
80
+ ```
81
+
82
+ ### Quick ZPA Example
83
+
84
+ ```python
85
+ from zscaler import ZPAClientHelper
86
+ from pprint import pprint
87
+
88
+ zpa = ZPAClientHelper(client_id='ZPA_CLIENT_ID', client_secret='ZPA_CLIENT_SECRET', customer_id='ZPA_CUSTOMER_ID', cloud='ZPA_CLOUD')
89
+ for app_segment in zpa.app_segments.list_segments():
90
+ pprint(app_segment)
91
+ ```
92
+
93
+ ~> **NOTE** The `ZPA_CLOUD` environment variable is optional and only required if your project needs to interact with any other ZPA cloud other than production cloud. In this case, use the `ZPA_CLOUD` environment variable followed by the name of the corresponding environment: `ZPA_CLOUD=BETA`, `ZPA_CLOUD=ZPATWO`, `ZPA_CLOUD=GOV`, `ZPA_CLOUD=GOVUS`, `ZPA_CLOUD=PREVIEW`, `ZPA_CLOUD=DEV`.
94
+
95
+ ## Pagination
96
+
97
+ This SDK provides methods that retrieve a list of resources from the API, which return paginated results due to the volume of data. Each method capable of returning paginated data is prefixed as `list_` and handles the pagination internally by providing an easy interface to iterate through pages. The user does not need to manually fetch each page; instead, they can process items as they iterate through them.
98
+
99
+ ### Example of Iterating Over Paginated Results
100
+
101
+ The following example shows how you can list ZPA items using this SDK, processing each item one at a time. This pattern is useful for operations that need to handle large datasets efficiently.
102
+
103
+ ```python
104
+ from zscaler import ZPAClientHelper
105
+ from pprint import pprint
106
+
107
+ # Initialize the client
108
+ zpa = ZPAClientHelper(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, customer_id=CUSTOMER_ID, cloud=CLOUD)
109
+
110
+ for apps in zpa.app_segments.list_segments():
111
+ pprint(apps)
112
+ ```
113
+
114
+ ### Customizing Pagination Parameters
115
+
116
+ While pagination is handled automatically, you can also customize pagination behavior by specifying parameters such as data_per_page and max_items. These parameters give you control over the volume of data fetched per request and the total amount of data to process. This is useful for limiting the scope of data fetched
117
+
118
+ * `max_pages`: controls the number of items fetched per API call (per page).
119
+ * `max_items`: controls the total number of items to retrieve across all pages.
120
+
121
+ ```python
122
+ from zscaler import ZPAClientHelper
123
+ from pprint import pprint
124
+
125
+ # Initialize the client
126
+ zpa = ZPAClientHelper(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, customer_id=CUSTOMER_ID, cloud=CLOUD)
127
+
128
+ pagination_params = {
129
+ 'max_pages': 1,
130
+ 'max_items': 5
131
+ }
132
+
133
+ # Fetch data using custom pagination settings
134
+ segments = zpa.app_segments.list_segments(**pagination_params)
135
+ for segment in segments:
136
+ pprint(segment)
137
+ ```
138
+
139
+ ### Efficient Pagination Handling
140
+
141
+ For more details on each pagination parameter see:
142
+ [ZPA Pagination Parameters](zscaler/zpa/README.md)
143
+ [ZIA Pagination Parameters](zscaler/zia/README.md)
144
+
145
+ ## Logging
146
+
147
+ The Zscaler SDK Python, provides robust logging for debug purposes.
148
+ Logs are disabled by default and should be enabled explicitly via custom environment variable:
149
+
150
+ * `ZSCALER_SDK_LOG` - Turn on logging
151
+ * `ZSCALER_SDK_VERBOSE` - Turn on logging in verbose mode
152
+
153
+ ```sh
154
+ export ZSCALER_SDK_LOG=true
155
+ export ZSCALER_SDK_VERBOSE=true
156
+ ```
157
+
158
+ **NOTE**: DO NOT SET DEBUG LEVEL IN PRODUCTION!
159
+
160
+ You should now see logs in your console. Notice that API tokens are **NOT** logged to the console; however, we still advise to use caution and never use `DEBUG` level logging in production.
161
+
162
+ What it being logged? `requests`, `responses`, `http errors`, `caching responses`.
163
+
164
+ ### Environment variables
165
+
166
+ Each one of the configuration values above can be turned into an environment variable name with the `_` (underscore) character and UPPERCASE characters. The following are accepted:
167
+
168
+ - `ZSCALER_CLIENT_CACHE_ENABLED` - Enable or disable the caching mechanism within the clien
169
+ - `ZSCALER_CLIENT_CACHE_DEFAULT_TTL` - Duration (in seconds) that cached data remains valid. By default data is cached in memory for `3600` seconds.
170
+ - `ZSCALER_CLIENT_CACHE_DEFAULT_TTI` - This environment variable sets the maximum amount of time (in seconds) that cached data can remain in the cache without being accessed. If the cached data is not accessed within this timeframe, it is removed from the cache, regardless of its TTL. The default TTI is `1800` seconds (`30 minutes`)
171
+ - `ZSCALER_SDK_LOG` - Turn on logging
172
+ - `ZSCALER_SDK_VERBOSE` - Turn on logging in verbose mode
173
+
174
+ ## Rate Limiting
175
+
176
+ Zscaler provides unique rate limiting numbers for each individual product. Regardless of the product, a 429 response will be returned if too many requests are made within a given time.
177
+ Please see:
178
+ * [ZPA Rate Limiting][rate-limiting-zpa] for rate limiting requirements.
179
+ * [ZIA Rate Limiting][rate-limiting-zia] for a complete list of which endpoints are rate limited.
180
+
181
+ When a 429 error is received, the `Retry-After` header will tell you the time at which you can retry. This section discusses the method for handling rate limiting with this SDK.
182
+
183
+ ### Built-In Retry
184
+
185
+ This SDK uses the built-in retry strategy to automatically retry on 429 errors. The default Maximum Retry Attempts for both ZIA and ZPA explicitly limits the number of retry attempts to a maximum of `5`.
186
+
187
+ Retry Conditions: The client for both ZPA and ZIA retries a request under the following conditions:
188
+
189
+ * HTTP status code 429 (Too Many Requests): This indicates that the rate limit has been exceeded. The client waits for a duration specified by the `Retry-After` header, if present, or a default of `2 ` seconds, before retrying.
190
+
191
+ * Exceptions during request execution: Any requests.RequestException encountered during the request triggers a retry, except on the last attempt, where the exception is raised.
192
+
193
+ ## Building the SDK
194
+
195
+ In most cases, you won't need to build the SDK from source. If you want to build it yourself, you'll need these prerequisites:
196
+
197
+ - Clone the repo
198
+ - Run `make build:dist` from the root of the project (assuming Python is installed)
199
+ - Ensure tests run succesfully.
200
+ - Install `tox` if not installed already using: `pip install tox`.
201
+ - Run tests using `tox` in the root directory of the project.
202
+
203
+ ## Contributing
204
+
205
+ At this moment we are not accepting contributions, but we welcome suggestions on how to improve this SDK or feature requests, which can then be added in future releases.
206
+
207
+ [zenith]: https://community.zscaler.com/
208
+ [zscaler-support]: https://help.zscaler.com/contact-support
209
+ [github-issues]: https://github.com/zscaler/zscaler-sdk-python/issues
210
+ [rate-limiting-zpa]: https://help.zscaler.com/zpa/understanding-rate-limiting
211
+ [rate-limiting-zia]: https://help.zscaler.com/zia/understanding-rate-limiting
212
+
213
+ Contributors
214
+ ------------
215
+
216
+ - William Guilherme - [willguibr](https://github.com/willguibr)
217
+ - Eddie Parra - [eparra](https://github.com/eparra)
218
+ - Paul Abbot - [abbottp](https://github.com/abbottp)
219
+
220
+ ## License
221
+ MIT License
222
+
223
+ =======
224
+
225
+ Copyright (c) 2023 [Zscaler](https://github.com/zscaler)
226
+
227
+ Permission is hereby granted, free of charge, to any person obtaining a copy
228
+ of this software and associated documentation files (the "Software"), to deal
229
+ in the Software without restriction, including without limitation the rights
230
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
231
+ copies of the Software, and to permit persons to whom the Software is
232
+ furnished to do so, subject to the following conditions:
233
+
234
+ The above copyright notice and this permission notice shall be included in all
235
+ copies or substantial portions of the Software.
236
+
237
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
238
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
239
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
240
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
241
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
242
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
243
+ SOFTWARE.