Get KPI data

get

/rest/{version}/statistics/kpis

This API retrieves KPI data. Using the hypermedia links returned in the discovery API (endpoint /statistics/kpiTypes), clients can retrieve the KPI data for a particular KPI "type". This will return all the KPI data values of the specified KPI type.

Request

Path Parameters
  • REST API version string.
    Available values: v1.2
Query Parameters
  • This parameter specifies the KPI "type" to be retrieved. The KPI "type" is a set of related KPIs. Specifying this parameter will return all of the KPI data values of that particular "type". Use the parameter with a valid KPI type string.
    Note - The valid KPI types can be discovered using the KPI discovery API (/statistics/kpiTypes).
Header Parameters
  • The value in the Authorization header must be the string "Bearer {access token}", where {access token} is a valid, unexpired token received in response to a prior /rest/{version}/auth/token request.
Back to Top

Response

200 Response

KPI Data response - This is the response model when retrieving KPI data.

400 Response

The request is malformed in some way or is missing required information and therefore cannot be processed.

401 Response

Unauthorized - Request lacks valid authentication credentials.

404 Response

Resource not found
Back to Top

Examples

Example of Accessing the API with cURL

The following example shows how to get KPI data by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X GET \
    --header "Accept: application/xml" \
    --header "Authorization: Bearer $TOKEN" \
    "https://${SBCIP}/rest/v1.1/statistics/kpis?type=sysMemoryUtil"

Example of Accessing the API with Python

The following example shows how to get KPI data by submitting a GET request on the REST resource using Python. This example assumes you have a valid token stored in the token variable. For an example of authenticating with Python, see Authenticate.

import requests
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
url  = "https://" + sbcip + "/rest/v1.1/statistics/kpis?type=sysMemoryUtil"
resp = requests.get(url, headers=headers)

Example of the Response Headers

The following shows an example of the response headers.

HTTP/1.1 200
Server: nginx/1.14.1
Date: Thu, 02 Apr 2020 15:23:18 GMT
Content-Type: application/xml
Transfer-Encoding: chunked
Connection: keep-alive

Example of the Response Body

The following example shows the contents of the response body in XML format.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <data>
    <sysMemoryUtil>
      <percentUsed>17</percentUsed>
    </sysMemoryUtil>
  </data>
  <messages/>
  <links>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=sysMemoryUtil</link>
  </links>
</response>
Back to Top