Actuator Service is a microservice to process sensors and human inputs.
Actuator service workflows are described with below diagram:
With following Database relations described with below ERD:
Postman Collections:
- Account Service: here
- Generator and Processor Service: here Swagger API:
- <host_to_service>/swagger-ui
To run actuator service in local, first move to directory to desired service using sample command below:
$ cd service/<service_name>
$ go run main.go
To start using Actuator Service, Authorization Token is required. To generate a new authorization token, use step defined below:
- Open Postman Collection for Account Service
- Go to sample Login request
- Login returns authorization token used in every GRPC calls in Actuator service.
Token from Login must be inserted into GRPC Metadata with Authorization key.
To start generating random streams of data, use <Generator.Start> in the postman collection provided with below sample payload:
{
"num_of_message_per_second": 1
}
To terminate random stream generator, use <Generator.Stop> in the postman collection provided.
To fetch data from generated data stream, use <Processor.Get> in the postman collection provided with below sample payload
{
"sensor_filter": {
"id1": {
"data": "A"
},
"id2": {
"data": 13
},
"start_timestamp": {
"data": {
"seconds": "1680181182"
}
},
"end_timestamp": {
"data": {
"seconds": "1680423026"
}
}
},
"sensor_pagination": {
"item_per_page": 1,
"page_numbers": 1
}
}
Notes:
- Sensor Filter defines filters options available to fetch specific data
- To filter timestamp for each sensor due to inconvenience to insert specific timestamp, timestamp range is introduced.
- Sensor Pagination defines pagination options available to fetch a specific amount of data
- To Delete sensor data, use <Processor.Delete> using postman collection provided with sample payload:
{
"end_timestamp": {
"data": {
"nanos": 1755864072
}
},
"id1": {
"data": "A"
},
"id2": {
"data": 13
},
"start_timestamp": {
"data": {
"nanos": -2123416379
}
}
}
To edit sensor data, use <Processor.Edit> using postman collection provided with sample payload:
{
"sensors": [
{
"id2": 13,
"id1": "A",
"timestamp": {
"seconds": "659611"
},
"sensor_type": "Ultrasonic",
"sensor_value": 69882119.48466146
},
{
"id2": 15,
"sensor_type": "Gyroscope",
"sensor_value": 40499521.771295846,
"timestamp": {
"seconds": "51"
},
"id1": "Z"
}
]
}