...
Create a configuration file in the default location /etc/aviso/config.yaml with the following settings:
Code Block language yml username: <user_email> listeners: - event: dissemination request: destination: <user_destination> stream: enfo step: [1,2,3] triggers: - type: echo
The first line is required for a correct authentication, the username is the email associated to the user's ECMWF account. This can be checked by logging at https://api.ecmwf.int/v1/key/.
This file is a basic example of a
dissemination
event listener.request
describes for which dissemination events the user wants to execute the triggers. It is made by a set of fields. Users have to specify only the fields that they wants to use as filters.destination
is a mandatory field and it is associated to one or more destinations which are linked to the user's ECMWF account. Only the notifications complying with all the fields defined will execute the trigger. The trigger in this example isecho
. This will simply print out the notification to the console output.Save the ECMWF key as a file in /etc/aviso/key. The key can be obtained by logging at https://api.ecmwf.int/v1/key/ .
Launch the aviso application
Code Block language bash theme DJango user@local aviso listen
Once in execution this command will create a process waiting for notifications. Users can terminate the application by typing
CTRL+C
.Note that the , the configuration file is read-only at start time, therefore every time users make changes to it they need to restart the listening process.
...
- The
dissemination
event is submitted by the product generation. The related listener configuration must define thedestination
field. Note that a notification A notification received by adissemination
listener will contain have the fieldlocation
containing the URL to the product notified. The
mars
event is designed for real-time data from the model output. The related listener configuration does not have thedestination
field and has no mandatory fields. Moreover the notification received by this listeners will not contain thelocation
field because the users will be able to access to it by the conventional MARS API.
...
This trigger logs the event to the log file specified. Please note that it Note, it will fail if the directory does not exist.
...
The listening will happen in a background thread defined as daemon therefore it is responsibility of the user to keep the main thread alive.
Please note that Note, the Aviso configuration file /etc/aviso/config.yaml is still needed for the authentication as explained above.
...
It will replay all the notifications sent from 20 January to 21 January and the ones complying with the listener request will execute the triggers.
Note that the , the dates must be in the past and --to
can only be defined together with --from
. The dates are defined in ISO format and they are in UTC.
...
Identify the location of the Aviso executable:
Code Block language bash theme DJango user@local whereis aviso
Create a system service unit, by creating the following file in /etc/systemd/system/aviso.service:
Code Block language yml [Unit] Description=Aviso [Service] User=<username> (if omitted it will run as root) Group=<groupname> WorkingDirectory=<home_directory> (optional) ExecStart=<aviso_location> listen [Install] WantedBy=multi-user.target
Reload systemd:
Code Block language bash theme DJango user@local sudo systemctl daemon-reload
Start the service:
Code Block language bash theme DJango user@local sudo systemctl start aviso.service
Note that if , if users change Aviso configuration, Aviso service must be restarted otherwise the change will be ineffective.