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. 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').
Metrics data request body, contains list of NSX Resource Intent Paths or UUIDS (for NSX objects without intents), resource type, time interval etc.
{
"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"
]
}
OK
"MetricsDataResponse Object"
Epoch time in seconds. Actual start time of the data being reported
Epoch time in seconds. Actual end time of the data being reported
Granularity of the metrics data required. Defaults are based on below setting - -- If time-range is <= 12 hr, default to 5 min granularity. -- If time-range is > 12 hrs and <= 7 days, default to 1 hr granularity. -- If time-range is more than 7 days, default to 1 day granularity. If you are looking for more coarser value, use this field. E.g If ONE_HOUR is set, system will aggregate all the data points available within one hour and return the aggregated metric value. This field is not relevant (ignored) for "is_status" metrics.
Resource Type for which metric data was requested for. E.g. PolicyEdgeNode
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'.
Collection of per resource metric results
Error Response
"Error Object"
HTTP Status or Application error code
Module where the error happened
Message describing the error
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"keys":["string"],"resource_ids":["string"],"resource_type:"string"}' https://{api_host}/metrics/data