ait.core.server.plugins.data_archive module

class ait.core.server.plugins.data_archive.DataArchive(inputs, outputs, datastore='ait.core.db.InfluxDBBackend', **kwargs)

Bases: ait.core.server.plugin.Plugin

__init__(inputs, outputs, datastore='ait.core.db.InfluxDBBackend', **kwargs)

Attempts to connect to database backend. Plugin will not be created if connection fails.

Creates base packet dictionary for decoding packets with packet UIDs as keys and packet definitions as values.

Params:
inputs: list of names of input streams to plugin outputs: list of names of plugin output streams datastore: path to database backend to use **kwargs: any args required for connecting to backend database
Raises:
ImportError: raised if provided database backend does not exist or
cannot be imported
Exception: raised if the backened database cannot be connected to
for any reason
process(input_data, topic=None, **kwargs)

Splits tuple received from PacketHandler into packet UID and packet message. Decodes packet and inserts into database backend. Logs any exceptions raised.

Params:
input_data: message received from inbound stream through PacketHandler topic: name of inbound stream message received from **kwargs: any args required for connected to the backend