Upload files to "/"

This commit is contained in:
2025-08-03 21:22:55 +00:00
parent 8ad7216aa2
commit dfe9952b20
5 changed files with 127 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#
# Print network path status (grouped by organization then by saved list)
#
from api_fns import *
r1 = get_org()
if r1.status_code == requests.codes.ok:
for organization in r1.json():
print('Org ({}) name --> {}'.format(organization['id'],
organization['displayName']))
r2 = get_saved_lists(organization['id'])
if r2.status_code == requests.codes.ok:
for saved_lists in r2.json():
print(' List ({}) name --> {}'.format(saved_lists['id'],
saved_lists['listName']))
# pp_json(saved_lists)
for network_path_id in saved_lists['paths']:
r3 = get_network_path_status_id(network_path_id)
if r3.status_code == requests.codes.ok:
print(' Network path ({}) status --> {}'
.format(network_path_id, r3.json()))
else:
print_err(r3)
else:
print_err(r2)
else:
print_err(r1)
+13
View File
@@ -0,0 +1,13 @@
#
# Print organization info
#
from api_fns import *
r = get_org()
if r.status_code == requests.codes.ok:
for organization in r.json():
print('Org ({}) name --> {} -- parent({})'.format(organization['id'],
organization['displayName'], organization['parentId']))
# pp_json(organization)
else:
print_err(r)
+24
View File
@@ -0,0 +1,24 @@
#
# Print web path info (grouped by web app group)
#
from api_fns import *
r1 = get_web_app_group()
if r1.status_code == requests.codes.ok:
for group in r1.json():
print('Web app group ({}) name - {} -- org id ({})'.format(group['id'],
group['name'], group['orgId']))
r2 = get_web_path(group['id'])
if r2.status_code == requests.codes.ok:
for web_path in r2.json():
print(' Web path id ({}) MP ({}), target ({}), workflow ({})'
.format(web_path['id'],
web_path['location']['applianceName'],
web_path['target']['url'],
web_path['userFlow']['name']))
# pp_json(web_path)
else:
print_err(r2)
else:
print_err(r1)
+31
View File
@@ -0,0 +1,31 @@
#
# Print web path stats for all web paths (grouped by web app group)
#
from api_fns import *
r1 = get_web_app_group(None)
if r1.status_code == requests.codes.ok:
for group in r1.json():
print('Web app group ({}) name - {} -- org id ({})'.format(group['id'],
group['name'], group['orgId']))
r2 = get_web_path(group['id'])
if r2.status_code == requests.codes.ok:
for web_path in r2.json():
print(" Web path id ({})".format(web_path['id']))
r3 = get_web_path_stats_id(group['id'], web_path['id'])
if r3.status_code == requests.codes.ok:
for web_path_stats in r3.json()['milestones']:
for test in web_path_stats['networkTiming']:
print(' Start time={} Network Timing value={}'
.format(time.ctime(test['start']/1000),
test['value']))
# pp_json(test)
else:
print_err(r3)
else:
print_err(r2)
else:
print_err(r1)
+30
View File
@@ -0,0 +1,30 @@
#
# Print web path stats for all web paths (grouped by organization)
#
from api_fns import *
r1 = get_org()
if r1.status_code == requests.codes.ok:
for organization in r1.json():
print('Org ({}) name --> {}'.format(organization['id'],
organization['displayName']))
r2 = get_web_path_stats(organization['id'])
if r2.status_code == requests.codes.ok:
for web_path_stats in r2.json():
print(' Web path ({})'.format(web_path_stats['webPathId']))
# pp_json(web_path_stats)
if len(web_path_stats['milestones']) > 0:
for test in web_path_stats['milestones'][0]['networkTiming']:
# pp_json(test)
print(' Start time={} Network Timing value={}'
.format(time.ctime(test['start']/1000),
test['value']))
elif r2.status_code == requests.codes.bad_request:
print_err_json(r2.json())
else:
print_err(r2)
else:
print_err(r1)