zscaler-sdk-python 0.1.4__tar.gz → 0.1.5__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.
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/PKG-INFO +1 -1
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/pyproject.toml +1 -1
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/__init__.py +2 -2
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/__init__.py +3 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/client.py +5 -5
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/lss.py +42 -32
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/LICENSE.md +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/README.md +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/cache/__init__.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/cache/cache.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/cache/no_op_cache.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/cache/zscaler_cache.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/constants.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/errors/__init__.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/errors/error.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/errors/http_error.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/errors/zscaler_api_error.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/exceptions/__init__.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/exceptions/exceptions.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/logger.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/ratelimiter/__init__.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/ratelimiter/ratelimiter.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/user_agent.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/utils.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/__init__.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/activate.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/admin_and_role_management.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/apptotal.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/audit_logs.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/authentication_settings.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/client.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/cloud_apps.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/device_management.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/dlp.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/errors.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/firewall.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/forwarding_control.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/isolation_profile.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/labels.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/locations.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/sandbox.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/security.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/ssl_inspection.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/traffic.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/url_categories.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/url_filtering.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/users.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/web_dlp.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/workload_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/zpa_gateway.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/README.md +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/app_segments.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/app_segments_inspection.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/app_segments_pra.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/certificates.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/cloud_connector_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/connectors.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/emergency_access.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/errors.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/idp.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/inspection.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/isolation_profile.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/machine_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/policies.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/posture_profiles.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/privileged_remote_access.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/provisioning.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/saml_attributes.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/scim_attributes.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/scim_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/segment_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/server_groups.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/servers.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/service_edges.py +0 -0
- {zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/trusted_networks.py +0 -0
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
"""Official Python SDK for the Zscaler Products (Beta)
|
|
18
18
|
|
|
19
|
-
Zscaler SDK Python is an SDK that provides a uniform and easy-to-use
|
|
19
|
+
Zscaler SDK Python is an SDK that provides a uniform and easy-to-use
|
|
20
20
|
interface for each of the Zscaler product APIs.
|
|
21
21
|
|
|
22
22
|
Documentation available at https://zscaler-sdk-python.readthedocs.io
|
|
@@ -29,7 +29,7 @@ __license__ = "MIT"
|
|
|
29
29
|
__contributors__ = [
|
|
30
30
|
"William Guilherme",
|
|
31
31
|
]
|
|
32
|
-
__version__ = "0.1.
|
|
32
|
+
__version__ = "0.1.5"
|
|
33
33
|
|
|
34
34
|
from zscaler.zia import ZIAClientHelper # noqa
|
|
35
35
|
from zscaler.zpa import ZPAClientHelper # noqa
|
|
@@ -114,6 +114,7 @@ class ZPAClientHelper(ZPAClient):
|
|
|
114
114
|
self.url = f"{self.baseurl}/mgmtconfig/v1/admin/customers/{customer_id}"
|
|
115
115
|
self.user_config_url = f"{self.baseurl}/userconfig/v1/customers/{customer_id}"
|
|
116
116
|
self.v2_url = f"{self.baseurl}/mgmtconfig/v2/admin/customers/{customer_id}"
|
|
117
|
+
self.v2_lss_url = f"{self.baseurl}/mgmtconfig/v2/admin/lssConfig/customers/{customer_id}"
|
|
117
118
|
self.cbi_url = f"{self.baseurl}/cbiconfig/cbi/api/customers/{customer_id}"
|
|
118
119
|
self.fail_safe = fail_safe
|
|
119
120
|
# Cache setup
|
|
@@ -182,6 +183,8 @@ class ZPAClientHelper(ZPAClient):
|
|
|
182
183
|
api = self.url
|
|
183
184
|
elif api_version == "v2":
|
|
184
185
|
api = self.v2_url
|
|
186
|
+
elif api_version == "v2_lss":
|
|
187
|
+
api = self.v2_lss_url
|
|
185
188
|
elif api_version == "userconfig_v1":
|
|
186
189
|
api = self.user_config_url
|
|
187
190
|
|
|
@@ -33,7 +33,7 @@ class ZPAClient:
|
|
|
33
33
|
- path (str): API endpoint path.
|
|
34
34
|
- json (str): the request body.
|
|
35
35
|
- params (dict): the query params
|
|
36
|
-
- api_version (str): the api version, availbale values: v1, v2, userconfig_v1, cbiconfig_v1
|
|
36
|
+
- api_version (str): the api version, availbale values: v1, v2, v2_lss, userconfig_v1, cbiconfig_v1
|
|
37
37
|
"""
|
|
38
38
|
pass
|
|
39
39
|
|
|
@@ -64,7 +64,7 @@ class ZPAClient:
|
|
|
64
64
|
- data_key_name (str): list field key.
|
|
65
65
|
- data_per_page: the page size
|
|
66
66
|
- params (dict): the query params
|
|
67
|
-
- api_version (str): the api version, availbale values: v1, v2, userconfig_v1 or cbiconfig
|
|
67
|
+
- api_version (str): the api version, availbale values: v1, v2, v2_lss, userconfig_v1 or cbiconfig
|
|
68
68
|
"""
|
|
69
69
|
pass
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ class ZPAClient:
|
|
|
86
86
|
- path (str): API endpoint path.
|
|
87
87
|
- json (str): the request body.
|
|
88
88
|
- params (dict): the query params
|
|
89
|
-
- api_version (str): the api version, availbale values: v1, v2, userconfig_v1 or cbiconfig
|
|
89
|
+
- api_version (str): the api version, availbale values: v1, v2, v2_lss, userconfig_v1 or cbiconfig
|
|
90
90
|
"""
|
|
91
91
|
pass
|
|
92
92
|
|
|
@@ -97,7 +97,7 @@ class ZPAClient:
|
|
|
97
97
|
- path (str): API endpoint path.
|
|
98
98
|
- json (str): the request body.
|
|
99
99
|
- params (dict): the query params
|
|
100
|
-
- api_version (str): the api version, availbale values: v1, v2, userconfig_v1 or cbiconfig
|
|
100
|
+
- api_version (str): the api version, availbale values: v1, v2, v2_lss, userconfig_v1 or cbiconfig
|
|
101
101
|
"""
|
|
102
102
|
pass
|
|
103
103
|
|
|
@@ -108,6 +108,6 @@ class ZPAClient:
|
|
|
108
108
|
- path (str): API endpoint path.
|
|
109
109
|
- json (str): the request body.
|
|
110
110
|
- params (dict): the query params
|
|
111
|
-
- api_version (str): the api version, availbale values: v1, v2, userconfig_v1 or cbiconfig
|
|
111
|
+
- api_version (str): the api version, availbale values: v1, v2, v2_lss, userconfig_v1 or cbiconfig
|
|
112
112
|
"""
|
|
113
113
|
pass
|
|
@@ -88,42 +88,41 @@ class LSSConfigControllerAPI:
|
|
|
88
88
|
|
|
89
89
|
return template
|
|
90
90
|
|
|
91
|
-
def get_client_types(self) -> Box:
|
|
91
|
+
def get_client_types(self, client_type=None) -> Box:
|
|
92
92
|
"""
|
|
93
|
-
Returns all available LSS Client Types.
|
|
93
|
+
Returns all available LSS Client Types or a specific Client Type if specified.
|
|
94
94
|
|
|
95
|
-
Client Types are used when creating LSS Receiver configs.
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
Client Types are used when creating LSS Receiver configs.
|
|
96
|
+
ZPA uses an internal code for Client Types, e.g.
|
|
97
|
+
`zpn_client_type_ip_anchoring` is the Client Type for a ZIA Service Edge.
|
|
98
|
+
The zscaler-sdk-python inverts the key/value so
|
|
99
|
+
that you can perform a lookup using a human-readable name in your code (e.g. `cloud_connector`).
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
client_type_name (str, optional): The human-readable name of the client type to filter for.
|
|
98
103
|
|
|
99
104
|
Returns:
|
|
100
|
-
:obj:`Box`: Dictionary containing all LSS Client
|
|
105
|
+
:obj:`Box`: Dictionary containing all or a specific LSS Client Type with human-readable name as the key.
|
|
101
106
|
|
|
102
107
|
Examples:
|
|
103
108
|
Print all LSS Client Types:
|
|
104
|
-
|
|
105
109
|
>>> print(zpa.lss.get_client_types())
|
|
106
110
|
|
|
111
|
+
Print only the 'web_browser' Client Type:
|
|
112
|
+
>>> print(zpa.lss.get_client_types('web_browser'))
|
|
107
113
|
"""
|
|
108
|
-
|
|
109
|
-
# won't know. This method reverses the dictionary, converts the 'normalised' Client Type name to snake_case
|
|
110
|
-
# before returning it so that a lookup can be easily performed using the Client Type name in plain english.
|
|
111
|
-
#
|
|
112
|
-
# Example before:
|
|
113
|
-
# {'zpn_client_type_exporter': 'Web Browser'}
|
|
114
|
-
# Example after:
|
|
115
|
-
# {'web_browser': 'zpn_client_type_exporter'}
|
|
116
|
-
|
|
117
|
-
response = requests.get(f"{self.v2_admin_url}/clientTypes", headers=self.rest.headers)
|
|
118
|
-
|
|
114
|
+
response = self.rest.send("GET", "clientTypes", api_version="v2_lss")
|
|
119
115
|
if response.status_code == 200:
|
|
120
|
-
|
|
116
|
+
client_types = response.json()
|
|
117
|
+
reverse_map = {v.lower().replace(" ", "_"): k for k, v in client_types.items()}
|
|
118
|
+
box = Box(reverse_map)
|
|
119
|
+
|
|
120
|
+
if client_type and client_type in box:
|
|
121
|
+
return Box({client_type: box[client_type]})
|
|
122
|
+
return box
|
|
121
123
|
else:
|
|
122
124
|
response.raise_for_status()
|
|
123
125
|
|
|
124
|
-
reverse_map = {v.lower().replace(" ", "_"): k for k, v in response.items()}
|
|
125
|
-
return Box(reverse_map)
|
|
126
|
-
|
|
127
126
|
def list_configs(self, **kwargs) -> BoxList:
|
|
128
127
|
"""
|
|
129
128
|
Returns all configured LSS receivers.
|
|
@@ -167,32 +166,43 @@ class LSSConfigControllerAPI:
|
|
|
167
166
|
>>> print(zpa.lss.get_config('99999'))
|
|
168
167
|
|
|
169
168
|
"""
|
|
170
|
-
response = self.rest.
|
|
169
|
+
response = self.rest.send("GET", "/lssConfig/%s" % (lss_id), api_version="v2")
|
|
171
170
|
if isinstance(response, Response):
|
|
172
171
|
status_code = response.status_code
|
|
173
172
|
if status_code != 200:
|
|
174
173
|
return None
|
|
175
174
|
return response
|
|
176
175
|
|
|
177
|
-
def get_log_formats(self) -> Box:
|
|
176
|
+
def get_log_formats(self, log_type=None) -> Box:
|
|
178
177
|
"""
|
|
179
|
-
Returns all available pre-configured LSS Log Formats.
|
|
178
|
+
Returns all available pre-configured LSS Log Formats or a specific log format if specified.
|
|
180
179
|
|
|
181
|
-
LSS Log Formats are provided as either CSV, JSON or TSV.
|
|
180
|
+
LSS Log Formats are provided as either CSV, JSON, or TSV. The values can be used when
|
|
182
181
|
creating or updating LSS Log Receiver configs.
|
|
183
182
|
|
|
183
|
+
Args:
|
|
184
|
+
log_type_name (str, optional): The name of the log type to retrieve (e.g., 'zpn_ast_comprehensive_stats').
|
|
185
|
+
|
|
184
186
|
Returns:
|
|
185
187
|
:obj:`Box`: Dictionary containing pre-configured LSS Log Formats.
|
|
186
188
|
|
|
187
189
|
Examples:
|
|
188
|
-
>>>
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
>>> print(zpa.lss.get_log_formats())
|
|
191
|
+
>>> print(zpa.lss.get_log_formats('zpn_ast_comprehensive_stats'))
|
|
191
192
|
"""
|
|
192
|
-
response =
|
|
193
|
-
|
|
193
|
+
response = self.rest.send("GET", "lssConfig/logType/formats", api_version="v2")
|
|
194
194
|
if response.status_code == 200:
|
|
195
|
-
|
|
195
|
+
formats = response.json()
|
|
196
|
+
if log_type:
|
|
197
|
+
# Filter and return only the requested log type
|
|
198
|
+
specific_format = formats.get(log_type, None)
|
|
199
|
+
if specific_format:
|
|
200
|
+
return Box({log_type: specific_format})
|
|
201
|
+
else:
|
|
202
|
+
return Box() # or raise an Exception if preferred
|
|
203
|
+
else:
|
|
204
|
+
# Return all formats
|
|
205
|
+
return Box(formats)
|
|
196
206
|
else:
|
|
197
207
|
response.raise_for_status()
|
|
198
208
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/admin_and_role_management.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zia/authentication_settings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/app_segments_inspection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.1.4 → zscaler_sdk_python-0.1.5}/zscaler/zpa/privileged_remote_access.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|