Get Time Series Data

Get Time Series Data

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. 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/napp/api/v1/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

Show optional properties

{
    "keys": [
        "string"
    ],
    "resource_type": "string",
    "resource_ids": [
        "string"
    ]
}
{
    "granularity": "string",
    "start_time": 0,
    "end_time": 0,
    "keys": [
        "string"
    ],
    "resource_type": "string",
    "resource_ids": [
        "string"
    ],
    "aggregate_resource_ids": false,
    "aggregate_operation": "string",
    "max_num_data_points": 0,
    "object_ids": [
        "string"
    ],
    "node_ids": [
        "string"
    ],
    "site_ids": [
        "string"
    ],
    "empty_value_config": {
        "technique": "string"
    }
}
Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns MetricsDataResponse of type(s) application/json
{
    "start_time": 0,
    "end_time": 0,
    "granularity": "string",
    "resource_type": "string",
    "is_status_metric": false,
    "results": [
        {
            "resource_id": "string",
            "resource_ref_id": "string",
            "site_id": "string",
            "key_results": [
                {
                    "key": "string",
                    "unit": "string",
                    "description": "string",
                    "results": [
                        {
                            "object_id": "string",
                            "node_id": "string",
                            "node_path": "string",
                            "node_name": "string",
                            "last_known_value": "string",
                            "last_known_status": {
                                "time": 0,
                                "value": "string"
                            },
                            "data": [
                                {
                                    "time": 0,
                                    "value": "string"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
integer As int64 As int64
start_time
Optional

Epoch time in seconds. Actual start time of the data being reported

integer As int64 As int64
end_time
Optional

Epoch time in seconds. Actual end time of the data being reported

granularity
Optional

Enumeration of different granular data points supported by the system. Metrics data points are maintained at 5Mins, 1Hour and 1Day granularities.

Possible values are : FIVE_MINUTES, ONE_HOUR, ONE_DAY,
string
resource_type
Optional

Resource Type for which metric data was requested for. E.g. PolicyEdgeNode

boolean
is_status_metric
Optional

Set to 'true' when the response is for 'is_status_metric' keys. For these type of metrics, do not expect to see periodic datapoints. These are reported/plotted only when the value of such metrics changes/transitions. If there are no transitions to report in the requested interval (defined by start_time - end_time), 'data' will be empty, and the latest status can be retrieved from 'last_known_value'.

results
Optional

Collection of per resource metric results


400

Invalid Input

Operation doesn't return any data structure