Access Time Series Analytics Microservice API#
The Time Series Analytics Microservice provides an interactive Swagger UI at http://localhost:5000/docs
.
Note: Use the link http://localhost:30002/docs
to access the Swagger UI if doing a Helm-based deployment on a Kubernetes cluster.
Accessing the Swagger UI#
To view the current configuration:#
Open the Swagger UI in your browser.
Locate the
GET /config
endpoint.Expand the endpoint and click Execute. The response displays the current configuration of the Time Series Analytics Microservice.
To update the current configuration:#
Open the Swagger UI in your browser.
Find the
POST /config
endpoint.Expand the endpoint, enter the new configuration in the request body, and click Execute. This enables dynamic configuration at runtime. The service will apply the updated configuration and start with the new configuration.
Note: If you restart the Time Series Analytics Microservice, it will start with the default configuration present in the
config.json
file.
To send input data to the Time Series Analytics Microservice#
Open the Swagger UI in your browser.
Find the
POST /input
endpoint.The input data consists of keys
topic
,tags
(optional),fields
andtimestamp
(optional). Following is the example configuration fortemperature_classifier
UDF input:{ "topic": "point_data", "tags": { "additionalProp1": {} }, "fields": { "temperature": 20 }, "timestamp": 0 }
Expand the endpoint, enter the input data in the request body, and click Execute. The service will use the input for processing data.
To send OP CUA alerts#
Open the Swagger UI in your browser.
Find the
POST /opcua_alerts
endpoint. Following is the example configuration for alert input:{ "message": "Alert message" }
Expand the endpoint, enter the alert data in the request body, and click Execute.
The service sends alert to OP CUA server as configured in the config.
Note: Before using the OPC UA alerts API, ensure that you have the OPC-UA server running and have added
opcua
to thealerts
section inconfig.json
file
Check the status of the Time Series Analytics Microservice#
Open the Swagger UI in your browser.
Locate the
GET /health
endpoint.Expand the endpoint and click Execute. The response displays the current status of Kapacitor daemon of the Time Series Analytics Microservice.