[{"label":"Latest (2.0.1)","version":"latest"}]
telco-cloud-service-assurance

Get Metrics

Description


pre-requisite
To fetch metric types and metric names details refer Catalog API
To fetch entity name, entity type, device type, and device name refer to Topology API


API to fetch raw metrics for given metric type,entity name, and time range.

Request

Request

URL

URL


get
https://{api_host}tcsa.host.com/tcsa/api/metrics-management/v1/metric-type/{metric-type}
Copy

Path Parameters

Path Parameters

string
metric-type Required

Metric type defined in catalog


Query Parameters

Query Parameters

string
data_source Optional

Collector which collects this metric

data_source example
"AMPMNEWUS102000"

string
device_name Optional

Device instance name on which metrics collected

device_name example
"AMPMNEWUS102000_PS_Switch_10"

string
device_type Optional

Device type

device_type example
"Switch"

number
end_timestamp Optional

Must be in EPOCH seconds.
Defaults to current time

end_timestamp example
1654041600

string
entity_names Required

Entity on which metrics are collected.
Supports regex.
Supports multiple entity names up to 10 by giving comma(,)

entity_names example
"MEM-AMPMNEWUS102000_PS_Switch_10/1"

string
entity_type Optional

Entity type

entity_type example
"Memory"

number
from Optional

The from parameter defines the offset from the first result user wants to fetch. The default is 0.

from example
10

string
include_metric_names Optional

Provide metric names to be included in the response, multiple metric names separated by comma(,) .
Default to all metric names that exist for metric type

include_metric_names example
"FreeMemory,FreeMemoryPct"

number
size Optional

The size parameter allows you to configure the maximum no of records to be returned.

size example
1000

string
sort_field Optional

Sorting field. defaults to timestamp asc. Field value must match with param existing in response.

sort_field example
"timestamp"

string
sort_order Optional

Sorting order asc,desc

sort_order example
"asc"

number
start_timestamp Optional

Must be in EPOCH seconds.
Defaults to last one day

start_timestamp example
1654041600

string
tags.customer Optional

Here customer is tag enriched in metrics.
Can replace customer with any other enriched tag like city

tags.customer example
"Airtel"

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

200 OK

Returns MetricResponse of type application/json
{
	"COUNT": 1,
	"Result": [
		{
			"@timestamp": "2022-07-11T12:56:26.000Z",
			"@version": "1",
			"FreeMemory": 9295,
			"dataSource": "AMPMNEWUS102000",
			"deviceName": "AMPMNEWUS102000_PS_Switch_10",
			"deviceType": "Switch",
			"elementUUID": "AMPMNEWUS102000_PS_Switch_10$Switch$",
			"entityName": "MEM-AMPMNEWUS102000_PS_Switch_10/1",
			"entityType": "Memory",
			"instance": "SMARTS-PM-METRICS",
			"metricType": "memory",
			"processedTimestamp": 1657544634825,
			"tags": {
				"IsManaged": true,
				"dcName": "_core",
				"priority": "NONE"
			},
			"timestamp": 1657544186000,
			"type": "smarts-metrics"
		}
	]
}
array
result Optional

Response object containing array of metrics for given filter


number
total Optional

Total number of objects

Errors

Errors

400

Invalid Request sent by the user


401

User authentication failed


403

Access to the requested resource/operation is forbidden


404

Cannot find requested resource


500

Internal server error

Code Samples

Code Samples

cURL Command

curl https://{api_host}tcsa.host.com/tcsa/api/metrics-management/v1/metric-type/{metric-type}?entity_names=MEM-AMPMNEWUS102000_PS_Switch_10/1


[{"label":"Latest (2.0.1)","version":"latest"}]
telco-cloud-service-assurance
Feedback

Was this page helpful?