'group': 'avg'
    }
}]
ok, res = sdclient.add_dashboard_panel(dashboard_configuration, PANEL_NAME,
                                       panel_type, metrics)

# Check the result
if ok:
    print('Panel added successfully')
    dashboard_configuration = res['dashboard']
else:
    print(res)
    sys.exit(1)

# Remove the time series panel
ok, res = sdclient.remove_dashboard_panel(dashboard_configuration, PANEL_NAME)

# 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')
Пример #2
0
                                       panel_type,
                                       metrics,
                                       layout=layout)

# Check the result
if ok:
    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 Over Time')

# 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