Upload files to "/"
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Print monitoring point status for all monitoring points
|
||||||
|
# (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_appliance(organization['id'])
|
||||||
|
if r2.status_code == requests.codes.ok:
|
||||||
|
for appliance in r2.json():
|
||||||
|
print(' MP: {}, {}, {}, ({})'.format(appliance['id'],
|
||||||
|
appliance['resolvedIp'], appliance['name'],
|
||||||
|
appliance['connectionStatus']))
|
||||||
|
# pp_json(appliance)
|
||||||
|
else:
|
||||||
|
print_err(r2)
|
||||||
|
else:
|
||||||
|
print_err(r1)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Print network path info (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_network_path(organization['id'])
|
||||||
|
if r2.status_code == requests.codes.ok:
|
||||||
|
for network_path in r2.json():
|
||||||
|
if network_path['asymmetric']:
|
||||||
|
instrumentation = "Dual-ended, "
|
||||||
|
else:
|
||||||
|
instrumentation = "Single-ended,"
|
||||||
|
print(' Network path ({}) {} name - {}'
|
||||||
|
.format(network_path['id'],
|
||||||
|
instrumentation, network_path['pathName']))
|
||||||
|
# pp_json(network_path)
|
||||||
|
else:
|
||||||
|
print_err(r2)
|
||||||
|
else:
|
||||||
|
print_err(r1)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# Print network 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_network_path_stats_id(organization['id'])
|
||||||
|
if r2.status_code == requests.codes.ok:
|
||||||
|
for network_path_stats in r2.json():
|
||||||
|
print(' Network path ({})'
|
||||||
|
.format(network_path_stats['pathId']))
|
||||||
|
# pp_json(network_path_stats)
|
||||||
|
|
||||||
|
for test in network_path_stats['data']['totalCapacity']:
|
||||||
|
print(' Start time={} Total Capacity value={}'
|
||||||
|
.format(time.ctime(test['start']/1000),
|
||||||
|
test['value']))
|
||||||
|
# pp_json(test)
|
||||||
|
elif r2.status_code == requests.codes.bad_request:
|
||||||
|
print_err_json(r2.json())
|
||||||
|
else:
|
||||||
|
print_err(r2)
|
||||||
|
else:
|
||||||
|
print_err(r1)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# Print network path status (grouped by organization then by group)
|
||||||
|
#
|
||||||
|
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_groups(organization['id'])
|
||||||
|
if r2.status_code == requests.codes.ok:
|
||||||
|
for group in r2.json():
|
||||||
|
print(' Group ({}) name --> {}'.format(group['id'],
|
||||||
|
group['name']))
|
||||||
|
# pp_json(saved_lists)
|
||||||
|
for network_path_id in group['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)
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# Print network path status (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_network_path_status(organization['id'])
|
||||||
|
if r2.status_code == requests.codes.ok:
|
||||||
|
for network_path_status in r2.json():
|
||||||
|
print(' Network path ({}) status --> {}'
|
||||||
|
.format(network_path_status['pathId'],
|
||||||
|
network_path_status['status']))
|
||||||
|
# pp_json(network_path_status)
|
||||||
|
else:
|
||||||
|
print_err(r2)
|
||||||
|
else:
|
||||||
|
print_err(r1)
|
||||||
Reference in New Issue
Block a user