You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while using zia.locations.update_location update sub-location options get an error:
zia.locations.update_location(location_id='70579512',surrogate_ip='True',idle_time_in_minutes='480',surrogate_ip_enforced_for_known_browsers='True',surrogate_refresh_time_in_minutes='480')
while using zia.locations.update_location update main-location options works fine:
zia.locations.update_location('33743832',surrogate_ip='True',idle_time_in_minutes='480',surrogate_ip_enforced_for_known_browsers='True',surrogate_refresh_time_in_minutes='480')
Okay I found your problem, pretty annoying one to be honest. I had to update a sublocation in the ZIA web UI and then compare their data structure to the one pyZscaler is creating. I tried every missing field one by one until i found it:
You will get the 500 error unless you specify: display_time_unit=<unit>
while using zia.locations.update_location update sub-location options get an error:
zia.locations.update_location(location_id='70579512',surrogate_ip='True',idle_time_in_minutes='480',surrogate_ip_enforced_for_known_browsers='True',surrogate_refresh_time_in_minutes='480')
restfly.errors.ServerError: [500: PUT] https://zsapi.zscaler.net/api/v1/locations/70579512 body=b'{"code":"UNEXPECTED_ERROR","message":"An unexpected error has occurred, please contact Zscaler's support"}'
while using zia.locations.update_location update main-location options works fine:
zia.locations.update_location('33743832',surrogate_ip='True',idle_time_in_minutes='480',surrogate_ip_enforced_for_known_browsers='True',surrogate_refresh_time_in_minutes='480')
Locations:
Main:
{'id': 33743832, 'name': 'AIA_Roaming_Users', 'non_editable': False, 'parent_id': 0, 'up_bandwidth': 1024000, 'dn_bandwidth': 1024000, 'override_up_bandwidth': 0, 'override_dn_bandwidth': 0, 'shared_up_bandwidth': 1024000, 'shared_down_bandwidth': 1024000, 'unused_up_bandwidth': 0, 'unused_dn_bandwidth': 0, 'country': 'NONE', 'language': 'NONE', 'tz': 'GMT', 'geo_override': False, 'latitude': 0.0, 'longitude': 0.0, 'ports': [10938], 'auth_required': True, 'ssl_scan_enabled': True, 'zapp_ssl_scan_enabled': True, 'xff_forward_enabled': True, 'other_sub_location': False, 'ec_location': False, 'surrogate_ip': True, 'idle_time_in_minutes': 60, 'display_time_unit': 'HOUR', 'surrogate_ip_enforced_for_known_browsers': True, 'surrogate_refresh_time_in_minutes': 60, 'surrogate_refresh_time_unit': 'HOUR', 'kerberos_auth': False, 'digest_auth_enabled': False, 'ofw_enabled': True, 'ips_control': True, 'aup_enabled': False, 'caution_enabled': False, 'aup_block_internet_until_accepted': False, 'aup_force_ssl_inspection': False, 'iot_discovery_enabled': False, 'aup_timeout_in_days': 0, 'child_count': 2, 'match_in_child': False, 'static_location_groups': [{'id': 43845168, 'name': 'Locations_SSL_CltCon_Enforce'}, {'id': 43845169, 'name': 'Locations_SSL'}], 'dynamiclocation_groups': [{'id': 43779439, 'name': 'Corporate User Traffic Group'}], 'exclude_from_dynamic_groups': False, 'exclude_from_manual_groups': False, 'profile': 'CORPORATE'}
Sub belongs to main:
{'id': 70579512, 'name': 'PPC0005506', 'non_editable': False, 'parent_id': 33743832, 'up_bandwidth': 0, 'dn_bandwidth': 0, 'country': 'CHINA', 'language': 'NONE', 'tz': 'GMT', 'geo_override': False, 'latitude': 0.0, 'longitude': 0.0, 'ip_addresses': ['61.152.197.26'], 'auth_required': True, 'ssl_scan_enabled': False, 'zapp_ssl_scan_enabled': False, 'xff_forward_enabled': True, 'other_sub_location': False, 'ec_location': False, 'surrogate_ip': False, 'idle_time_in_minutes': 0, 'surrogate_ip_enforced_for_known_browsers': False, 'surrogate_refresh_time_in_minutes': 0, 'kerberos_auth': False, 'digest_auth_enabled': False, 'ofw_enabled': True, 'ips_control': False, 'aup_enabled': False, 'caution_enabled': False, 'aup_block_internet_until_accepted': False, 'aup_force_ssl_inspection': False, 'iot_discovery_enabled': False, 'aup_timeout_in_days': 0, 'child_count': 0, 'match_in_child': False, 'static_location_groups': [{'id': 43845169, 'name': 'Locations_SSL'}
...
The text was updated successfully, but these errors were encountered: