Cisco Prime Infrastructure API
Prime Infrastructure API Documentation

GET statisticsService/devices/metrics/{metric}

Fetches the metric data for the device. Data are represented by a list of pairs. Each pair contains metric value and timestamp when this value was collected.

Since Product Version: 3.1

Resource Information

Rate Limiting?

No

Sorting?

No

Paging?

No

Filtering?

No

Group Filtering?

No

Aggregation?

No

Response Formats

xml

json

User Group

NBI Read

HTTP Methods

GET

Resource URL

/webacs/api/v2/op/statisticsService/devices/metrics/{metric}

Request Parameters

Attribute Source Description

metric String

path

Required

The metric name for which the data need to be fetched.

device String

query

Required

The device IP or name for which the data need to be fetched.

lineCard String

query

Required

The line card name for which the data need to be fetched. Required only for CPU Utilization metric.

timeInterval Integer

query

Optional

Specifies the range of time (in hours). This field can contain values like 1, 2, 4, 8, 16, 24, 168 (1 Week), 336 (2 Weeks), 720 (1 Month), 8760 (1Year). The timeInterval parameter overrides the startTime and endTime parameters. By default is 1 hour if neither timeInterval parameter nor the parameters startTime and endTime not provided.

startTime Long

query

Optional

Specifies the start time in seconds. The timeInterval parameter overrides this parameter.

endTime Long

query

Optional

Specifies the end time in seconds. The timeInterval parameter overrides this parameter.

Response Parameters

Attribute Description

currentDateTime String

Current timestamp

description String

Metric description

metricName String

Metric name

metricRows Arrow image MetricRowDTO[]

Metric data list

resourceName String

Resource name

xValueProperty Arrow image XValueProperty

Properties of X values

yValueProperty Arrow image YValueProperty[]

Properties of Y values

Sample Payloads

Sample payloads are for information only. They are automatically generated and the values included may not be representative of actual valid data values.

Sample XML Response Payload

https://localhost/webacs/api/v2/op/statisticsService/devices/metrics/availability?device=172.20.151.111&timeInterval=4&lineCard=Supervisor%20Module-2

<?xml version="1.0" ?>
<mgmtResponse responseType="operation" requestUrl="https://localhost/webacs/api/v2/op/statisticsService/devices/metrics/availability?device=172.20.151.111&amp;amp;timeInterval=4&amp;amp;lineCard=Supervisor%20Module-2
					" rootUrl="https://localhost/webacs/api/v2/op">
  <metricData>
    <currentDateTime>String value</currentDateTime>
    <description>String value</description>
    <metricName>String value</metricName>
    <metricRows>
      <metricRows>
        <issue>String value</issue>
        <XValue>String value</XValue>
        <YValues>
          <YValues>15.0</YValues>
        </YValues>
      </metricRows>
    </metricRows>
    <resourceName>String value</resourceName>
    <XValueProperty>
      <label>String value</label>
      <unit>NUMBER</unit>
    </XValueProperty>
    <YValueProperty>
      <YValueProperty>
        <label>String value</label>
        <maxVal>4.0</maxVal>
        <minVal>4.0</minVal>
        <unit>NUMBER</unit>
      </YValueProperty>
    </YValueProperty>
  </metricData>
</mgmtResponse>

Sample JSON Response Payload

https://localhost/webacs/api/v2/op/statisticsService/devices/metrics/availability.json?device=172.20.151.111&timeInterval=4&lineCard=Supervisor%20Module-2

{
  "mgmtResponse" : {
    "@requestUrl" : "https://localhost/webacs/api/v2/op/statisticsService/devices/metrics/availability?device=172.20.151.111&amp;timeInterval=4&amp;lineCard=Supervisor%20Module-2\n\t\t\t\t\t",
    "@responseType" : "operation",
    "@rootUrl" : "https://localhost/webacs/api/v2/op",
    "metricData" : [ {
      "XValueProperty" : {
        "label" : "String value",
        "unit" : "NUMBER"
      },
      "YValueProperty" : {
        "yvalueProperty" : [ {
          "label" : "String value",
          "maxVal" : 4.0,
          "minVal" : 4.0,
          "unit" : "NUMBER"
        } ]
      },
      "currentDateTime" : "String value",
      "description" : "String value",
      "metricName" : "String value",
      "metricRows" : {
        "metricRows" : [ {
          "XValue" : "String value",
          "YValues" : {
            "yvalues" : [ 15.0 ]
          },
          "issue" : "String value"
        } ]
      },
      "resourceName" : "String value"
    } ]
  }
}