-
Notifications
You must be signed in to change notification settings - Fork 15
/
testvmc.py
executable file
·24 lines (22 loc) · 1.04 KB
/
testvmc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from vmc import VMCSDDC
import json, sys
refresh_token = ''
oauth_id = ''
oauth_secret = ''
org_id = ''
sddc_id = ''
vmcsddc = VMCSDDC(org_id,sddc_id,refresh_token=refresh_token)
#vmcsddc = VMCSDDC(org_id,sddc_id, oauth_id=oauth_id, oauth_secret=oauth_secret)
vmcsddc.debug_mode = True
success = vmcsddc.load_interface_counters()
if success:
for x in vmcsddc.edge_interface_stats:
print (f'Interface: {x}, timestamp={vmcsddc.edge_interface_stats[x].last_update_timestamp} ')
print(f'\trx_total_bytes={vmcsddc.edge_interface_stats[x].rx_total_bytes}')
print(f'\trx_total_packets={vmcsddc.edge_interface_stats[x].rx_total_packets}')
print(f'\trx_dropped_packets={vmcsddc.edge_interface_stats[x].rx_dropped_packets}')
print(f'\ttx_total_bytes={vmcsddc.edge_interface_stats[x].tx_total_bytes}')
print(f'\ttx_total_packets={vmcsddc.edge_interface_stats[x].tx_total_packets}')
print(f'\ttx_dropped_packets={vmcsddc.edge_interface_stats[x].tx_dropped_packets}')
else:
print("Could not load counters.")