Dashboards Web Service

As an administrator, you can use the npc API web services to perform dashboard management tasks.
capm250
As an administrator, you can use the
Performance Center
API web services to perform dashboard management tasks.
Use the dashboards RESTful web service to create and manage dashboard pages to display data views:
  • Create new dashboards
  • Import and export dashboards
  • Build the dashboards once and deploy them in an additional tenant. The import feature lets you deploy extra dashboards without manually recreating them.
To import a dashboard for a specific tenant, log in as the administrator for that tenant.
Exporting a dashboard in XML format via the RESTful web service can result in a broken dashboard after you post the XML. To avoid this issue, create a dashboard by copying an existing one using the UI. For more information, see Manage Dashboards.
Issue the following call to see the parameters for the dashboards web service:
http://
PC_host
:8181/pc/center/rest/dashboards/documentation
Export a Dashboard
Perform a GET operation to export a dashboard to an XML file that is suitable for importing into another instance of CAPC.
To export a dashboard, the internally assigned page ID is required. Use the product user interface to find the ID:
  1. Navigate to the dashboard to export.
  2. In the browser window, find the page ID in the URL.
    Example:
    http://
    PC_host
    :8181/pc/desktop/page?pg=2000040
    The page ID is 2000040.
  3. In a REST client, set the URL to the following:
    http://
    PC_host
    :8181/pc/center/webservice/dashboards/pageId
  4. Perform a GET operation.
    An error or success message appears in the response.
Import a Dashboard
You can import a dashboard from an XML file.
  1. Browse to select the XML file that represents a dashboard that you have exported, or paste the exported text of the XML file into the Body field.
  2. Update the dashboardMenu, menuItem, and dashboardTitle attributes in the XML body for the dashboard that you import:
    <dashboardMenu>MyCustomDashboard_DashboardMenuName</dashboardMenu> <menuItem>MyCustomDashboard_MenuItemName</menuItem> <dashboardTitle>MyCustomDashboard_DashboardTitleName</dashboardTitle>
    • <dashboardMenu>
      The title that appears at the top of the dashboard menu. Specify an existing top-level dashboard menu title for this attribute.
      Examples:
      Infrastructure Health, Capacity Planning
    • <menuItem>
      The title of the dashboard that appears in the dashboards menu. This property is unique to each tenant.
    • <dashboardTitle>
      The title of the dashboard that appears at the top of the dashboard page. This property is unique to each tenant.
  3. (Optional) Test the import of a dashboard before you import it.
    Perform the following POST operation:
    http://
    PC_host
    :8181/pc/center/webservice/dashboards/test/
    The following message appears to indicate that the test was successful:
    <?xml version="1.0" encoding="UTF-8"?>
    <msg>Validation successful.</msg>
    Checking is performed for the unique menuItem and dashboardTitle attrributes.
  4. Set the URL to the following:
    http://
    PC_host
    :8181/pc/center/webservice/dashboards/import
  5. Perform a POST operation.
  6. An error or success message appears in the response.
    The web service assigns a page ID to the imported dashboard.
Update a Dashboard
You can update a dashboard based on a page ID. Edit the XML to modify the dashboard:
  1. Set the URL to the following:
    http://
    PC_host
    :8181/pc/center/webservice/dashboards/pageId
  2. Paste the XML file that represents the dashboard into the Body field, and edit the XML as needed. 
  3. Perform a PUT operation.
    An error or success message appears in the response.