Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Dashboard Examples

Tom Valine edited this page Oct 14, 2016 · 14 revisions

Examples & Screencasts


Argus SDK

This simple example illustrates how to create a dashboard. While in this example, the markup is provided as a constant, users will likely will generate content using an HTML document framework of their choice.

int maxConnections = 10;
try (
    ArgusService service = ArgusService.getInstance(
      "https://argus.mycompany.com/argusws",
      maxConnections)
) {
    String content = 
            "<ag-dashboard>\n"
            + "  <ag-chart name='testChart'>\n"
            + "    <ag-option name='yAxis.min' value='0'></ag-option>\n"
            + "    <ag-metric name='testMetric'>\n"
            + "      -1d:TestScope:TestMetric:TestNamespace{TestTag=TagValue}:min\n"
            + "    </ag-metric>\n"
            + "  </ag-chart>\n"
            + "</ag-dashboard>";
    service.getAuthService().login("aUsername", "aPassword");
    Dashboard dashboard = new Dashboard();
    dashboard.setName("TestDashboard");
    dashboard.setDescription("A test dashboard.");
    dashboard.setShared(true);
    dashboard.setContent(content);
    dashboard = service.getDashboardService().createDashboard(dashboard);
    service.getAuthService().logout();
}
Clone this wiki locally