if len(sys.argv) != 2: print 'usage: %s <sysdig-token>' % sys.argv[0] print 'You can find your token at https://app.sysdigcloud.com/#/settings/user' sys.exit(1) sdc_token = sys.argv[1] # # Instantiate the SDC client # sdclient = SdcClient(sdc_token) # # List the dashboards # res = sdclient.get_dashboards() if not res[0]: print res[1] sys.exit(1) # # Delete all the dashboards containing "API test" # for dashboard in res[1]['dashboards']: if 'API test' in dashboard['name']: print "Deleting " + dashboard['name'] res = sdclient.delete_dashboard(dashboard) if not res[0]: print res[1] sys.exit(1)
dashboard_configuration = res[1]['dashboard'] else: print res[1] sys.exit(1) # # Remove a panel # res = sdclient.remove_dashboard_panel(dashboard_configuration, 'CPU') # Check the result if res[0]: print 'Panel removed successfully' dashboard_configuration = res[1]['dashboard'] else: print res[1] sys.exit(1) # # Delete the dashboard # res = sdclient.delete_dashboard(dashboard_configuration) # Check the result if res[0]: print 'Dashboard deleted successfully' else: print res[1] sys.exit(1)
print('Panel added successfully') dashboard_configuration = res['dashboard'] else: print(res) sys.exit(1) # # Remove a panel # ok, res = sdclient.remove_dashboard_panel(dashboard_configuration, 'CPU') # Check the result if ok: print('Panel removed successfully') dashboard_configuration = res['dashboard'] else: print(res) sys.exit(1) # # Delete the dashboard # ok, res = sdclient.delete_dashboard(dashboard_configuration) # Check the result if ok: print('Dashboard deleted successfully') else: print(res) sys.exit(1)
if len(sys.argv) != 2: print 'usage: %s <sysdig-token>' % sys.argv[0] print 'You can find your token at https://app.sysdigcloud.com/#/settings/user' sys.exit(1) sdc_token = sys.argv[1] # # Instantiate the SDC client # sdclient = SdcClient(sdc_token) # # List the dashboards # res = sdclient.get_dashboards() if not res[0]: print res[1] sys.exit(1) # # Delete all the dashboards containing "API test" # for dashboard in res[1]['dashboards']: if 'API test' in dashboard['name']: print "Deleting " + dashboard['name'] res = sdclient.delete_dashboard(dashboard) if not res[0]: print res[1] sys.exit(1)