Discover available KPI types or get the KPI schema for a type.
https://{managementIp}/rest/{version}/statistics/kpiTypes
- 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.
- 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
-
version: string
REST API version string.
Available values: v1.1
-
type: string
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.
-
Authorization:
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.
There's no request body for this operation.
Back to TopResponse
- application/xml
200 (KPI discovery) Response
object
-
data:
object data
-
links:
array links
KPI discovery hypermedia links. List of available KPI types.
-
messages:
object messages
object
array
[
{
"link":"https://{managementIp}/rest/{version}/statistics/kpiTypes?type=sessCapacityUtil"
},
{
"link":"https://{managementIp}/rest/{version}/statistics/kpiTypes?type=sysCPUUtil"
},
{
"link":"https://{managementIp}/rest/{version}/statistics/kpiTypes?type=sysMemoryUtil"
},
{
"link":"https://{managementIp}/rest/{version}/statistics/kpiTypes?type=globalSessions"
}
]
object
object
-
link(optional):
string
Links point to metadata of the available types.
200 (KPI metadata) Response
object
-
data:
array data
KPIs metadata (schemas)
-
links:
array links
KPI data links
-
messages:
object messages
object
object
-
httpMethod(optional):
string
Allowed Values:
[ "GET" ]
HTTP method to use with URL in <links> section -
kpis(optional):
array kpis
-
name(optional):
string
Descriptive name of KPI typeExample:
Get Session Capacity Utilization
object
-
containerName(optional):
string
Name of the KPI container. There can be one or more KPI containers in the <kpis> object. Therefore, this may not map directly to the KPI type depending on the number of containers.Example:
sessCapacityUtil
-
kpi(optional):
object kpi
KPI metadata (schema).
object
-
dataType(optional):
string
Allowed Values:
[ "integer", "number" ]
KPI data typeExample:integer
-
description(optional):
string
KPI descriptionExample:
The percentage of session capacity utilization
-
metricType(optional):
string
Allowed Values:
[ "counter", "gauge" ]
Metric type. Counter and gauge types are supported. Counters KPIs cumulative metrics that only increase in value or get reset to zero. Gauge KPIs are numerical values that can increase or decrease.Example:integer
-
name(optional):
string
KPI nameExample:
percentCap
-
units(optional):
string
Allowed Values:
[ "bytes", "calls", "calls per second", "messages", "messages per second", "percent", "seconds" ]
KPI units of measurement. This will be empty if there are no units of measurement for the data.Example:percent
object
-
link(optional):
string
Link to related KPI data to match the metadata responseExample:
https://{managementIp}/rest/{version}/statistics/kpis?type=sessCapacityUtil
400 Response
object
object
-
link(optional):
string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
object
-
errorMessage(optional):
string
Example:
Error message string
401 Response
object
object
-
link(optional):
string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
object
-
errorMessage(optional):
string
Example:
Error message string
404 Response
object
object
-
link(optional):
string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
object
-
errorMessage(optional):
string
Example:
Error message string
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://10.0.0.2/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://10.0.0.2/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 OK
Date: Tue, 15 Jan 2019 15:38:20 GMT
Cache-Control: no-cache
Content-Length: 549
Content-Type: application/xml
Connection: keep-alive
Keep-Alive: timeout=60, max=99
Last-Modified: Tue, 15 Jan 2019 15:38:20 GMT
X-Appweb-Seq: 161
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://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=globalSessions</link>
<link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sessCapacityUtil</link>
<link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sipRegistrations</link>
<link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysCPUUtil</link>
<link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysMemoryUtil</link>
</links>
</response>