zscaler-sdk-python 0.6.1__tar.gz → 0.6.2__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 (87) hide show
  1. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/PKG-INFO +3 -3
  2. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/pyproject.toml +7 -7
  3. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/__init__.py +1 -1
  4. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/constants.py +1 -1
  5. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/__init__.py +4 -5
  6. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/locations.py +4 -4
  7. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/workload_groups.py +30 -4
  8. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/__init__.py +2 -2
  9. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/isolation.py +1 -1
  10. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/LICENSE.md +0 -0
  11. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/README.md +0 -0
  12. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/cache/__init__.py +0 -0
  13. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/cache/cache.py +0 -0
  14. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/cache/no_op_cache.py +0 -0
  15. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/cache/zscaler_cache.py +0 -0
  16. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/errors/__init__.py +0 -0
  17. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/errors/error.py +0 -0
  18. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/errors/http_error.py +0 -0
  19. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/errors/zscaler_api_error.py +0 -0
  20. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/exceptions/__init__.py +0 -0
  21. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/exceptions/exceptions.py +0 -0
  22. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/logger.py +0 -0
  23. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/ratelimiter/__init__.py +0 -0
  24. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/ratelimiter/ratelimiter.py +0 -0
  25. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/user_agent.py +0 -0
  26. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/utils.py +0 -0
  27. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/__init__.py +0 -0
  28. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/admin.py +0 -0
  29. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/alerts.py +0 -0
  30. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/apps.py +0 -0
  31. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/devices.py +0 -0
  32. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/filters.py +0 -0
  33. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/inventory.py +0 -0
  34. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/troubleshooting.py +0 -0
  35. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/users.py +0 -0
  36. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zdx/zdx_client.py +0 -0
  37. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/activate.py +0 -0
  38. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/admin_and_role_management.py +0 -0
  39. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/apptotal.py +0 -0
  40. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/audit_logs.py +0 -0
  41. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/authentication_settings.py +0 -0
  42. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/client.py +0 -0
  43. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/cloud_apps.py +0 -0
  44. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/device_management.py +0 -0
  45. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/dlp.py +0 -0
  46. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/errors.py +0 -0
  47. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/firewall.py +0 -0
  48. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/forwarding_control.py +0 -0
  49. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/isolation_profile.py +0 -0
  50. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/labels.py +0 -0
  51. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/sandbox.py +0 -0
  52. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/security.py +0 -0
  53. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/ssl_inspection.py +0 -0
  54. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/traffic.py +0 -0
  55. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/url_categories.py +0 -0
  56. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/url_filtering.py +0 -0
  57. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/users.py +0 -0
  58. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/web_dlp.py +0 -0
  59. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zia/zpa_gateway.py +0 -0
  60. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/README.md +0 -0
  61. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/app_segments.py +0 -0
  62. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/app_segments_inspection.py +0 -0
  63. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/app_segments_pra.py +0 -0
  64. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/authdomains.py +0 -0
  65. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/certificates.py +0 -0
  66. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/client.py +0 -0
  67. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/cloud_connector_groups.py +0 -0
  68. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/connectors.py +0 -0
  69. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/emergency_access.py +0 -0
  70. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/errors.py +0 -0
  71. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/idp.py +0 -0
  72. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/inspection.py +0 -0
  73. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/lss.py +0 -0
  74. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/machine_groups.py +0 -0
  75. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/microtenants.py +0 -0
  76. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/policies.py +0 -0
  77. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/posture_profiles.py +0 -0
  78. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/privileged_remote_access.py +0 -0
  79. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/provisioning.py +0 -0
  80. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/saml_attributes.py +0 -0
  81. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/scim_attributes.py +0 -0
  82. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/scim_groups.py +0 -0
  83. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/segment_groups.py +0 -0
  84. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/server_groups.py +0 -0
  85. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/servers.py +0 -0
  86. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/service_edges.py +0 -0
  87. {zscaler_sdk_python-0.6.1 → zscaler_sdk_python-0.6.2}/zscaler/zpa/trusted_networks.py +0 -0
@@ -1,23 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zscaler-sdk-python
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Official Python SDK for the Zscaler Products (Beta)
5
5
  Home-page: https://github.com/zscaler/zscaler-sdk-python
6
6
  License: MIT
7
7
  Keywords: zscaler,sdk,zpa,zia,zdx,zcc,zcon
8
8
  Author: Zscaler, Inc.
9
9
  Author-email: devrel@zscaler.com
10
- Requires-Python: >=3.8,<4.0
10
+ Requires-Python: >=3.9,<4.0
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.8
21
21
  Classifier: Topic :: Security
22
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Provides-Extra: dev
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "zscaler-sdk-python"
3
- version = "0.6.1"
3
+ version = "0.6.2"
4
4
  description = "Official Python SDK for the Zscaler Products (Beta)"
5
5
  authors = ["Zscaler, Inc. <devrel@zscaler.com>"]
6
6
  license = "MIT"
@@ -28,7 +28,7 @@ packages = [
28
28
  "Bug Tracker" = "https://github.com/zscaler/zscaler-sdk-python/issues"
29
29
 
30
30
  [tool.poetry.dependencies]
31
- python = ">=3.8,<4.0"
31
+ python = ">=3.9,<4.0"
32
32
  arrow = "*"
33
33
  certifi = ">=2024.2.2"
34
34
  charset-normalizer = "*"
@@ -55,15 +55,15 @@ okta = ">=2.9.7"
55
55
 
56
56
  [tool.poetry.dev-dependencies]
57
57
  black = ">=24.3.0"
58
- pytest = ">=8.2.1"
59
- pytest-asyncio = ">=0.23.7"
58
+ pytest = ">=8.2.2"
59
+ pytest-asyncio = "^0.23.8"
60
60
  pytest-mock = "*"
61
- pytest-recording = "*"
61
+ pytest-recording = "^0.13.2"
62
62
  pytest-cov = "*"
63
- pyfakefs = "*"
63
+ pyfakefs = "^5.6.0"
64
64
  isort = "*"
65
65
  wheel = "*"
66
- sphinx = "*"
66
+ sphinx = "^7.4.6"
67
67
  sphinx-autobuild = "*"
68
68
  sphinx_rtd_theme = "*"
69
69
 
@@ -29,7 +29,7 @@ __license__ = "MIT"
29
29
  __contributors__ = [
30
30
  "William Guilherme",
31
31
  ]
32
- __version__ = "0.6.1"
32
+ __version__ = "0.6.2"
33
33
 
34
34
  from zscaler.zia import ZIAClientHelper # noqa
35
35
  from zscaler.zpa import ZPAClientHelper # noqa
@@ -14,7 +14,7 @@ ZPA_BASE_URLS = {
14
14
 
15
15
  DEV_AUTH_URL = "https://authn1.dev.zpath.net/authn/v1/oauth/token"
16
16
 
17
- RETRYABLE_STATUS_CODES = {409, 429, 500, 502, 503, 504}
17
+ RETRYABLE_STATUS_CODES = {409, 412, 429, 500, 502, 503, 504}
18
18
  MAX_RETRIES = 5
19
19
  BACKOFF_FACTOR = 1
20
20
  BACKOFF_BASE_DURATION = 2
@@ -12,6 +12,7 @@ from box import Box, BoxList
12
12
  from zscaler import __version__
13
13
  from zscaler.cache.no_op_cache import NoOpCache
14
14
  from zscaler.cache.zscaler_cache import ZscalerCache
15
+ from zscaler.constants import MAX_RETRIES
15
16
  from zscaler.errors.http_error import HTTPError, ZscalerAPIError
16
17
  from zscaler.exceptions.exceptions import HTTPException, ZscalerAPIException
17
18
  from zscaler.logger import setup_logging
@@ -118,7 +119,7 @@ class ZIAClientHelper(ZIAClient):
118
119
  self.sandbox_token = kw.get("sandbox_token") or os.getenv(f"{self._env_base}_SANDBOX_TOKEN")
119
120
  self.timeout = timeout
120
121
  self.fail_safe = fail_safe
121
- cache_enabled = os.environ.get("ZSCALER_CLIENT_CACHE_ENABLED", "true").lower() == "true"
122
+ cache_enabled = os.environ.get("ZSCALER_CLIENT_CACHE_ENABLED", "false").lower() == "true"
122
123
  if cache is None:
123
124
  if cache_enabled:
124
125
  ttl = int(os.environ.get("ZSCALER_CLIENT_CACHE_DEFAULT_TTL", 3600))
@@ -168,13 +169,11 @@ class ZIAClientHelper(ZIAClient):
168
169
  if self.auth_details is None:
169
170
  return True
170
171
  now = datetime.datetime.now()
171
- if self.auth_details["passwordExpiryTime"] > 0 and (
172
- self.session_refreshed + datetime.timedelta(seconds=-self.session_timeout_offset) < now
173
- ):
172
+ if self.auth_details["passwordExpiryTime"] > 0 and (self.session_refreshed - self.session_timeout_offset < now):
174
173
  return True
175
174
  return False
176
175
 
177
- @retry_with_backoff(retries=5)
176
+ @retry_with_backoff(MAX_RETRIES)
178
177
  def authenticate(self) -> Box:
179
178
  """
180
179
  Creates a ZIA authentication session.
@@ -482,7 +482,7 @@ class LocationsAPI:
482
482
  status_code = response.status_code
483
483
  raise Exception(f"API call failed with status {status_code}: {response.json()}")
484
484
  return response
485
-
485
+
486
486
  def list_location_groups(self) -> BoxList:
487
487
  """
488
488
  Return a list of location groups in ZIA.
@@ -602,7 +602,7 @@ class LocationsAPI:
602
602
  Keyword Args:
603
603
  group_type (str): The location group's type (i.e., Static or Dynamic).
604
604
  last_mod_user (str): The admin who modified the location group last.
605
- version (int): The version parameter is for Zscaler internal use only. The version is used by the service for backup operations.
605
+ version (int): The version parameter is for Zscaler internal use only. Used by the service for backup operations.
606
606
  name (str): The location group's name.
607
607
  comments (str): Additional comments or information about the location group.
608
608
  location_id (int): The unique identifier for a location within a location group.
@@ -615,8 +615,8 @@ class LocationsAPI:
615
615
  >>> location = zia.locations.list_location_groups_count(group_type='Static', name='Corporate')
616
616
  """
617
617
  params = {}
618
- optional_params = ['group_type', 'last_mod_user', 'version', 'name', 'comments', 'location_id']
619
-
618
+ optional_params = ["group_type", "last_mod_user", "version", "name", "comments", "location_id"]
619
+
620
620
  for key in optional_params:
621
621
  if key in kwargs:
622
622
  params[key] = kwargs[key]
@@ -26,14 +26,14 @@ class WorkloadGroupsAPI:
26
26
 
27
27
  def list_groups(self, **kwargs) -> BoxList:
28
28
  """
29
- Returns a list of all firewall filter rules.
29
+ Returns a list of all workload groups configured in the ZIA Admin Portal.
30
30
 
31
31
  Returns:
32
- :obj:`BoxList`: The list of firewall filter rules
32
+ :obj:`BoxList`: The list of workload groups
33
33
 
34
34
  Examples:
35
- >>> for rule in zia.workload_groups.list_groups():
36
- ... pprint(rule)
35
+ >>> for workloads in zia.workload_groups.list_groups():
36
+ ... pprint(workloads)
37
37
 
38
38
  """
39
39
  response = self.rest.get("/workloadGroups")
@@ -43,6 +43,19 @@ class WorkloadGroupsAPI:
43
43
 
44
44
  # Search Workload Group By Name
45
45
  def get_group_by_name(self, name):
46
+ """
47
+ Retrieves a specific workload group by its name.
48
+
49
+ Args:
50
+ name (str): The name of the workload group to retrieve.
51
+
52
+ Returns:
53
+ :obj:`Box`: The workload group if found, otherwise None.
54
+
55
+ Examples:
56
+ >>> workload = zia.workload_groups.get_group_by_name('BD_WORKLOAD_GROUP01')
57
+ ... print(workload)
58
+ """
46
59
  groups = self.list_groups()
47
60
  for group in groups:
48
61
  if group.get("name") == name:
@@ -51,6 +64,19 @@ class WorkloadGroupsAPI:
51
64
 
52
65
  # Search Workload Group By ID
53
66
  def get_group_by_id(self, group_id):
67
+ """
68
+ Retrieves a specific workload group by its unique identifier.
69
+
70
+ Args:
71
+ profile_id (str): The ID of the workload group to retrieve.
72
+
73
+ Returns:
74
+ :obj:`Box`: The workload group if found, otherwise None.
75
+
76
+ Examples:
77
+ >>> workload = zia.get_group_by_name.get_group_by_id('12345')
78
+ ... print(workload)
79
+ """
54
80
  groups = self.list_groups()
55
81
  for group in groups:
56
82
  if group.get("id") == group_id:
@@ -11,7 +11,7 @@ from box import BoxList
11
11
  from zscaler import __version__
12
12
  from zscaler.cache.no_op_cache import NoOpCache
13
13
  from zscaler.cache.zscaler_cache import ZscalerCache
14
- from zscaler.constants import ZPA_BASE_URLS, DEV_AUTH_URL
14
+ from zscaler.constants import ZPA_BASE_URLS, DEV_AUTH_URL, MAX_RETRIES
15
15
  from zscaler.errors.http_error import HTTPError, ZscalerAPIError
16
16
  from zscaler.exceptions.exceptions import HTTPException, ZscalerAPIException
17
17
  from zscaler.logger import setup_logging
@@ -148,7 +148,7 @@ class ZPAClientHelper(ZPAClient):
148
148
  "User-Agent": self.user_agent,
149
149
  }
150
150
 
151
- @retry_with_backoff(retries=5)
151
+ @retry_with_backoff(MAX_RETRIES)
152
152
  def login(self):
153
153
  params = {"client_id": self.client_id, "client_secret": self.client_secret}
154
154
  headers = {
@@ -368,7 +368,7 @@ class IsolationAPI:
368
368
  return profile
369
369
  return None
370
370
 
371
- def list_cbi_profiles(self: str) -> Box:
371
+ def list_cbi_profiles(self) -> Box:
372
372
  """
373
373
  Returns information on the specified Cloud browser isolation.
374
374