|
|
|
@ -11,12 +11,13 @@ client_image_table = Table(
|
|
|
|
|
Column("image_id", Integer, ForeignKey("vm_images.image_id"))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Client(Base):
|
|
|
|
|
__tablename__ = "clients"
|
|
|
|
|
mac_address = Column(String, primary_key=True)
|
|
|
|
|
ip_address = Column(String)
|
|
|
|
|
hostname = Column(String)
|
|
|
|
|
client_version = Column(String)
|
|
|
|
|
ip_address = Column(String(16), nullable=False)
|
|
|
|
|
hostname = Column(String(100), nullable=False)
|
|
|
|
|
client_version = Column(String(100), nullable=False)
|
|
|
|
|
vm_list_on_machine = relationship(
|
|
|
|
|
"VMImages",
|
|
|
|
|
secondary=client_image_table,
|
|
|
|
@ -29,15 +30,23 @@ class Client(Base):
|
|
|
|
|
return True
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VMImage(Base):
|
|
|
|
|
__tablename__ = "vm_images"
|
|
|
|
|
image_id = Column(Integer, primary_key=True)
|
|
|
|
|
image_name = Column(String)
|
|
|
|
|
image_file = Column(String)
|
|
|
|
|
image_version = Column(String)
|
|
|
|
|
image_hash = Column(String)
|
|
|
|
|
image_name = Column(String(100), unique=True, nullable=False)
|
|
|
|
|
image_file = Column(String(500), unique=False, nullable=False)
|
|
|
|
|
image_version = Column(String(100), nullable=False)
|
|
|
|
|
image_hash = Column(String(500), nullalbe=False)
|
|
|
|
|
clients = relationship(
|
|
|
|
|
"Clients",
|
|
|
|
|
secondary=client_image_table,
|
|
|
|
|
back_populates="clients"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class User(Base):
|
|
|
|
|
__tablename__ = "users"
|
|
|
|
|
user_id = Column(Integer, primary_key=True)
|
|
|
|
|
username = Column(String)
|
|
|
|
|
password_hash = Column(String)
|
|
|
|
|