.. This file is part of LOVE-commander. .. Copyright (c) 2023 Inria Chile. .. Developed by Inria Chile. .. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or at your option any later version. .. This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .. You should have received a copy of the GNU General Public License along with this program. If not, see . ============= How to use it ============= Commands =============================== Endpoint to run commands on SAL - Url: :code:`/cmd/` - HTTP Operation: POST - Message Payload: .. code-block:: json { "cmd": "", "csc": "", "salindex": "", "params": { "key1": "value1", "key2": "value2", }, } - Expected Response, if command successful: .. code-block:: json { "status": 200, "data": { "ack": "Done", } } - Expected Response, if command timed-out: .. code-block:: json { "status": 504, "data": { "ack": "Command time out", } } - Expected Response, command failure: .. code-block:: json { "status": 200, "data": { "ack": "", } } SAL Info ========== Endpoints to request data from SAL. Metadata ---------------------- Requests :code:`SalInfo.metadata`. The response contains the SAL and XML version of the different CSCs. - Url: :code:`/salinfo/metadata/` - HTTP Operation: GET - Expected Response: .. code-block:: json { "status": 200, "data": { "": { "sal_version": "", "xml_version": "" }, "": { "sal_version": "", "xml_version": "" }, }, } For example: .. code-block:: json { "status": 200, "data": { "Watcher": { "sal_version": "4.1.3", "xml_version": "1.0.0" }, "MTM1M3": { "sal_version": "4.1.3", "xml_version": "1.0.0" }, "ATPtg": { "sal_version": "4.1.3", "xml_version": "1.0.0" }, "ATPneumatics": { "sal_version": "4.1.3", "xml_version": "1.0.0" }, }, } Topic Names ---------------------- Requests :code:`SalInfo.topic_names`. The response contains the events, telemetries and command names of each CSC. The URL accepts :code:`` as query params, which can be any combination of the following strings separated by "-": :code:`event`, :code:`telemetry` and :code:`command`. If there is no query param, then all topics are selected. - Url: :code:`/salinfo/topic-names?categories=` - HTTP Operation: GET - Expected Response: .. code-block:: json { "status": 200, "data": { "": { "event_names": ["", ""], "telemetry_names": ["", ""], "command_names": ["", ""] }, "": { "event_names": ["", ""], "telemetry_names": ["", ""], "command_names": ["", ""] }, }, } For example: .. code-block:: json { "status": 200, "data": { "Watcher": { "event_names": [ "alarm", "appliedSettingsMatchStart", "errorCode", "heartbeat", "logLevel", "logMessage", "settingVersions", "settingsApplied", "simulationMode", "softwareVersions", "summaryState" ], "telemetry_names": [], "command_names": [ "abort", "acknowledge", "disable", "enable", "enterControl", "exitControl", "mute", "setLogLevel", "setValue", "showAlarms", "standby", "start", "unacknowledge", "unmute" ] }, }, } Topic Data ---------------------- Requests :code:`SalInfo.topic_data`. The response contains the events, teelemetries and command data of each CSC. The URL accepts :code:`` as query params, which can be any combination of the following strings separated by "-": :code:`event`, :code:`telemetry` and :code:`command`. If there is no query param, then all topics are selected. - Url: :code:`/salinfo/topic-data?categories=` - HTTP Operation: GET - Expected Response: .. code-block:: json { "status": 200, "data": { "": { "event_data": { "": { "": "", "": "", }, "": { "": "", "": "", }, }, "telemetry_data": { "": { "": "", "": "", }, "": { "": "", "": "", }, }, "command_data": { "": { "": "", "": "", }, "": { "": "", "": "", }, }, }, }, } Heartbeats ============ Endpoints to request :code:`LOVE-Commander` heartbeats. - Url: :code:`/heartbeat/` - HTTP Operation: GET - Expected Response: .. code-block:: json { "status": 200, "timestamp": "", } EFD ============ Endpoint to request EFD timeseries. - Url: :code:`/efd/timeseries` - HTTP Operation: POST - Message Payload: .. code-block:: json { "start_date": "2020-03-16T12:00:00", "time_window": 15, "cscs": { "ATDome": { 0: { "topic1": ["field1"] }, }, "ATMCS": { 1: { "topic2": ["field2", "field3"] }, } }, "resample": "1min", } - Expected Response, if command successful: .. code-block:: json { "status": 200, "data": { "ATDome-0-topic1": { "field1": [ { "ts": "2020-03-06 21:49:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:50:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:51:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:52:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:53:41.471000", "value": 0.21 } ] }, "ATMCS-1-topic2": { "field2": [ { "ts": "2020-03-06 21:49:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:50:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:51:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:52:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:53:41.471000", "value": 0.21 } ], "field3": [ { "ts": "2020-03-06 21:49:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:50:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:51:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:52:41.471000", "value": 0.21 }, { "ts": "2020-03-06 21:53:41.471000", "value": 0.21 } ] } } } TCS ============ Endpoint to send TCS commands. - Url: :code:`/tcs/aux` - HTTP Operation: POST - Message Payload: .. code-block:: json { "command_name": "point_azel", "params": { "az": 80, "el": 70 } } - Expected Response, if command successful: .. code-block:: json { "status": 200, "data": "command_result" }