Exporting and importing custom chart definitions

If you are using the latest interim fix of MobileFirst, you can import and export custom chart definitions programmatically or manually in the IBM MobileFirst™ Platform Operational Analytics Console.

Before you begin

Ensure that you have at least one custom chart in the IBM MobileFirst Analytics Console.

About this task

In this example, you manually export and import custom chart definitions.

Procedure

  1. In the MobileFirst Analytics Console, click the Custom Charts tab in the Dashboard page.
  2. To export the custom chart definitions, click Export Charts. This action displays a dialog to save a customChartsDefinition.json file.
  3. Choose a location to save the file.
  4. Click the Delete Chart icon next to each custom chart to delete all custom charts.
  5. To import a custom chart definition, click Import Charts. This action displays a dialog to choose a file.
  6. Choose the customChartsDefinition.json file that you previously exported to open.

Results

You exported and imported a custom chart definition manually in the MobileFirst Analytics Console.

What to do next

You can also export and import custom chart definitions programmatically by using your HTTP client of choice (for example, CURL or postman). The GET endpoint for export is http://<hostname>:<port>/analytics-service/data/customCharts/apps/{appId}. The POST endpoint for import is http://<hostname>:<port>/analytics-service/data/customCharts/apps/{appid}/import. For example, if the context root was not changed from the default of analytics-service, the export endpoint is http://myHost.com:9080/analytics-service/data/customCharts/apps/{appid} and the import endpoint is http://myHost.com:9080/analytics-service/data/customCharts/apps/{appid}/import. If the application is protected by basic authorization, all security requirements apply.

Note: If you import a custom chart definition that exists, you end up with duplicate definitions, which also means that the MobileFirst Analytics Console shows duplicate custom charts.