diff --git a/app-network-path-status-saved-list.py b/app-network-path-status-saved-list.py new file mode 100644 index 0000000..94156a9 --- /dev/null +++ b/app-network-path-status-saved-list.py @@ -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) diff --git a/app-organizations.py b/app-organizations.py new file mode 100644 index 0000000..bc33c44 --- /dev/null +++ b/app-organizations.py @@ -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) diff --git a/app-web-path-info.py b/app-web-path-info.py new file mode 100644 index 0000000..26087b7 --- /dev/null +++ b/app-web-path-info.py @@ -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) diff --git a/app-web-path-stats-group.py b/app-web-path-stats-group.py new file mode 100644 index 0000000..9e1b493 --- /dev/null +++ b/app-web-path-stats-group.py @@ -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) diff --git a/app-web-path-stats.py b/app-web-path-stats.py new file mode 100644 index 0000000..dfbb395 --- /dev/null +++ b/app-web-path-stats.py @@ -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)