Access the Reporting Database via API

Contributors netapp-alavoie

Cloud Insights' powerful API allows users to query the Cloud Insights Reporting database directly, without going through the Cognos Reporting environment.

Note This documentation refers to the Cloud Insights Reporting feature, which is available in the Premium Edition.

Odata

The Cloud Insights Reporting API follows the OData v4 (Open Data Protocol) standard for its querying of the Reporting database.
For more information or to learn more, check out this tutorial on OData.

All requests will start with the url https://<Cloud Insights URL>/rest/v1/dwh-management/odata

Generating an APIKey

Read more about Cloud Insights APIs.

To generate an API key, do the following:

  • Log into your Cloud Insights environment and select Admin > API Access.

  • Click “+ API Access Token”.

  • Enter a Name & Description.

  • For type, choose Data Warehouse.

  • Set Permissions as Read/Write.

  • Set a desires Expiration date.

  • Click “Save”, then copy the key and save it somewhere safe. You will not be able to access the full key later.

APIkeys are good for Sync or Async.

Direct query of tables

With the API Key in place, direct queries of the Reporting database are now possible. Long URLs may be simplified to https://…​/odata/ for display purposes rather than the full https://<Cloud Insights URL>/rest/v1/dwh-management/odata/

Try simple queries like

  • https://<Cloud Insights URL>/rest/v1/dwh-management/odata/dwh_custom

  • https://<Cloud Insights URL>/rest/v1/dwh-management/odata/dwh_inventory

  • https://<Cloud Insights URL>/rest/v1/dwh-management/odata/dwh_inventory/storage

  • https://<Cloud Insights URL>/rest/v1/dwh-management/odata/dwh_inventory/disk

  • https://…​/odata/dwh_custom/custom_queries

REST API Examples

The URL for all calls is https://<Cloud Insights URL>/rest/v1/dwh-management/odata.

  • GET /{schema}/** - Retrieves data from the Reporting Database, requires at least Guest role.

Format: https://<Cloud Insights URL>/rest/v1/dwh-management/odata/<schema_name>/<query>

Example:

https://<domain>/rest/v1/dwh-management/odata/dwh_inventory/fabric?$count=true&$orderby=name

Result:

{
   "@odata.context": "$metadata#fabric",
   "@odata.count": 2,
   "value": [
       {
           "id": 851,
           "identifier": "10:00:50:EB:1A:40:3B:44",
           "wwn": "10:00:50:EB:1A:40:3B:44",
           "name": "10:00:50:EB:1A:40:3B:44",
           "vsanEnabled": "0",
           "vsanId": null,
           "zoningEnabled": "0",
           "url": "https://<domain>/web/#/assets/fabrics/941716"
       },
       {
           "id": 852,
           "identifier": "10:00:50:EB:1A:40:44:0C",
           "wwn": "10:00:50:EB:1A:40:44:0C",
           "name": "10:00:50:EB:1A:40:44:0C",
           "vsanEnabled": "0",
           "vsanId": null,
           "zoningEnabled": "0",
           "url": "https://<domain>/web/#/assets/fabrics/941836"
        }
    ]
}

Helpful Hints

Keep the following in mind when working with Reporting API queries.

  • The query payload must be a valid JSON string

  • The query payload must be contained in a single line

  • Double quotes must be escaped, i.e. \"

  • Tabs are supported as \t

  • Avoid comments

  • Lower-case table names are supported

Additionally:

  • 2 Headers are required:

    • Name “X-CloudInsights-ApiKey”

    • Attribute Value “<apikey>”

Your API key will be specific to your Cloud Insights environment.