Example #1
0
class SavedJobs(db.Model):
    __bind_key__ = 'general'
    __tablename__ = 'saved_jobs'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    name = db.Column(db.String, nullable=False, unique=True)
    notes = db.Column(db.Text)
    engine_name = db.Column(db.String(50), nullable=False)
    engine_class = db.Column(db.String(50), nullable=False)

    last_attempted_run = db.Column(db.DateTime)
    last_successful_run = db.Column(db.DateTime)
    time_added = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.utcnow)

    db.relationship('JobHistory', backref='saved_job', lazy=True)
    db.relationship('JobParameter', backref='saved_job', lazy=True)
Example #2
0
class PhysicalLocationType(db.Model):
    __bind_key__ = 'general'
    __tablename__ = 'physical_location_type'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    name = db.Column(db.String(50), nullable=False, unique=True)
    subtype = db.Column(db.String(15), nullable=False)  # cloud, local, offsite
    description = db.Column(db.Text)

    physical_locations = db.relationship('PhysicalLocation',
                                         backref='physical_location_type',
                                         lazy=True)
Example #3
0
class CredentialGroup(db.Model):
    __bind_key__ = 'general'
    __tablename__ = 'credential_group'
    id = db.Column(db.Integer, primary_key=True)
    credentials = db.relationship('CredentialStore',
                                  backref='credential_group',
                                  lazy='subquery')
    description = db.Column(db.String(100))
    service_name = db.Column(db.String(50), nullable=False)
    time_added = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.utcnow)
Example #4
0
class BackupObject(db.Model):
    __bind_key__ = 'general'
    __tablename__ = 'backup_object'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    data = db.Column(db.Text)
    last_good_backup = db.Column(db.DateTime)
    time_added = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.utcnow)

    backup_set_id = db.Column(db.Integer, db.ForeignKey('backup_set.id'))
    snapshots = db.relationship('Snapshot', backref='backup_object', lazy=True)
Example #5
0
class Engine(db.Model):
    __bind_key__ = 'backup'
    __tablename__ = 'engine'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    name = db.Column(db.String(50), nullable=False, unique=True)
    time_added = db.Column(
        db.DateTime,
        nullable=False,
        default=datetime.utcnow)

    repositories = db.relationship(
        'Repository',
        backref='engine'
    )
Example #6
0
class BackupSet(db.Model):
    __bind_key__ = 'general'
    __tablename__ = 'backup_set'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    name = db.Column(db.String(50), nullable=False, unique=True)
    type = db.Column(db.Integer, nullable=False)
    data = db.Column(db.Text)
    source = db.Column(db.String, nullable=True)
    last_good_backup = db.Column(db.DateTime)

    time_added = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.utcnow)
    backup_objects = db.relationship('BackupObject',
                                     backref='backup_set',
                                     lazy=True)
Example #7
0
class PhysicalLocation(db.Model):
    __bind_key__ = 'backup'
    __tablename__ = 'physical_location'
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    name = db.Column(db.String(50), nullable=False, unique=True)
    address = db.Column(db.Text)
    type = db.Column(db.String(50), nullable=False)
    concurrent_jobs = db.Column(db.Integer, default=1)
    time_added = db.Column(
        db.DateTime,
        nullable=False,
        default=datetime.utcnow)

    repositories = db.relationship(
            'Repository',
            backref='physical_location',
            lazy=True)