Esempio n. 1
0
class Node(Node_Base):
    __tablename__ = 'nodes'
    node_id = Column(db.Integer, primary_key=True, autoincrement=True)
    created_at = Column(db.DateTime)
    updated_at = Column(db.DateTime)
    deleted_at = Column(db.DateTime)
    management_ip = Column(db.String(255))
    ssh_user = Column(db.String(255))
    ssh_password = Column(db.String(255))
    status = Column(db.Text)
    node_display_name = Column(db.String(255))
    #node_info_id = Column(db.String(255), db.ForeignKey('node_infos.node_info_id'))
    #deployment_id = Column(db.Integer, db.ForeignKey('deployments.deployment_id'))
    node_type = Column(db.String(255))

    #node_info = relationship("Node_info")
    #$deployment = relationship("Deployment")
    #service_infos = relationship("Service_info", back_populates="node")
    #node_roles = relationship("Node_role", back_populates="node")

    def __repr__(self):
        return "<Node(node_id='%s',created_at='%s',updated_at='%s',deleted_at='%s',management_ip='%s',ssh_user='******',ssh_password='******',status='%s',node_display_name='%s',node_info_id='%s',deployment_id='%s',node_type='%s')>" % (
            self.node_id, self.created_at, self.updated_at, self.deleted_at,
            self.management_ip, self.ssh_user, self.ssh_password, self.status,
            self.node_display_name, self.node_info_id, self.deployment_id,
            self.node_type)
Esempio n. 2
0
class Update_change(Node_Base):
    __tablename__ = 'update_change'
    id = Column(db.Integer, primary_key=True, autoincrement=True)
    update_id = Column(db.String(255), db.ForeignKey('updates.update_id'))
    change_id = Column(db.String(255), db.ForeignKey('changes.change_id'))

    def __repr__(self):
        return "<Update_change(update_id='%s',change_id='%s')>" % (
            self.update_id, self.change_id)
Esempio n. 3
0
class Interface_resource(Node_Base):
    __tablename__ = 'interface_resources'
    interface_id = Column(db.String(255),
                          primary_key=True,
                          default=generate_uuid)
    device_name = Column(db.String(255))
    speed = Column(db.Integer)
    port_info = Column(db.Text)
    active = Column(db.String(255))
    features = Column(db.Text)
    macaddress = Column(db.String(255))
    module = Column(db.String(255))
    mtu = Column(db.Integer)
    pciid = Column(db.String(255))
    phc_index = Column(db.Integer)
    type_interface = Column(db.String(255))
    is_default_ip = Column(db.String(255))
    node_info_id = Column(db.String(255),
                          db.ForeignKey('node_infos.node_info_id'))
    node_info = relationship("Node_info")

    def __repr__(self):
        return "<Interface_resource(interface_id='%s',device_name='%s',speed='%s',port_info='%s',active='%s',features='%s',macaddress='%s',module='%s',mtu='%s',pciid='%s',phc_index='%s',type_interface='%s',is_default_ip='%s',node_info_id='%s')>" % (
            self.interface_id, self.device_name, self.speed, self.port_info,
            self.active, self.features, self.macaddress, self.module, self.mtu,
            self.pciid, self.phc_index, self.type_interface,
            self.is_default_ip, self.node_info_id)
Esempio n. 4
0
class Node_info(Node_Base):
    __tablename__ = 'node_infos'

    node_info_id = Column(db.String(255),primary_key=True,default=generate_uuid)
    node_name=Column(db.String(255))
    memory_mb = Column(db.Integer)
    memory_mb_free= Column(db.Integer)
    numa_topology= Column(db.Text)
    metrics=Column(db.Text)
    processor_core=Column(db.Integer)
    processor_count=Column(db.Integer)
    processor_threads_per_core=Column(db.Integer)
    processor_vcpu=Column(db.Integer)

    os_family=Column(db.String(255))
    pkg_mgr=Column(db.String(255))
    os_version=Column(db.String(255))
    default_ipv4=Column(db.String(255))
    default_broadcast=Column(db.String(255))
    default_gateway=Column(db.String(255))
    default_interface_id=Column(db.String(255))

    interface_resources=relationship("Interface_resource", back_populates="node_info")
    disk_resources = relationship("Disk_resource", back_populates="node_info")




    def __repr__(self):
        return "<Node_info(node_info_id='%s',node_name='%s',memory_mb='%s',memory_mb_free='%s',numa_topology='%s',metrics='%s',processor_core='%s',processor_count='%s',processor_threads_per_core='%s',processor_vcpu='%s',os_family='%s',pkg_mgr='%s',os_version='%s',default_ipv4='%s',default_broadcast='%s',default_gateway='%s',default_interface_id='%s')>" %(self.node_info_id,self.node_name,self.memory_mb,self.memory_mb_free,self.numa_topology,self.metrics,self.processor_core,self.processor_count,self.processor_threads_per_core,self.processor_vcpu,self.os_family,self.pkg_mgr,self.os_version,self.default_ipv4,self.default_broadcast,self.default_gateway,self.default_interface_id) 
Esempio n. 5
0
class Service_setup(Node_Base):
    __tablename__ = 'service_setups'
    service_setup_id = Column(db.String(255),primary_key=True,default=generate_uuid)
    service_type=Column(db.String(255))
    service_name= Column(db.String(255))
    service_info=Column(db.Text)
    service_lib=Column(db.Text)
    service_config_folder=Column(db.Text)
    setup_index=Column(db.Integer)
    is_validated_success=Column(db.String(255))
    validated_status=Column(db.String(255))
    deployment_id=Column(db.Integer , db.ForeignKey('deployments.deployment_id'))
    deployment = relationship("Deployment")
    tasks = relationship("Task", back_populates="service_setup")
    def __repr__(self):
        return "<Service_setup(service_setup_id='%s',service_type='%s',service_name='%s',service_info='%s',service_lib='%s',service_config_folder='%s',setup_index='%s',is_validated_success='%s',validated_status='%s',deployment_id='%s')>" %(self.service_setup_id,self.service_type,self.service_name,self.service_info,self.service_lib,self.service_config_folder,self.setup_index,self.is_validated_success,self.validated_status,self.deployment_id) 
Esempio n. 6
0
class Service_info(Node_Base):
    __tablename__ = 'service_infos'
    service_id = Column(db.Integer, primary_key=True, autoincrement=True)
    service_type = Column(db.String(255))
    service_status = Column(db.String(255))
    tag = Column(db.String(255))
    node_id = Column(db.Integer, db.ForeignKey('nodes.node_id'))

    node = relationship("Node")
    file_configs = relationship("File_config",
                                secondary='service_info_file_config')

    def __repr__(self):
        return "<Service_info(service_id='%s',service_type='%s',service_status='%s',tag='%s',node_id='%s')>" % (
            self.service_id, self.service_type, self.service_status, self.tag,
            self.node_id)
Esempio n. 7
0
class File_config(Node_Base):
    __tablename__ = 'file_configs'
    file_id = Column(db.Integer,primary_key=True, autoincrement=True)
    node_id=Column(db.Integer, db.ForeignKey('nodes.node_id'))
    file_name= Column(db.String(255))
    file_path=Column(db.String(255))
    service_name=Column(db.String(255))
    created_at=Column(db.DateTime)
    modified_at=Column(db.DateTime)
    
    service_infos = relationship('Service_info',secondary='service_info_file_config')
    node = relationship('Node')
    openstack_configs = relationship("Openstack_config", back_populates="file_config")


    def __repr__(self):
        return "<File_config(file_id='%s',node_id='%s',file_name='%s',file_path='%s',service_name='%s',created_at='%s',modified_at='%s')>" %(self.file_id,self.node_id,self.file_name,self.file_path,self.service_name,self.created_at,self.modified_at) 
Esempio n. 8
0
class Password(Node_Base):
    __tablename__ = 'passwords'
    password_id = Column(db.String(255),
                         primary_key=True,
                         default=generate_uuid)
    created_at = Column(db.DateTime)
    updated_at = Column(db.DateTime)
    user = Column(db.String(255))
    password = Column(db.String(255))
    update_id = Column(db.String(255), db.ForeignKey('updates.update_id'))
    service_name = Column(db.String(255))

    update = relationship("Update")

    def __repr__(self):
        return "<Password(password_id='%s',created_at='%s',updated_at='%s',user='******',password='******',update_id='%s',service_name='%s')>" % (
            self.password_id, self.created_at, self.updated_at, self.user,
            self.password, self.update_id, self.service_name)
Esempio n. 9
0
class Node_role(Node_Base):
    __tablename__ = 'node_roles'
    id = Column(db.Integer, primary_key=True, autoincrement=True)
    role_name = Column(db.String(255))
    node_id = Column(db.Integer, db.ForeignKey('nodes.node_id'))
    node = relationship("Node")

    def __repr__(self):
        return "<Node_role(role_name='%s',node_id='%s')>" % (self.role_name,
                                                             self.node_id)
Esempio n. 10
0
class Update(Node_Base):
    __tablename__ = 'updates'
    update_id = Column(db.String(255),primary_key=True,default=generate_uuid)
    created_at=Column(db.DateTime)
    deleted_at= Column(db.DateTime)
    note=Column(db.Text)
    log=Column(db.Text)

    change=relationship('Update',secondary='update_change')
    def __repr__(self):
        return "<Update(update_id='%s',created_at='%s',deleted_at='%s',note='%s',log='%s')>" %(self.update_id,self.created_at,self.deleted_at,self.note,self.log) 
Esempio n. 11
0
class Openstack_config(Node_Base):
    __tablename__ = 'openstack_configs'
    config_id = Column(db.String(255), primary_key=True, default=generate_uuid)
    created_at = Column(db.DateTime)
    deleted_at = Column(db.DateTime)
    key = Column(db.String(255))
    value = Column(db.Text)
    service = Column(db.String(255))
    update_id = Column(db.String(255), db.ForeignKey('updates.update_id'))
    password_id = Column(db.Integer, db.ForeignKey('passwords.password_id'))
    block = Column(db.String(255))
    file_id = Column(db.Integer, db.ForeignKey('file_configs.file_id'))
    activate = Column(db.Integer)

    update = relationship("Update")
    password = relationship("Password")
    file_config = relationship("File_config")

    def __repr__(self):
        return "<Openstack_config(config_id='%s',created_at='%s',deleted_at='%s',key='%s',value='%s',service='%s',update_id='%s',password_id='%s',block='%s',file_id='%s',activate='%s')>" % (
            self.config_id, self.created_at, self.deleted_at, self.key,
            self.value, self.service, self.update_id, self.password_id,
            self.block, self.file_id, self.activate)
Esempio n. 12
0
class Disk_resource(Node_Base):
    __tablename__ = 'disk_resources'
    disk_id = Column(db.String(255), primary_key=True, default=generate_uuid)
    device_name = Column(db.String(255))
    size = Column(db.Integer)
    model = Column(db.String(255))
    removable = Column(db.Integer)
    sectors = Column(db.Text)
    sectorsize = Column(db.Integer)
    serial = Column(db.String(255))
    vendor = Column(db.String(255))
    support_discard = Column(db.String(255))
    virtual = Column(db.Integer)
    node_info_id = Column(db.String(255),
                          db.ForeignKey('node_infos.node_info_id'))

    node_info = relationship("Node_info")

    def __repr__(self):
        return "<Disk_resource(disk_id='%s',device_name='%s',size='%s',model='%s',removable='%s',sectors='%s',sectorsize='%s',serial='%s',vendor='%s',support_discard='%s',virtual='%s',node_info_id='%s')>" % (
            self.disk_id, self.device_name, self.size, self.model,
            self.removable, self.sectors, self.sectorsize, self.serial,
            self.vendor, self.support_discard, self.virtual, self.node_info_id)
Esempio n. 13
0
class Task(Node_Base):
    __tablename__ = 'tasks'
    task_id = Column(db.Integer, primary_key=True, autoincrement=True)
    created_at = Column(db.DateTime)
    finished_at = Column(db.DateTime)
    task_display_name = Column(db.String(255))
    setup_data = Column(db.String(255))
    task_type = Column(db.String(255))
    status = Column(db.String(255))
    result = Column(db.String(255))
    log = Column(db.Text)
    task_index = Column(db.Integer)
    service_setup_id = Column(db.String(255),
                              db.ForeignKey('service_setups.service_setup_id'))
    service_setup = relationship("Service_setup")
    changes = relationship("Change", back_populates="task")

    def __repr__(self):
        return "<Task(task_id='%s',created_at='%s',finished_at='%s',task_display_name='%s',setup_data='%s',task_type='%s',status='%s',result='%s',log='%s',task_index='%s',service_setup_id='%s')>" % (
            self.task_id, self.created_at, self.finished_at,
            self.task_display_name, self.setup_data, self.task_type,
            self.status, self.result, self.log, self.task_index,
            self.service_setup_id)
Esempio n. 14
0
class Change(Node_Base):
    __tablename__ = 'changes'
    change_id=Column(db.String(255),primary_key=True,default=generate_uuid)
    created_at=Column(db.DateTime)
    finished_at=Column(db.DateTime)
    status=Column(db.String(255))
    change_type=Column(db.String(255))
    new_service=Column(db.String(255))
    backup_service=Column(db.String(255))
    new_file=Column(db.Text)
    backup_file=Column(db.Text)
    new_folder=Column(db.Text)
    backup_folder=Column(db.Text)
    change_log=Column(db.Text)
    task_id=Column(db.Integer, db.ForeignKey('tasks.task_id'))
    change_index=Column(db.Integer)
    file_config_id=Column(db.String(255), db.ForeignKey('file_configs.file_id'))
    file_config_file_id=Column(db.Integer)

    task = relationship("Task")
    file_config = relationship("File_config")
    update=relationship("Update", secondary='update_change')
    def __repr__(self):
        return "<Change(change_id='%s',created_at='%s',finished_at='%s',status='%s',change_type='%s',new_service='%s',backup_service='%s',new_file='%s',backup_file='%s',new_folder='%s',backup_folder='%s',change_log='%s',task_id='%s',change_index='%s',file_config_id='%s',file_config_file_id='%s')>" %(self.change_id,self.created_at,self.finished_at,self.status,self.change_type,self.new_service,self.backup_service,self.new_file,self.backup_file,self.new_folder,self.backup_folder,self.change_log,self.task_id,self.change_index,self.file_config_id,self.file_config_file_id)