Get metric timeseries

get

/serviceapi/entityModel/uds/metrics

Retrieves Metric data in a given time series.

The defined time series can be either raw data points, aggregated data over a time interval, or split intervals defined by the number of periods in seconds.

Time series follow the format: YYYY-MM-DDTHH:MM:SS.SSSZ

Supported functions:

  • STDDEV
  • MAX
  • MEDIAN
  • MIN
  • PERCENTILE_DISC
  • LAST_VALUE
  • FIRST_VALUE
  • AVG

Request

Supported Media Types
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

successful operation
Body ()
Root Schema : UdsTimeseries
Type: object

Describes a metric Timeseries.

Show Source
Nested Schema : dataPoints
Type: array
The data points of the metric query
Show Source
Nested Schema : dimension
Type: object
Additional Properties Allowed
Show Source
The dimension
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: object
Back to Top

Examples

There are multiple possibilities to retrieve metric data by time series. In all cases the result is a list of time points in the following format:

{
  "entityType": "myHostType",
  "entityName": "myHostEntity",
  "metric": "cpuUser",
  "dimension": {
    "cpuId": "0"
  },
  "startTime": "2018-10-11T01:00:00.000Z",
  "endTime": "2018-10-12T12:00:00.000Z",
  "dataPoints": [
    [
      "2018-10-11T13:14:15.001Z",
      20
    ]
  ],
  "function": "AVG",
  "period": 300
}

In the above function, period and dimension are only returned if these options are used. See the following example use cases:

Get all time points from a single entity:

curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser"

The output shows two results:

{
  "entityType": "myHostType",
  "entityName": "myHostEntity",
  "metric": "cpuUser",
  "startTime": "2018-10-11T01:00:00.000Z",
  "endTime": "2018-10-12T12:00:00.000Z",
  "dataPoints": [
    [
      "2018-10-11T13:14:15.001Z",
      20
    ],
    [
      "2018-10-11T13:14:15.001Z",
      10
    ]
  ]
}

Get all time points for a given dimension cpuId=0:

curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0"

The result shows the dimension and a single data point:

{
  "entityType": "myHostType",
  "entityName": "myHostEntity",
  "metric": "cpuUser",
  "dimension": {
    "cpuId": "0"
  },
  "startTime": "2018-10-11T01:00:00.000Z",
  "endTime": "2018-10-12T12:00:00.000Z",
  "dataPoints": [
    [
      "2018-10-11T13:14:15.001Z",
      20
    ]
  ]
}

Get the aggregated average in dimension cpuId=0 in a one day interval:

curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0&function=AVG"

The result shows the dimension and the function used:

{
  "entityType": "myHostType",
  "entityName": "myHostEntity",
  "metric": "cpuUser",
  "dimension": {
    "cpuId": "0"
  },
  "startTime": "2018-10-11T01:00:00.000Z",
  "endTime": "2018-10-12T12:00:00.000Z",
  "dataPoints": [
    [
      "2018-10-11T13:14:15.001Z",
      20
    ]
  ],
  "function": "AVG"
}

Get the aggregated average in intervals of 600 seconds:

curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0&function=AVG&period=600"

The result shows that there are two data points, one at 13:15:00 and the other at 13:20:00:

{
  "entityType": "myHostType",
  "entityName": "myHostEntity",
  "metric": "cpuUser",
  "dimension": {
    "cpuId": "0"
  },
  "startTime": "2018-10-11T01:00:00.000Z",
  "endTime": "2018-10-12T12:00:00.000Z",
  "dataPoints": [
    [
      "2018-10-11T13:15:00.000Z",
      23
    ],
    [
      "2018-10-11T13:20:00.000Z",
      44
    ]
  ],
  "function": "AVG",
  "period": 300
}
Back to Top