Database

We support Oracle and Postgres databases.

Multiple hosts

The dsn parameter of service database config should be specified to enable multihost option for Postgres.

DSN may be specified in the following format: luna:luna@postgres01:5432,postgres02:5432/luna_handlers?some_option=some_value. It is possible to partially fill in the DSN string (e.g. postgres01,postgres02/luna_handlers), and then the missing parameters will be filled in from proprietary parameter values (or defaults).

At startup, the service will create a pool of connections to one of DSN hosts available. In case of problems with establishing a connection after several unsuccessful attempts, the service will again try to set up a connection pool to any of DSN hosts available.

DB scheme.

_images/luna-handlers.png
class luna_handlers.db.handlers_db_tools.models.handlers_models.Handler(**kwargs)[source]

Database table model for handlers.

account_id

account uuid4 in format “xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx”, to which this handler belong

Type:

str

create_time

date and time of creation handler

Type:

DateTime

description

a client handler description

Type:

str

classmethod getColumnNames()[source]

Get all column name of table.

Returns:

list of column name in order as in db

Return type:

List[str]

handler_id

handler id, uuid4 in format “xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx”

Type:

str

is_dynamic

whether a handler is dynamic

Type:

bool

last_update_time

date and time of last change of the handler

Type:

DateTime

policies

json with policies

Type:

str

class luna_handlers.db.handlers_db_tools.models.handlers_models.Verifier(**kwargs)[source]

Database table model for verifiers.

account_id

account id

Type:

str

create_time

verifier creation time

Type:

DateTime

description

verifier description

Type:

str

classmethod getColumnNames()[source]

Get all column name of table.

Returns:

list of column name in order as in db

Return type:

List[str]

last_update_time

verifier last update time

Type:

DateTime

policies

verifier policies

Type:

str

verifier_id

verifier id

Type:

str

version

verifier version

Type:

int