class AuditRule(db.Model): """Audit rule model""" __tablename__ = 'audit_rules' # __table_args__ = {'schema': 'network_audit'} pk = db.Column(db.Integer, db.Sequence('seq_audit_rules_pk', ), primary_key=True, nullable=False) name = db.Column(db.String(255), nullable=False) notes = db.Column(db.Text) category_pk = db.Column(db.Integer, nullable=False, default=0) modified_by = db.Column(db.Integer) added_by = db.Column(db.Integer) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow) in_built = db.Column(db.Boolean) table_name = db.Column(db.String(200)) sql = db.Column(db.Text)
class ManagedObject(db.Model): """ManagedObject model""" __tablename__ = 'managedobjects' pk = db.Column(db.Integer, db.Sequence('seq_managedobjects_pk', ), primary_key=True, nullable=False) label = db.Column(db.String(255)) name = db.Column(db.String(255), nullable=False) notes = db.Column(db.Text) parent_pk = db.Column(db.Integer, nullable=False) tech_pk = db.Column(db.Integer, nullable=False) vendor_pk = db.Column(db.Integer, nullable=False) modified_by = db.Column(db.Integer) added_by = db.Column(db.Integer) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow)
class Setting(db.Model): """Settings model""" __tablename__ = 'settings' pk = db.Column(db.Integer, db.Sequence('seq_settings_pk', ), primary_key=True, nullable=False) name = db.Column(db.String(200), unique=True, nullable=False) data_type = db.Column(db.String(200), nullable=False) integer_value = db.Column(db.Integer) float_value = db.Column(db.Float) string_value = db.Column(db.String(200)) text_value = db.Column(db.Text) timestamp_value = db.Column(db.TIMESTAMP) label = db.Column(db.String(200)) category_id = db.Column(db.String(200))
class ReportsTaskLog(db.Model): __tablename__ = 'reports_task_log' __table_args__ = {'schema': 'reports'} pk = db.Column(db.Integer, db.Sequence('seq_reports_task_log_pk', schema='reports'), primary_key=True, nullable=False) action = db.Column('action', db.String(200), nullable=False) # reports.generate log = db.Column('log', db.Text) options = db.Column('options', postgresql.JSON) status = db.Column( 'status', db.String(200)) # FAILED,RUNNING,PENDING,STARTED,FINISHED modified_by = db.Column(db.Integer, default=0) added_by = db.Column(db.Integer, default=0) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow)
class CMFileFormats(db.Model): """ CM file formats model """ __tablename__ = 'cm_file_formats' pk = db.Column(db.Integer, db.Sequence('seq_cm_file_formats_pk', ), primary_key=True, nullable=False) name = db.Column(db.String(100), unique=True, nullable=False) label = db.Column(db.String(100), nullable=False) vendor_pk = db.Column(db.Integer, nullable=False) tech_pk = db.Column(db.Integer, nullable=False) modified_by = db.Column(db.Integer) added_by = db.Column(db.Integer) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow)
class ReportCategory(db.Model): __tablename__ = 'report_categories' __table_args__ = {'schema': 'reports'} pk = db.Column(db.Integer, db.Sequence('seq_report_categories_pk', schema='reports'), primary_key=True, nullable=False) name = db.Column('name', db.String(100), nullable=False) notes = db.Column('notes', db.Text) parent_pk = db.Column('parent_pk', db.Integer) modified_by = db.Column(db.Integer) added_by = db.Column(db.Integer) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow)
class Report(db.Model): # __table__ = Table('reports', metadata, autoload=True, autoload_with=db.engine, schema='public') __tablename__ = 'reports' __table_args__ = {'schema': 'reports'} pk = db.Column(db.Integer, db.Sequence('seq_reports_pk', schema='reports'), primary_key=True, nullable=False) name = db.Column('name', db.String(100), nullable=False) notes = db.Column('notes', db.Text) query = db.Column(db.Text) db_connector_pk = db.Column('db_connector_pk', db.Integer) options = db.Column('options', postgresql.JSON) # JSON category_pk = db.Column('category_pk', db.Integer) modified_by = db.Column(db.Integer) added_by = db.Column(db.Integer) date_added = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) date_modified = db.Column(db.TIMESTAMP, default=datetime.datetime.utcnow)