snews_pt.__main__ ================= .. py:module:: snews_pt.__main__ Attributes ---------- .. autoapisummary:: snews_pt.__main__.envpath snews_pt.__main__.warning_text Functions --------- .. autoapisummary:: snews_pt.__main__.main snews_pt.__main__.publish snews_pt.__main__.heartbeat snews_pt.__main__.subscribe snews_pt.__main__.message_schema snews_pt.__main__.run_scenarios snews_pt.__main__.set_name snews_pt.__main__.test_connection snews_pt.__main__.write_hb_logs snews_pt.__main__.reset_cache snews_pt.__main__.change_broker snews_pt.__main__.get_feedback Module Contents --------------- .. py:data:: envpath .. py:data:: warning_text .. py:function:: main(ctx, env) User interface for snews_pt tools .. py:function:: publish(ctx, file, firedrill, force, verbose) Publish a message using snews_pub, multiple files are allowed $: snews_pt publish my_json_message.json Notes The topics are read from the defaults i.e. from auxiliary/test-config.env If no file is given it can still submit dummy messages with default values .. py:function:: heartbeat(ctx, status, time, firedrill, verbose) Publish heartbeat message :param status: Status of the experiment ON/OFF. :param time: (optional) Machine time is appended as the time of execution different time can be passed following the iso-format .. py:function:: subscribe(ctx, plugin, outputfolder, firedrill, test) Subscribe to Alert topic Optionally, `plugin` script can be passed The message content as a single dictionary will be passed to this script as a positional argument. dictionary follows the snews_alert message schema .. py:function:: message_schema(ctx, requested_tier) Display the message format for each `tier` If 'all' is passed, displays everything. .. py:function:: run_scenarios(firedrill, test) Test different coincidence scenarios .. py:function:: set_name(name) Set your detectors name .. py:function:: test_connection(ctx, firedrill, start_at, patience) Test the connection to the server It should prompt your whether the coincidence script is running in the server :param start_at: `str` Where to start looking for the confirmation LATEST or EARLIEST :param patience: `int` seconds to wait before the check Sometime, it takes time for server to respond, increase patience .. py:function:: write_hb_logs(ctx, firedrill) REQUIRES AUTHORIZATION | Print the HB logs on the server standard output later admins can see them remotely .. py:function:: reset_cache(ctx, firedrill, test) REQUIRES AUTHORIZATION | Drop the current cache at the server .. py:function:: change_broker(ctx, firedrill, brokername) REQUIRES AUTHORIZATION | If authorized, server changes the broker .. py:function:: get_feedback(ctx, firedrill) REQUIRES AUTHORIZATION | Get heartbeat feedback by email