Discover available KPI types or get the KPI schema for a type.

get

/rest/{version}/statistics/kpiTypes

This API provides multiple purposes.

  1. KPI discovery -- This API can discover the list of available KPI "types" on the system and the names of the KPIs associated with that type. This discovery API uses the REST HATEOAS technique to return a list of hypermedia (hyperlinks and data) of available KPI types which can be invoked in subsequent REST requests. Through discovery, clients can learn the URL and method of the available resource endpoints that can be invoked. These are returned in the <links> section of the response, as <link> elements. Only KPIs supported via REST can be discovered with this API.

    Therefore, to retrieve the KPI discovery response, use the API without the "type" parameter.

  2. KPI metadata -- This API can retrieve the KPI metadata (schema). Using the hypermedia links returned in the discovery API (described above), clients can invoke the specific endpoint to retrieve the KPI metadata for a particular KPI "type". This will return the schema for each of the KPI data values associated with that KPI type.

    Therefore, to retrieve the KPI metadata (schema) response, use the API with the "type" parameter.

Request

Path Parameters
  • REST API version string.
    Available values: v1.2
Query Parameters
  • This parameter specifies the KPI metadata "type" to be retrieved. The KPI "type" is a set of related KPIs. Specifying this parameter will return the KPI metadata response, which contains the KPI metadata (schema) for each of the KPI data values of associated with that KPI type. Use the "type" parameter with a valid KPI type string.
    Note - The valid KPI types can be discovered using the KPI discovery API, which is this API without the "type" parameter.
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

Successful for KPI metadata or KPI discovery.

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 discover available KPI types or get the KPI schema for a type. 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/kpiTypes"

Example of Accessing the API with Python

The following example shows how to discover available KPI types or get the KPI schema for a type. 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/kpiTypes"
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:22:39 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/>
  <messages/>
  <links>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=globalSessions</link>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=sessCapacityUtil</link>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=sipRegistrations</link>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=sysCPUUtil</link>
    <link>https://${SBCIP}/rest/v1.1/statistics/kpiTypes?type=sysMemoryUtil</link>
  </links>
</response>
Back to Top