zscaler-sdk-python 0.1.3__tar.gz → 0.1.4__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.3 → zscaler_sdk_python-0.1.4}/PKG-INFO +1 -1
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/pyproject.toml +1 -1
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/__init__.py +1 -1
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/connectors.py +24 -12
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/LICENSE.md +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/README.md +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/cache/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/cache/cache.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/cache/no_op_cache.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/cache/zscaler_cache.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/constants.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/errors/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/errors/error.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/errors/http_error.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/errors/zscaler_api_error.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/exceptions/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/exceptions/exceptions.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/logger.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/ratelimiter/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/ratelimiter/ratelimiter.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/user_agent.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/utils.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/activate.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/admin_and_role_management.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/apptotal.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/audit_logs.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/authentication_settings.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/client.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/cloud_apps.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/device_management.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/dlp.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/errors.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/firewall.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/forwarding_control.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/isolation_profile.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/labels.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/locations.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/sandbox.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/security.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/ssl_inspection.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/traffic.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/url_categories.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/url_filtering.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/users.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/web_dlp.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/workload_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/zpa_gateway.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/README.md +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/__init__.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/app_segments.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/app_segments_inspection.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/app_segments_pra.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/certificates.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/client.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/cloud_connector_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/emergency_access.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/errors.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/idp.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/inspection.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/isolation_profile.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/lss.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/machine_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/policies.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/posture_profiles.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/privileged_remote_access.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/provisioning.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/saml_attributes.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/scim_attributes.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/scim_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/segment_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/server_groups.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/servers.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/service_edges.py +0 -0
- {zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/zscaler/zpa/trusted_networks.py +0 -0
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
from box import Box, BoxList
|
|
19
19
|
from requests import Response
|
|
20
|
-
|
|
20
|
+
import os
|
|
21
21
|
from zscaler.utils import add_id_groups, pick_version_profile, snake_to_camel
|
|
22
22
|
from zscaler.zpa.client import ZPAClient
|
|
23
23
|
|
|
@@ -381,7 +381,7 @@ class AppConnectorControllerAPI:
|
|
|
381
381
|
"""
|
|
382
382
|
return self.rest.delete(f"appConnectorGroup/{group_id}").status_code
|
|
383
383
|
|
|
384
|
-
def get_connector_schedule(self) -> Box:
|
|
384
|
+
def get_connector_schedule(self, customer_id=None) -> Box:
|
|
385
385
|
"""
|
|
386
386
|
Returns the configured App Connector Schedule frequency.
|
|
387
387
|
|
|
@@ -402,7 +402,16 @@ class AppConnectorControllerAPI:
|
|
|
402
402
|
>>> pprint(zpa.connectors.get_connector_schedule)
|
|
403
403
|
"""
|
|
404
404
|
|
|
405
|
-
|
|
405
|
+
# Fetch customer_id from environment if not provided
|
|
406
|
+
if customer_id is None:
|
|
407
|
+
customer_id = os.getenv("ZPA_CUSTOMER_ID")
|
|
408
|
+
|
|
409
|
+
if not customer_id:
|
|
410
|
+
raise ValueError(
|
|
411
|
+
"customer_id is required either as a function argument or as an environment variable ZPA_CUSTOMER_ID"
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
response = self.rest.get("/connectorSchedule")
|
|
406
415
|
if isinstance(response, Response):
|
|
407
416
|
return None
|
|
408
417
|
return response
|
|
@@ -448,14 +457,14 @@ class AppConnectorControllerAPI:
|
|
|
448
457
|
for key, value in kwargs.items():
|
|
449
458
|
payload[snake_to_camel(key)] = value
|
|
450
459
|
|
|
451
|
-
response = self.rest.post("
|
|
460
|
+
response = self.rest.post("connectorSchedule", json=payload)
|
|
452
461
|
if isinstance(response, Response):
|
|
453
462
|
status_code = response.status_code
|
|
454
463
|
if status_code >= 400: # Check if status code indicates an error
|
|
455
464
|
raise Exception(f"API call failed with status {status_code}: {response.json()}")
|
|
456
465
|
return response
|
|
457
466
|
|
|
458
|
-
def
|
|
467
|
+
def update_connector_schedule(self, scheduler_id: str, **kwargs) -> bool:
|
|
459
468
|
"""
|
|
460
469
|
Updates App Connector schedule frequency to delete the inactive connectors based on
|
|
461
470
|
the configured frequency.
|
|
@@ -482,19 +491,22 @@ class AppConnectorControllerAPI:
|
|
|
482
491
|
>>> result = zpa.connectors.update_schedule('10', frequency_interval='10')
|
|
483
492
|
>>> print(result) # True if successful, False otherwise
|
|
484
493
|
"""
|
|
485
|
-
# Get the current schedule
|
|
486
|
-
|
|
494
|
+
# Get the current schedule by customer ID
|
|
495
|
+
customer_id = kwargs.get("customer_id")
|
|
496
|
+
if not customer_id:
|
|
497
|
+
raise ValueError("customer_id must be provided as a keyword argument.")
|
|
498
|
+
|
|
499
|
+
current_schedule = self.get_connector_schedule(customer_id=customer_id)
|
|
500
|
+
|
|
501
|
+
if not current_schedule:
|
|
502
|
+
raise ValueError("No existing schedule found for the provided customer ID.")
|
|
487
503
|
|
|
488
504
|
# Update the schedule with provided arguments
|
|
489
505
|
for key, value in kwargs.items():
|
|
490
|
-
# Check for customer_id and convert it to int if it's a string
|
|
491
|
-
if key == "customer_id":
|
|
492
|
-
value = int(value) if isinstance(value, str) and value.isdigit() else value
|
|
493
|
-
|
|
494
506
|
current_schedule[snake_to_camel(key)] = value
|
|
495
507
|
|
|
496
508
|
# Send the updated schedule to the server
|
|
497
|
-
response = self.rest.put(f"
|
|
509
|
+
response = self.rest.put(f"connectorSchedule/{scheduler_id}", json=current_schedule.to_dict())
|
|
498
510
|
|
|
499
511
|
# Return True if the update was successful (204 No Content), False otherwise
|
|
500
512
|
return response.status_code == 204
|
|
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.3 → zscaler_sdk_python-0.1.4}/zscaler/zia/admin_and_role_management.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/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
|
|
File without changes
|
{zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/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
|
|
File without changes
|
{zscaler_sdk_python-0.1.3 → zscaler_sdk_python-0.1.4}/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
|