securiphant.db.states package

Submodules

securiphant.db.states.BooleanState module

class securiphant.db.states.BooleanState.BooleanState(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

SQLAlchemy table that stores boolean state values

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

key

The key for the boolean value

value

The boolean value itself

securiphant.db.states.CheckIn module

class securiphant.db.states.CheckIn.CheckIn(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

Class that defines a database table that tracks if services are running by making them check at set intervals.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

is_alive() → bool
Returns

Whether or not the service has checked in recently

last_ping

The last time the service checked in, as a unix timestamp

service

The name of the service

securiphant.db.states.IntState module

class securiphant.db.states.IntState.IntState(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

SQLAlchemy table that stores integer state values

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

key

The key for the integer value

value

The int value itself

Module contents