Exemplo n.º 1
0
class Supervisor(db.Model):
    id = db.Column(db.Integer(), unique=True)
    hostname = db.Column(db.String(), nullable=False)
    watch_dir = db.Column(db.String(), nullable=False)
    started = db.Column(db.DateTime())

    processes = db.relationship('Process', backref='supervisor', lazy='select')

    __table_args__ = (db.PrimaryKeyConstraint('hostname'), )
Exemplo n.º 2
0
class Pdu(db.Model):
    id = db.Column(db.Integer(), unique=True)
    name = db.Column(db.String(16), nullable=False)
    total = db.Column(db.BigInteger)

    recording_id = db.Column(db.Integer,
                             db.ForeignKey("recording.id"),
                             nullable=False)

    varbinds = db.relationship('VarBind',
                               cascade="all,delete",
                               backref='pdu',
                               lazy='select')
    variations = db.relationship('Variation',
                                 cascade="all,delete",
                                 backref='pdu',
                                 lazy='select')

    __table_args__ = (db.PrimaryKeyConstraint('recording_id', 'name'), )
Exemplo n.º 3
0
class Process(db.Model):
    id = db.Column(db.Integer(), unique=True)
    path = db.Column(db.String(), nullable=False)
    runtime = db.Column(db.Integer())
    memory = db.Column(db.Integer())
    cpu = db.Column(db.Integer())
    files = db.Column(db.Integer())
    exits = db.Column(db.Integer())
    changes = db.Column(db.Integer())
    last_update = db.Column(db.DateTime())
    update_interval = db.Column(db.Integer())
    supervisor_id = db.Column(db.Integer(), db.ForeignKey('supervisor.id'))

    endpoints = db.relationship('Endpoint', backref='process', lazy='select')
    console_pages = db.relationship('ConsolePage',
                                    backref='process',
                                    lazy='select')

    __table_args__ = (db.PrimaryKeyConstraint('supervisor_id', 'path'), )
Exemplo n.º 4
0
class Recording(db.Model):
    id = db.Column(db.Integer(), unique=True)
    path = db.Column(db.String(16), nullable=False)

    agent_id = db.Column(db.Integer, db.ForeignKey("agent.id"), nullable=False)

    pdus = db.relationship('Pdu',
                           cascade="all,delete",
                           backref='recording',
                           lazy='select')

    __table_args__ = (db.PrimaryKeyConstraint('agent_id', 'path'), )
Exemplo n.º 5
0
class Transport(db.Model):
    id = db.Column(db.Integer(), unique=True)
    transport_protocol = db.Column(db.String(8), nullable=False)
    endpoint = db.Column(db.String(64), nullable=False)
    peer = db.Column(db.String(64), nullable=False)

    packets = db.relationship('Packet',
                              cascade="all,delete",
                              backref='transports',
                              lazy='select')

    # Sqlalchemy's merge requires unique fields to be primary keys
    __table_args__ = (db.PrimaryKeyConstraint('transport_protocol', 'endpoint',
                                              'peer'), )
Exemplo n.º 6
0
class Agent(db.Model):
    id = db.Column(db.Integer(), unique=True)
    transport_id = db.Column(db.Integer,
                             db.ForeignKey("transport.id"),
                             nullable=False)
    engine = db.Column(db.String(64), nullable=False)
    security_model = db.Column(db.Integer(), nullable=False)
    security_level = db.Column(db.Integer(), nullable=False)
    context_engine = db.Column(db.String(64), nullable=False)
    context_name = db.Column(db.String(64), nullable=False)

    recordings = db.relationship('Recording',
                                 cascade="all,delete",
                                 backref='agent',
                                 lazy='select')

    # Sqlalchemy's merge requires unique fields to be primary keys
    __table_args__ = (db.PrimaryKeyConstraint('transport_id', 'engine',
                                              'security_model',
                                              'security_level',
                                              'context_engine',
                                              'context_name'), )