herald package

Submodules

herald.angular_api module

ps.herald.angular_api.hello()[source]
ps.herald.angular_api.hello_to_ps_basic_logger()[source]
ps.herald.angular_api.index()[source]
ps.herald.angular_api.internal_error(exception)[source]
ps.herald.angular_api.list()[source]
ps.herald.angular_api.options()[source]

herald.bare_html_api module

ps.herald.bare_html_api.hello()[source]
ps.herald.bare_html_api.hello_to_ps_basic_logger()[source]
ps.herald.bare_html_api.index()[source]
ps.herald.bare_html_api.isset(param1, param2)[source]
ps.herald.bare_html_api.rm_logs()[source]
ps.herald.bare_html_api.set_search_params(request)[source]

herald.database module

ps.herald.database.close_engine(e=None)[source]
ps.herald.database.get_engine()[source]

current_app.config[‘DATABASE’] is already mapped to the ps.basic.Config.herald_sqlite_filename

ps.herald.database.get_session()[source]
ps.herald.database.init_app(app)[source]
ps.herald.database.init_db()[source]

herald.model module

The models.

class ps.herald.model.HeartBeat(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Store the HeartBeat of the different systems.

id
newest_heartbeat
system_id
class ps.herald.model.Log(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

The logging message.

The model currently is build around the data structure,

the standard python logging mechanism uses to send logging Events across the class logging.StreamHandler().

api_version
args
as_dict()[source]

Return row as dict.

asctime
created
exc_info
exc_text
filename
funcname
id
levelname
levelno
lineno
message
module
msecs
name
package_version
pathname
process
processname
produkt_id
relativecreated
stack_info
sub_sub_system_id
sub_system_id
summary
system_id
thread
threadname
user_spec_1
user_spec_2

herald.ps_bridge module

ps.herald.ps_bridge.client_connected_handler(client_reader, client_writer)[source]

Start a new asyncio.Task to handle this specific client connection

ps.herald.ps_bridge.handle_client(client_reader, client_writer)[source]

Runs for each client connected.

The first 4 bytes of the message define the total length of the message. Hence in the first step, the first four bytes are read and then the rest of the message. This “rest” of the message is depickled and stored in the database. If the “bridge-mode” is enabled, the “byte-buffer” (first 4 bytes plus the rest of the message is also sent to another socket - the bridge socket.

ps.herald.ps_bridge.print_to_tunnel(data_p)[source]

Running in bridge-mode we route the incoming message to the outgoing socket.

herald.ps_herald module

herald.ps_neelix module

ps.herald.ps_neelix.check()[source]

[summary]

Go through the systemid’s found in the database:
  • check if somebody needs notification

  • update the hearbeat of the systemid

ps.herald.ps_neelix.notify(system_id_p, starting_at_p, till_p)[source]
ps.herald.ps_neelix.react(system_id_p, cause_p, value_p, row_p)[source]
  • system_id_p Name of the system for which we react

  • cause_p Name of the cause e.g. PATTERN or AGE

  • value_p Value of the cause

  • row_p table-row of the logging table correlated to the event

Module contents

ps.herald.create_app(name, have_config_file=False, test_config=None)[source]