generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from amosproj/253-clean-up-4
253 clean up 4
- Loading branch information
Showing
43 changed files
with
1,538 additions
and
1,844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,130 +1,116 @@ | ||
from datetime import datetime | ||
|
||
from sqlalchemy.orm import mapped_column, Mapped | ||
from sqlalchemy.orm import DeclarativeBase | ||
from typing import ClassVar, Optional | ||
|
||
class Base(DeclarativeBase): | ||
pass | ||
|
||
class BackupData(Base): | ||
__tablename__ = "BackupData" | ||
|
||
id: Mapped[str] = mapped_column(primary_key=True) | ||
saveset: Mapped[str] | ||
sizeMB: Mapped[int] | ||
creationDate: Mapped[datetime] | ||
bio: Mapped[str] | ||
from sqlalchemy.orm import DeclarativeBase | ||
from sqlalchemy.orm import mapped_column, Mapped | ||
|
||
def __repr__(self): | ||
return f"""BackupData(id={self.id}, sizeMB={self.sizeMB}, creationDate={self.creationDate}, bio={self.bio!r})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
class Base(DeclarativeBase): | ||
pass | ||
|
||
|
||
class Result(Base): | ||
__tablename__ = "results" | ||
|
||
# For now I only added the most relevant columns | ||
saveset: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
task: Mapped[str] | ||
task_uuid: Mapped[str] | ||
fdi_type: Mapped[str] | ||
is_backup: Mapped[int] | ||
state: Mapped[int] | ||
subtask_flag: Mapped[str] | ||
schedule: Mapped[str] | ||
|
||
start_time: Mapped[datetime] | ||
stop_time: Mapped[datetime] | ||
sbc_start: Mapped[datetime] | ||
|
||
data_size: Mapped[int] | ||
throughput: Mapped[str] | ||
duration: Mapped[int] | ||
scheduledTime: ClassVar[Optional[datetime]] = None | ||
|
||
def __repr__(self): | ||
return f"""Result(uuid={self.uuid})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
|
||
def as_dict(self): | ||
return { | ||
"saveset": self.saveset, | ||
"uuid": self.uuid, | ||
"task": self.task, | ||
"task_uuid": self.task_uuid, | ||
"fdi_type": self.fdi_type, | ||
"is_backup": self.is_backup, | ||
"state": self.state, | ||
"start_time": self.start_time, | ||
"stop_time": self.stop_time, | ||
"sbc_start": self.sbc_start, | ||
"data_size": self.data_size, | ||
"throughput": self.throughput, | ||
"duration": self.duration, | ||
"scheduledTime": self.scheduledTime, | ||
} | ||
__tablename__ = "results" | ||
|
||
# For now I only added the most relevant columns | ||
saveset: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
task: Mapped[str] | ||
task_uuid: Mapped[str] | ||
fdi_type: Mapped[str] | ||
is_backup: Mapped[int] | ||
state: Mapped[int] | ||
subtask_flag: Mapped[str] | ||
schedule: Mapped[str] | ||
|
||
start_time: Mapped[datetime] | ||
stop_time: Mapped[datetime] | ||
sbc_start: Mapped[datetime] | ||
|
||
data_size: Mapped[int] | ||
throughput: Mapped[str] | ||
duration: Mapped[int] | ||
scheduledTime: ClassVar[Optional[datetime]] = None | ||
|
||
def __repr__(self): | ||
return f"""Result(uuid={self.uuid})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
|
||
def as_dict(self): | ||
return { | ||
"saveset": self.saveset, | ||
"uuid": self.uuid, | ||
"task": self.task, | ||
"task_uuid": self.task_uuid, | ||
"fdi_type": self.fdi_type, | ||
"is_backup": self.is_backup, | ||
"state": self.state, | ||
"start_time": self.start_time, | ||
"stop_time": self.stop_time, | ||
"sbc_start": self.sbc_start, | ||
"data_size": self.data_size, | ||
"throughput": self.throughput, | ||
"duration": self.duration, | ||
"scheduledTime": self.scheduledTime, | ||
} | ||
|
||
|
||
class Tasks(Base): | ||
__tablename__ = "tasks" | ||
__tablename__ = "tasks" | ||
|
||
# For now I only added the most relevant columns | ||
task: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
# For now I only added the most relevant columns | ||
task: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
|
||
def __repr__(self): | ||
return f"""Tasks(uuid={self.uuid})""" | ||
def __repr__(self): | ||
return f"""Tasks(uuid={self.uuid})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
def __str__(self): | ||
return repr(self) | ||
|
||
|
||
class DataStore(Base): | ||
__tablename__ = "data_stores" | ||
__tablename__ = "data_stores" | ||
|
||
# For now I only added the most relevant columns | ||
name: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
capacity: Mapped[float] | ||
high_water_mark: Mapped[float] | ||
filled: Mapped[float] | ||
stored: Mapped[float] | ||
# For now I only added the most relevant columns | ||
name: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
capacity: Mapped[float] | ||
high_water_mark: Mapped[float] | ||
filled: Mapped[float] | ||
stored: Mapped[float] | ||
|
||
def __repr__(self): | ||
return f"""DataStore(name={self.name})""" | ||
def __repr__(self): | ||
return f"""DataStore(name={self.name})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
def __str__(self): | ||
return repr(self) | ||
|
||
|
||
class Schedule(Base): | ||
__tablename__ = "schedules" | ||
__tablename__ = "schedules" | ||
|
||
# For now I only added the most relevant columns | ||
name: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
# For now I only added the most relevant columns | ||
name: Mapped[str] = mapped_column(primary_key=True) | ||
uuid: Mapped[str] | ||
|
||
p_base: Mapped[str] | ||
p_count: Mapped[int] | ||
p_base: Mapped[str] | ||
p_count: Mapped[int] | ||
|
||
start_time: Mapped[str] | ||
start_time: Mapped[str] | ||
|
||
mo: Mapped[str] | ||
tu: Mapped[str] | ||
we: Mapped[str] | ||
th: Mapped[str] | ||
fr: Mapped[str] | ||
sa: Mapped[str] | ||
su: Mapped[str] | ||
mo: Mapped[str] | ||
tu: Mapped[str] | ||
we: Mapped[str] | ||
th: Mapped[str] | ||
fr: Mapped[str] | ||
sa: Mapped[str] | ||
su: Mapped[str] | ||
|
||
def __repr__(self): | ||
return f"""Schedule(name={self.name})""" | ||
def __repr__(self): | ||
return f"""Schedule(name={self.name})""" | ||
|
||
def __str__(self): | ||
return repr(self) | ||
def __str__(self): | ||
return repr(self) |
Oops, something went wrong.