Get KPI data
https://{managementIp}/rest/{version}/statistics/kpis
Request
-
version: string
REST API version string.
Available values: v1.1
-
type: string
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).
-
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 Response
object
-
data:
object data
KPI data. There can be one or more KPIs in the <data> object.
-
links:
array links
-
messages:
object messages
object
-
(actual containerName)(optional):
object (actual containerName)
This is a KPI container. The name of the tag is shown in parentheses because it is variable and dependent on the actual container name. It may or may not be the same as the type depending on the KPI type specified. Some types may have multiple containers.
object
object
-
(actual KPI name)(optional):
string
This is the KPI name. The name of the tag is shown in parentheses because it is variable and dependent on the actual KPI. The value enclosed by this tag is also shown in parentheses because it is variable and its value is the actual KPI data value.Example:
(Actual KPI value)
object
-
link(optional):
string
Link to related KPI schema to match the KPI data responseExample:
https://{managementIp}/rest/v1.1/statistics/kpiTypes?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 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://10.0.0.2/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://10.0.0.2/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 OK
Date: Tue, 15 Jan 2019 15:42:28 GMT
Cache-Control: no-cache
Content-Length: 287
Content-Type: application/xml
Connection: keep-alive
Keep-Alive: timeout=60, max=99
Last-Modified: Tue, 15 Jan 2019 15:42:28 GMT
X-Appweb-Seq: 164
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://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysMemoryUtil</link>
</links>
</response>