Get Time Series Data

Get Time Series Data
Get time series data points for a given resource type and resource identifiers.

Get timeseries metrics data for a given resource_type and resource_id. (use /key-info API to check which keys have 'is_time_series' as 'true') It can be used to fetch raw metrics and aggregated metrics for metrics keys. A distinct metric is defined by combination of resource_type + site_id + node_id + resource_id + obj_id + metric_key. Only a few metric keys support query time aggregation (use /key-info API to check which keys have aggregate_by_resource_ids set to 'true').

Request
URI
POST
https://{api_host}/metrics/data
COPY
Request Body

Metrics data request body, contains list of NSX Resource Intent Paths or UUIDS (for NSX objects without intents), resource type, time interval etc.

MetricsDataRequest of type(s) application/json
Required
This request body class requires all of the following: MetricsBaseTimeRequest , InlineMetricsDataRequest1
{
    "granularity": "string",
    "start_time": 0,
    "end_time": 0,
    "keys": [
        "string"
    ],
    "resource_type": "string",
    "resource_ids": [
        "string"
    ],
    "related_metrics_request": {
        "conditions": [
            {
                "related_resource_type": "string",
                "related_resource_ids": [
                    "string"
                ],
                "metrics_condition_conjunction": "string"
            }
        ],
        "metrics_condition_conjunction": "string"
    },
    "aggregate_resource_ids": false,
    "aggregate_operation": "string",
    "max_num_data_points": 0,
    "object_ids": [
        "string"
    ],
    "node_ids": [
        "string"
    ],
    "site_ids": [
        "string"
    ],
    "page_number": 0,
    "page_size": 0,
    "filter": {
        "filter_components": [
            {
                "filter_field": "string",
                "filter_operation": "string",
                "value": "string",
                "metrics_key": "string"
            }
        ],
        "metrics_condition_conjunction": "string"
    },
    "aggregation": {
        "aggregation_dimension": "string",
        "aggregation_function": "string"
    },
    "groupby": "string",
    "include_partial_intervals": false
}
Authorization
This operation uses the following authorization methods.
Responses
200

OK

Returns MetricsDataRequest of type(s) application/json
This response body class contains all of the following: MetricsBaseTimeRequest , InlineMetricsDataRequest1
{
    "granularity": "string",
    "start_time": 0,
    "end_time": 0,
    "keys": [
        "string"
    ],
    "resource_type": "string",
    "resource_ids": [
        "string"
    ],
    "related_metrics_request": {
        "conditions": [
            {
                "related_resource_type": "string",
                "related_resource_ids": [
                    "string"
                ],
                "metrics_condition_conjunction": "string"
            }
        ],
        "metrics_condition_conjunction": "string"
    },
    "aggregate_resource_ids": false,
    "aggregate_operation": "string",
    "max_num_data_points": 0,
    "object_ids": [
        "string"
    ],
    "node_ids": [
        "string"
    ],
    "site_ids": [
        "string"
    ],
    "page_number": 0,
    "page_size": 0,
    "filter": {
        "filter_components": [
            {
                "filter_field": "string",
                "filter_operation": "string",
                "value": "string",
                "metrics_key": "string"
            }
        ],
        "metrics_condition_conjunction": "string"
    },
    "aggregation": {
        "aggregation_dimension": "string",
        "aggregation_function": "string"
    },
    "groupby": "string",
    "include_partial_intervals": false
}

default

Error Response

Returns Error of type(s) application/json
{
    "error_code": 0,
    "module_name": "string",
    "error_message": "string"
}
integer
error_code
Required

HTTP Status or Application error code

string
module_name
Optional

Module where the error happened

string
error_message
Required

Message describing the error


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"keys":["string"],"resource_type:"string"}' https://{api_host}/metrics/data