snews_pt.__main__

Attributes

envpath

warning_text

Functions

main(ctx, env)

User interface for snews_pt tools

publish(ctx, file, firedrill, force, verbose)

Publish a message using snews_pub, multiple files are allowed

heartbeat(ctx, status, time, firedrill, verbose)

Publish heartbeat message

subscribe(ctx, plugin, outputfolder, firedrill, test)

Subscribe to Alert topic

message_schema(ctx, requested_tier)

Display the message format for each tier

run_scenarios(firedrill, test)

Test different coincidence scenarios

set_name(name)

Set your detectors name

test_connection(ctx, firedrill, start_at, patience)

Test the connection to the server

write_hb_logs(ctx, firedrill)

REQUIRES AUTHORIZATION | Print the HB logs on the server standard output

reset_cache(ctx, firedrill, test)

REQUIRES AUTHORIZATION | Drop the current cache at the server

change_broker(ctx, firedrill, brokername)

REQUIRES AUTHORIZATION | If authorized, server changes the broker

get_feedback(ctx, firedrill)

REQUIRES AUTHORIZATION | Get heartbeat feedback by email

Module Contents

snews_pt.__main__.envpath[source]
snews_pt.__main__.warning_text = ''[source]
snews_pt.__main__.main(ctx, env)[source]

User interface for snews_pt tools

snews_pt.__main__.publish(ctx, file, firedrill, force, verbose)[source]

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

snews_pt.__main__.heartbeat(ctx, status, time, firedrill, verbose)[source]

Publish heartbeat message

Parameters:
  • status – Status of the experiment ON/OFF.

  • time – (optional) Machine time is appended as the time of execution different time can be passed following the iso-format

snews_pt.__main__.subscribe(ctx, plugin, outputfolder, firedrill, test)[source]

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

snews_pt.__main__.message_schema(ctx, requested_tier)[source]

Display the message format for each tier

If ‘all’ is passed, displays everything.

snews_pt.__main__.run_scenarios(firedrill, test)[source]

Test different coincidence scenarios

snews_pt.__main__.set_name(name)[source]

Set your detectors name

snews_pt.__main__.test_connection(ctx, firedrill, start_at, patience)[source]

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

snews_pt.__main__.write_hb_logs(ctx, firedrill)[source]

REQUIRES AUTHORIZATION | Print the HB logs on the server standard output

later admins can see them remotely

snews_pt.__main__.reset_cache(ctx, firedrill, test)[source]

REQUIRES AUTHORIZATION | Drop the current cache at the server

snews_pt.__main__.change_broker(ctx, firedrill, brokername)[source]

REQUIRES AUTHORIZATION | If authorized, server changes the broker

snews_pt.__main__.get_feedback(ctx, firedrill)[source]

REQUIRES AUTHORIZATION | Get heartbeat feedback by email