NAM DMI REST examples

The examples here are all HTTPS calls to a NAM Server at sample address and port https://1.2.3.4:5 from a REST client.

All calls are made using an authentication header to access the target device and a Content-Type header set to application/json. To try these examples, you need a REST client and access to a NAM Server.

Parameters are case-sensitive.

getApplications

A call to getApplications requires no parameters.

For example:

https://1.2.3.4:5/rest/dmiquery/getApplications

The example call here returned a list of 6 application IDs, starting with CVENT:

getDataViews

A call to getDataViews requires one parameter, appId, the value of which you can select from the list of application IDs returned by getApplications.

In this example, CVENT is the application passed to the device.

https://1.2.3.4:5/rest/dmiquery/getDataViews?appId=CVENT

The request in this example returned the following list of data views associated with the named application (CVENT) on that device:

The sample output lists 25 data views by data view ID and description, starting with ClientViewDb.

getResolutions

A call to getResolutions requires parameters appId (from getApplications) and viewId (from getDataViews).

In this example, CVENT is the application and CvNetworkBaseline is the data view:

https://1.2.3.4:5/rest/dmiquery/getResolutions?appId=CVENT&viewId=CvNetworkBaseline

The call in this example returned the following list of possible resolutions for the named application and data view.

Resolution IDs are identical to those used for definitions in dmi_dataview-*.properties files. Possible resolutions include:

  • r - one period
  • 1 - one hour
  • 6 - six hours
  • d - one day
  • w - one week
  • m - one month

getDimensions

A call to getDimensions requires parameters appId (from getApplications) and viewId (from getDataViews) and resolution (from getResolutions).

In this example, CVENT is the application and CvNetworkBaseline is the data view and r is the resolution:

https://1.2.3.4:5/rest/dmiquery/getDimensions?appId=CVENT&viewId=CvNetworkBaseline&resolution=r

The call in this example returned the following list of 10 dimensions, starting with begT:

getMetrics

A call to getMetrics requires parameters appId (from getApplications) and viewId (from getDataViews) and resolution (from getResolutions).

In this example, CVENT is the application and CvNetworkBaseline is the data view and r is the resolution:

https://1.2.3.4:5/rest/dmiquery/getMetrics?appId=CVENT&viewId=CvNetworkBaseline&resolution=r

The call in this example returned the following nested array describing the metrics for the named application, data view, and resolution:

getDMIData, getDMIData2, getDMIData3

For other REST methods, you can use GET because all necessary parameters can be contained in the URL. To call getDMIData, getDMIData2, or getDMIData3, however, you need to use a POST request. This enables you to pass more parameters and parameter values than you can pass through a GET call in the URL.

Note

Use getDMIData3 when writing a new application. The earlier methods (getDMIData and getDMIData2) continue to be offered for the sake of backwards compatibility with existing client applications.

Differences between getDMIData, getDMIData2, and getDMIData3

  • The difference between getDMIData and getDMIData2 is that getDMIData2 returns an object that contains GUI labels and units of measure for returned data.
  • The difference between getDMIData2 and getDMIData3 is that getDMIData3 returns an object that contains IDs of the column renderers.

Also, there is a new format available for the response to the getDMIData3 method. To receive the data in the new format, you need to set the Accept parameter in the REST request to application/dmi. In RESTClient, you would go to Headers > Custom Header and set Name to Accept and Value to application/dmi.

The response is formatted similarly to the DMI text export. Differences include:

  • It returns all columns, not only visible ones
  • It returns only application and data view IDs, not the human-readable names
  • No information about histograms is included

getDMIData example

In this example, note that there are no parameters set in the URL:

https://1.2.3.4:5/rest/dmiquery/getDMIData

The details are passed in the body.

In this example, the call returned the following.

getDMIData2 example

You could send the same body to the same machine but with method getDMIData2:

https://1.2.3.4:5/rest/dmiquery/getDMIData2

In this example, it returned the following output (again trimmed for brevity).

Note that the result of getDMIData2 extends that of getDMIData by adding:

 "columnUnit": [ "", "" ],
"columnHeaderName": [ "Application", "Transaction" ],

getDMIData3 example

Yet another call to the same machine using the same body but with method getDMIData3.

https://1.2.3.4:5/rest/dmiquery/getDMIData3

This returns the following (again trimmed for brevity).

Note that the result of getDMIData2 extends that of getDMIData by adding:

 "columnRendererIds": [ "STRING", "STRING" ],