zscaler-sdk-python 0.10.1__tar.gz → 0.10.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.
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/PKG-INFO +1 -1
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/pyproject.toml +1 -1
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/__init__.py +1 -1
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/__init__.py +163 -21
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/LICENSE.md +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/README.md +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/cache/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/cache/cache.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/cache/no_op_cache.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/cache/zscaler_cache.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/constants.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/errors/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/errors/error.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/errors/http_error.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/errors/zscaler_api_error.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/exceptions/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/exceptions/exceptions.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/logger.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/ratelimiter/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/ratelimiter/ratelimiter.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/user_agent.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/utils.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcc/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcc/client.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcc/devices.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcc/secrets.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/activation.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/admin_and_role_management.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/client.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/ecgroups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/locations.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/provisioning.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/admin.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/alerts.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/apps.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/devices.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/filters.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/inventory.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/troubleshooting.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/users.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zdx/zdx_client.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/activate.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/admin_and_role_management.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/apptotal.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/audit_logs.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/authentication_settings.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/client.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/cloud_apps.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/cloudappcontrol.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/device_management.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/dlp.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/errors.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/firewall.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/forwarding_control.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/isolation_profile.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/labels.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/locations.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/pac_files.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/sandbox.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/security.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/ssl_inspection.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/traffic.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/url_categories.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/url_filtering.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/users.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/web_dlp.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/workload_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/zpa_gateway.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/README.md +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/__init__.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments_inspection.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments_pra.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/authdomains.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/certificates.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/client.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/cloud_connector_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/connectors.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/emergency_access.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/errors.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/idp.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/inspection.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/isolation.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/lss.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/machine_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/microtenants.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/policies.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/posture_profiles.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/privileged_remote_access.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/provisioning.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/saml_attributes.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/scim_attributes.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/scim_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/segment_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/server_groups.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/servers.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/service_edges.py +0 -0
- {zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/trusted_networks.py +0 -0
|
@@ -422,7 +422,7 @@ class ZIAClientHelper(ZIAClient):
|
|
|
422
422
|
path (str): The API endpoint path to send requests to.
|
|
423
423
|
expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
|
|
424
424
|
page (int): Specific page number to fetch. Defaults to 1 if not provided.
|
|
425
|
-
pagesize (int): Number of items per page, default is 100, with a maximum of
|
|
425
|
+
pagesize (int): Number of items per page, default is 100, with a maximum of 10000.
|
|
426
426
|
search (str): Search query to filter the results.
|
|
427
427
|
max_items (int): Maximum number of items to retrieve.
|
|
428
428
|
max_pages (int): Maximum number of pages to fetch.
|
|
@@ -430,7 +430,7 @@ class ZIAClientHelper(ZIAClient):
|
|
|
430
430
|
include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
|
|
431
431
|
location_id (int, optional): Retrieve VPN credentials for the specified location ID.
|
|
432
432
|
managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
|
|
433
|
-
prefix (int, optional): Retrieve VPN credentials managed by
|
|
433
|
+
prefix (int, optional): Retrieve VPN credentials managed by a given partner.
|
|
434
434
|
|
|
435
435
|
Returns:
|
|
436
436
|
tuple: A tuple containing:
|
|
@@ -444,17 +444,12 @@ class ZIAClientHelper(ZIAClient):
|
|
|
444
444
|
"EMPTY_RESULTS": "No results found for page {page}.",
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
# Initialize
|
|
448
|
-
# params = {
|
|
449
|
-
# "page": page if page is not None else 1, # Start at page 1 if not specified
|
|
450
|
-
# "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
|
|
451
|
-
# }
|
|
452
|
-
|
|
447
|
+
# Initialize parameters
|
|
453
448
|
params = {
|
|
454
449
|
"page": page if page is not None else 1, # Start at page 1 if not specified
|
|
455
|
-
"
|
|
450
|
+
"pageSize": pagesize if pagesize is not None else 100, # Allow any user-defined pagesize
|
|
456
451
|
}
|
|
457
|
-
|
|
452
|
+
|
|
458
453
|
# Add optional filters to the params if provided
|
|
459
454
|
if search:
|
|
460
455
|
params["search"] = search
|
|
@@ -469,12 +464,30 @@ class ZIAClientHelper(ZIAClient):
|
|
|
469
464
|
if prefix:
|
|
470
465
|
params["prefix"] = prefix
|
|
471
466
|
|
|
467
|
+
# If the user specifies a page, fetch only that page
|
|
468
|
+
if page is not None:
|
|
469
|
+
response = self.send("GET", path=path, params=params)
|
|
470
|
+
if response.status_code != expected_status_code:
|
|
471
|
+
error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
|
|
472
|
+
status_code=response.status_code, page=params["page"]
|
|
473
|
+
)
|
|
474
|
+
logger.error(error_msg)
|
|
475
|
+
return BoxList([]), error_msg
|
|
476
|
+
|
|
477
|
+
response_data = response.json()
|
|
478
|
+
if not isinstance(response_data, list):
|
|
479
|
+
error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
|
|
480
|
+
logger.warn(error_msg)
|
|
481
|
+
return BoxList([]), error_msg
|
|
482
|
+
|
|
483
|
+
data = convert_keys_to_snake(response_data)
|
|
484
|
+
return BoxList(data), None
|
|
485
|
+
|
|
486
|
+
# If no page is specified, iterate through pages to fetch all items
|
|
472
487
|
ret_data = []
|
|
473
488
|
total_collected = 0
|
|
474
|
-
|
|
475
489
|
try:
|
|
476
490
|
while True:
|
|
477
|
-
# Apply rate-limiting if necessary
|
|
478
491
|
should_wait, delay = self.rate_limiter.wait("GET")
|
|
479
492
|
if should_wait:
|
|
480
493
|
time.sleep(delay)
|
|
@@ -499,13 +512,6 @@ class ZIAClientHelper(ZIAClient):
|
|
|
499
512
|
|
|
500
513
|
data = convert_keys_to_snake(response_data)
|
|
501
514
|
|
|
502
|
-
# If searching for a specific item, stop if we find a match
|
|
503
|
-
if search:
|
|
504
|
-
for item in data:
|
|
505
|
-
if item.get("name") == search:
|
|
506
|
-
ret_data.append(item)
|
|
507
|
-
return BoxList(ret_data), None
|
|
508
|
-
|
|
509
515
|
# Limit data collection based on max_items
|
|
510
516
|
if max_items is not None:
|
|
511
517
|
data = data[: max_items - total_collected] # Limit items on the current page
|
|
@@ -518,8 +524,8 @@ class ZIAClientHelper(ZIAClient):
|
|
|
518
524
|
):
|
|
519
525
|
break
|
|
520
526
|
|
|
521
|
-
# Stop if
|
|
522
|
-
if len(data) < params["
|
|
527
|
+
# Stop if fewer items than pageSize are returned
|
|
528
|
+
if len(data) < params["pageSize"]:
|
|
523
529
|
break
|
|
524
530
|
|
|
525
531
|
# Move to the next page
|
|
@@ -535,6 +541,142 @@ class ZIAClientHelper(ZIAClient):
|
|
|
535
541
|
|
|
536
542
|
return BoxList(ret_data), None
|
|
537
543
|
|
|
544
|
+
|
|
545
|
+
# def get_paginated_data(
|
|
546
|
+
# self,
|
|
547
|
+
# path=None,
|
|
548
|
+
# expected_status_code=200,
|
|
549
|
+
# page=None,
|
|
550
|
+
# pagesize=None,
|
|
551
|
+
# search=None,
|
|
552
|
+
# max_items=None, # Maximum number of items to retrieve across pages
|
|
553
|
+
# max_pages=None, # Maximum number of pages to retrieve
|
|
554
|
+
# type=None, # Specify type of VPN credentials (CN, IP, UFQDN, XAUTH)
|
|
555
|
+
# include_only_without_location=None, # Include only VPN credentials not associated with any location
|
|
556
|
+
# location_id=None, # VPN credentials for a specific location ID
|
|
557
|
+
# managed_by=None, # VPN credentials managed by a given partner
|
|
558
|
+
# prefix=None, # VPN credentials managed by a given partner
|
|
559
|
+
# ):
|
|
560
|
+
# """
|
|
561
|
+
# Fetches paginated data from the API based on specified parameters and handles pagination.
|
|
562
|
+
|
|
563
|
+
# Args:
|
|
564
|
+
# path (str): The API endpoint path to send requests to.
|
|
565
|
+
# expected_status_code (int): The expected HTTP status code for a successful request. Defaults to 200.
|
|
566
|
+
# page (int): Specific page number to fetch. Defaults to 1 if not provided.
|
|
567
|
+
# pagesize (int): Number of items per page, default is 100, with a maximum of 1000.
|
|
568
|
+
# search (str): Search query to filter the results.
|
|
569
|
+
# max_items (int): Maximum number of items to retrieve.
|
|
570
|
+
# max_pages (int): Maximum number of pages to fetch.
|
|
571
|
+
# type (str, optional): Type of VPN credentials (e.g., CN, IP, UFQDN, XAUTH).
|
|
572
|
+
# include_only_without_location (bool, optional): Filter to include only VPN credentials not associated with a location.
|
|
573
|
+
# location_id (int, optional): Retrieve VPN credentials for the specified location ID.
|
|
574
|
+
# managed_by (int, optional): Retrieve VPN credentials managed by the specified partner.
|
|
575
|
+
# prefix (int, optional): Retrieve VPN credentials managed by the specified partner.
|
|
576
|
+
|
|
577
|
+
# Returns:
|
|
578
|
+
# tuple: A tuple containing:
|
|
579
|
+
# - BoxList: A list of fetched items wrapped in a BoxList for easy access.
|
|
580
|
+
# - str: An error message if any occurred during the data fetching process.
|
|
581
|
+
# """
|
|
582
|
+
# logger = logging.getLogger(__name__)
|
|
583
|
+
|
|
584
|
+
# ERROR_MESSAGES = {
|
|
585
|
+
# "UNEXPECTED_STATUS": "Unexpected status code {status_code} received for page {page}.",
|
|
586
|
+
# "EMPTY_RESULTS": "No results found for page {page}.",
|
|
587
|
+
# }
|
|
588
|
+
|
|
589
|
+
# # Initialize pagination parameters
|
|
590
|
+
# # params = {
|
|
591
|
+
# # "page": page if page is not None else 1, # Start at page 1 if not specified
|
|
592
|
+
# # "pagesize": min(pagesize if pagesize is not None else 100, max_page_size), # Apply max_page_size limit
|
|
593
|
+
# # }
|
|
594
|
+
|
|
595
|
+
# params = {
|
|
596
|
+
# "page": page if page is not None else 1, # Start at page 1 if not specified
|
|
597
|
+
# "pagesize": max(100, min(pagesize or 100, 10000)), # Ensure pagesize is within API limits
|
|
598
|
+
# }
|
|
599
|
+
|
|
600
|
+
# # Add optional filters to the params if provided
|
|
601
|
+
# if search:
|
|
602
|
+
# params["search"] = search
|
|
603
|
+
# if type:
|
|
604
|
+
# params["type"] = type
|
|
605
|
+
# if include_only_without_location is not None:
|
|
606
|
+
# params["includeOnlyWithoutLocation"] = include_only_without_location
|
|
607
|
+
# if location_id:
|
|
608
|
+
# params["locationId"] = location_id
|
|
609
|
+
# if managed_by:
|
|
610
|
+
# params["managedBy"] = managed_by
|
|
611
|
+
# if prefix:
|
|
612
|
+
# params["prefix"] = prefix
|
|
613
|
+
|
|
614
|
+
# ret_data = []
|
|
615
|
+
# total_collected = 0
|
|
616
|
+
|
|
617
|
+
# try:
|
|
618
|
+
# while True:
|
|
619
|
+
# # Apply rate-limiting if necessary
|
|
620
|
+
# should_wait, delay = self.rate_limiter.wait("GET")
|
|
621
|
+
# if should_wait:
|
|
622
|
+
# time.sleep(delay)
|
|
623
|
+
|
|
624
|
+
# # Send the request to the API
|
|
625
|
+
# response = self.send("GET", path=path, params=params)
|
|
626
|
+
|
|
627
|
+
# # Check for unexpected status code
|
|
628
|
+
# if response.status_code != expected_status_code:
|
|
629
|
+
# error_msg = ERROR_MESSAGES["UNEXPECTED_STATUS"].format(
|
|
630
|
+
# status_code=response.status_code, page=params["page"]
|
|
631
|
+
# )
|
|
632
|
+
# logger.error(error_msg)
|
|
633
|
+
# return BoxList([]), error_msg
|
|
634
|
+
|
|
635
|
+
# # Parse the response as a flat list of items
|
|
636
|
+
# response_data = response.json()
|
|
637
|
+
# if not isinstance(response_data, list):
|
|
638
|
+
# error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
|
|
639
|
+
# logger.warn(error_msg)
|
|
640
|
+
# return BoxList([]), error_msg
|
|
641
|
+
|
|
642
|
+
# data = convert_keys_to_snake(response_data)
|
|
643
|
+
|
|
644
|
+
# # If searching for a specific item, stop if we find a match
|
|
645
|
+
# if search:
|
|
646
|
+
# for item in data:
|
|
647
|
+
# if item.get("name") == search:
|
|
648
|
+
# ret_data.append(item)
|
|
649
|
+
# return BoxList(ret_data), None
|
|
650
|
+
|
|
651
|
+
# # Limit data collection based on max_items
|
|
652
|
+
# if max_items is not None:
|
|
653
|
+
# data = data[: max_items - total_collected] # Limit items on the current page
|
|
654
|
+
# ret_data.extend(data)
|
|
655
|
+
# total_collected += len(data)
|
|
656
|
+
|
|
657
|
+
# # Check if we've reached max_items or max_pages limits
|
|
658
|
+
# if (max_items is not None and total_collected >= max_items) or (
|
|
659
|
+
# max_pages is not None and params["page"] >= max_pages
|
|
660
|
+
# ):
|
|
661
|
+
# break
|
|
662
|
+
|
|
663
|
+
# # Stop if we've processed all available pages (i.e., less than requested page size)
|
|
664
|
+
# if len(data) < params["pagesize"]:
|
|
665
|
+
# break
|
|
666
|
+
|
|
667
|
+
# # Move to the next page
|
|
668
|
+
# params["page"] += 1
|
|
669
|
+
|
|
670
|
+
# finally:
|
|
671
|
+
# time.sleep(2) # Ensure a delay between requests regardless of outcome
|
|
672
|
+
|
|
673
|
+
# if not ret_data:
|
|
674
|
+
# error_msg = ERROR_MESSAGES["EMPTY_RESULTS"].format(page=params["page"])
|
|
675
|
+
# logger.warn(error_msg)
|
|
676
|
+
# return BoxList([]), error_msg
|
|
677
|
+
|
|
678
|
+
# return BoxList(ret_data), None
|
|
679
|
+
|
|
538
680
|
@property
|
|
539
681
|
def admin_and_role_management(self):
|
|
540
682
|
"""
|
|
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.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zcon/admin_and_role_management.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
|
{zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zia/admin_and_role_management.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/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
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/app_segments_inspection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/zscaler/zpa/cloud_connector_groups.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
|
{zscaler_sdk_python-0.10.1 → zscaler_sdk_python-0.10.2}/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
|