Primary App
Table of Contents
The primary app is a daemon that gets launched at startup. This app allows
control and monitoring of the other UFS processes. The app is registered as a
service with systemd and is launched as the heliolytics user; this helps keep
file permissions consistent.
Once launched, the daemon exposes a rest api to control and monitor the status
of all the UFS subprocesses. The daemon is also responsible for collecting and
recording logs from the subprocesses. It is assumed that the subprocesses'
stdout stream will be serialised JSON objects containing the level, timestamp,
module and message fields. If such a message is decoded, it shall be
recorded to a database, file, and syslog.
REST API
A REST server listening on port 8888 serves the following endpoints:
GET /status
This endpoint serves an object with the status of each process.
GET /start/{name}
This endpoint allows starting a process given a certain name in the path.
Query parameters:
- name
- Type: string
- Description: Name of the process to start. The name must be one of the keys in the object returned by the
/statusroute. - Optional: no
GET /stop/{name}
This endpoint allows stopping a process given a certain name in the path.
Query parameters:
- name
- Type: string
- Description: Name of the process to stop. The name must be one of the keys in the object returned by the
/statusroute. - Optional: no
GET /version
This endpoint will interrogate apt to get the installed version number of each package.
Return body: JSON object listing all the UFS packages and their currently installed versions.