ProjectApi: Add method to set the default dashboard

Change-Id: I8e4b36b456b3c34b8fcd4347d1fe546095c875c2
This commit is contained in:
David Pursehouse
2017-10-01 15:20:03 +01:00
parent eb09dcec56
commit 41d2a5adcf
3 changed files with 30 additions and 0 deletions

View File

@@ -485,6 +485,15 @@ public class ProjectApiImpl implements ProjectApi {
return dashboard(DEFAULT_DASHBOARD_NAME);
}
@Override
public void defaultDashboard(String name) throws RestApiException {
try {
dashboardApi.create(checkExists(), name).setDefault();
} catch (Exception e) {
throw asRestApiException("Cannot set default dashboard", e);
}
}
@Override
public ListDashboardsRequest dashboards() throws RestApiException {
return new ListDashboardsRequest() {