Exemplo n.º 1
0
class Firewall2_interfaces(db.Model):
    __tablename__ = 'firewall2_interfaces'
    id = db.Column(db.Integer, primary_key=True)
    vlan = db.Column(db.String(20))
    name = db.Column(db.String(20))
    seclvl = db.Column(db.String(10))
    subnet = db.Column(db.String(10))
    enabled = db.Column(db.Boolean())
    mode = db.Column(db.String(10))
    group = db.Column(db.String(10))

    #    group = db.Column(db.Integer, db.ForeignKey('port_channels.id'))

    def __init__(self,
                 vlan=None,
                 name=None,
                 seclvl=None,
                 subnet=None,
                 enabled=None,
                 mode=None,
                 group=None):
        self.vlan = vlan
        self.name = name
        self.seclvl = seclvl
        self.subnet = subnet
        self.enabled = enabled
        self.mode = mode
        self.group = group

    def __repr__(self):
        return '%r' % (self.id)
Exemplo n.º 2
0
class Port_channels_fw1(db.Model):
    __tablename__ = 'port_channels_fw1'
    id = db.Column(db.Integer, primary_key=True)
    vlan = db.Column(db.String(20))
    name = db.Column(db.String(20))
    seclvl = db.Column(db.String(10))
    subnet = db.Column(db.String(10))
    enabled = db.Column(db.Boolean())
    mode = db.Column(db.String(10))
    #    group = db.Column(db.String(10))
    interfaces = db.relationship('Firewall1_interfaces',
                                 backref='interfaces',
                                 lazy='dynamic')

    def __init__(self,
                 vlan=None,
                 name=None,
                 seclvl=None,
                 subnet=None,
                 enabled=None,
                 mode=None,
                 group=None):
        self.vlan = vlan
        self.name = name
        self.seclvl = seclvl
        self.subnet = subnet
        self.enabled = enabled
        self.mode = mode
        self.group = group

    def __repr__(self):
        return '%r' % (self.id)
Exemplo n.º 3
0
class Saltstack_pxe_nodes(db.Model):
    __tablename__ = 'saltstack_pxe_nodes'
    id = db.Column(db.Integer, primary_key=True)
    pxeipaddr = db.Column(db.String(15), unique=True)
    pxeint = db.Column(db.String(10))
    pxemac = db.Column(db.String(20))
    pxeinstalled = db.Column(db.Boolean())
    #    vm_mac = db.relationship('System_vm_profiles', backref='systemvmbackref', lazy='dynamic')
    system_id = db.Column(db.Integer, db.ForeignKey('system_vm_profiles.id'))

    def __init__(self,
                 pxeipaddr=None,
                 pxeint=None,
                 pxemac=None,
                 pxeinstalled=None):
        self.pxeipaddr = pxeipaddr
        self.pxeint = pxeint
        self.pxemac = pxemac
        self.pxeinstalled = pxeinstalled

    def __repr__(self):
        return str('%s') % (self.pxeipaddr)
Exemplo n.º 4
0
class Switch2_48_port(db.Model):
    __tablename__ = 'switch2_48_port'
    id = db.Column(db.Integer, primary_key=True)
    devicename = db.Column(db.String(50))
    deviceport = db.Column(db.String(20))
    portmode = db.Column(db.String(10))
    portvlan = db.Column(db.String(10))
    portpxeboot = db.Column(db.Boolean())
    vlan_id = db.Column(db.Integer, db.ForeignKey('vlans.id'))

    def __init__(self,
                 devicename=None,
                 deviceport=None,
                 portmode=None,
                 portvlan=None,
                 portpxeboot=None):
        self.devicename = devicename
        self.deviceport = deviceport
        self.portmode = portmode
        self.portvlan = portvlan
        self.portpxeboot = portpxeboot

    def __repr__(self):
        return '<port %r>' % (self.id)
Exemplo n.º 5
0
class User(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(255), unique=True)
    username = db.Column(db.String(255))
    password = db.Column(db.String(255))
    last_login_at = db.Column(db.DateTime())
    current_login_at = db.Column(db.DateTime())
    last_login_ip = db.Column(db.String(100))
    current_login_ip = db.Column(db.String(100))
    login_count = db.Column(db.Integer)
    active = db.Column(db.Boolean())
    confirmed_at = db.Column(db.DateTime())
    profile_pic = db.Column(db.String(100))
    roles = db.relationship('Role',
                            secondary=roles_users,
                            backref=db.backref('users', lazy='dynamic'))

    def __init__(self,
                 email=None,
                 username=None,
                 password=None,
                 last_login_at=None,
                 current_login_at=None,
                 last_login_ip=None,
                 current_login_ip=None,
                 login_count=None,
                 active=None,
                 confirmed_at=None,
                 profile_pic=None,
                 roles=None):
        self.email = email
        self.username = username
        self.password = password
        self.last_login_at = last_login_at
        self.current_login_at = current_login_at
        self.last_login_ip = last_login_ip
        self.current_login_ip = current_login_ip
        self.login_count = login_count
        self.active = active
        self.confirmed_at = confirmed_at
        self.profile_pic = profile_pic
        self.roles = roles

    def is_authenticated(self):
        return True

    def is_active(self):
        return True

    def is_anonymous(self):
        return False

    def get_id(self):
        return unicode(self.id)

    def set_password():
        pass

    def check_password():
        pass

    def __repr__(self):
        return '<User %r>' % (self.username)