Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SiteController module da_rest_client is able to perform download actions with a configuration like

configuration

Code Block
languagexml
...    
<action action_id="download_memodata" device_id="rest_test">
  <commands>
     <command command_id="download">download(<'uri to request'> method=<'get'/'post'> timeout=<positive floating point number>)</command>
  </commands>
</action>
...

...

Code Block
languagexml
<command command_id="download">download('/rest/memodata_download.php', method='post', timeout=3)</command>

response

The received data of the executed request are the content of the download data. Once the action was executed, the da_rest_client signals the download in a raw result. The sensor_gateway_id of this raw result is equal to the configured device_id of the da_rest_client, which performs the download action (in our example the device_id is 'rest_test').

Code Block
languagejava
titleExample of a raw result from the da_rest_client status gateway
{
    "error_code": 0, 
    "partial": false, 
    "result_dict": {
        "dl_file": {
            "changed": true, 
            "value": "/opt/azeti/SiteController/tmp/dl-rest_test-2019-03-28T15:30:46.881+0100.zip"
        }, 
        "dl_time": {
            "changed": true, 
            "value": 0.006723880767822266
        }
    }, 
    "sensor_gateway_id": "rest_test", 
    "timestamp": "2019-03-28T15:30:46.882+0100"
}