class WorkerEntry(Base, JsonSerializableMixin): key = StringField() # not required due to migration issues id = StringField(required=True) user = EmbeddedField(IdNameEntry) company = EmbeddedField(IdNameEntry) ip = StringField() task = EmbeddedField(IdNameEntry) queue = StringField() # queue from which current task was taken queues = ListField(str) # list of queues this worker listens to register_time = DateTimeField(required=True) register_timeout = IntField(required=True) last_activity_time = DateTimeField(required=True) last_report_time = DateTimeField()
class ScalarMetricsIterRawRequest(TaskEventsRequestBase): batch_size: int = IntField() key: ScalarKeyEnum = ActualEnumField(ScalarKeyEnum, default=ScalarKeyEnum.iter) metric: MetricVariants = EmbeddedField(MetricVariants, required=True) count_total: bool = BoolField(default=False) scroll_id: str = StringField()
class Pet(models.Base): id = IntField() category = EmbeddedField(Category) name = StringField() photo_urls = ListField(str) tags = ListField(Tag) status = StringField()
class StatusReportRequest(WorkerRequest): task = StringField() # task the worker is running on queue = StringField() # queue from which task was taken queues = ListField( str ) # list of queues this worker listens to. if None, this will not update the worker's queues list. timestamp = IntField(required=True) machine_stats = EmbeddedField(MachineStats)
class Artifact(models.Base): key = StringField(required=True) type = StringField(required=True) mode = StringField(validators=Enum("input", "output"), default="output") uri = StringField() hash = StringField() content_size = IntField() timestamp = IntField() type_data = EmbeddedField(ArtifactTypeData) display_data = ListField([list])
class Artifact(models.Base): key = StringField(required=True) type = StringField(required=True) mode = StringField(validators=Enum(*get_options(ArtifactModes)), default=DEFAULT_ARTIFACT_MODE) uri = StringField() hash = StringField() content_size = IntField() timestamp = IntField() type_data = EmbeddedField(ArtifactTypeData) display_data = ListField([list])
class WorkerEntry(Base): key = StringField() # not required due to migration issues id = StringField(required=True) user = EmbeddedField(IdNameEntry) company = EmbeddedField(IdNameEntry) ip = StringField() task = EmbeddedField(IdNameEntry) queue = StringField() # queue from which current task was taken queues = ListField(str) # list of queues this worker listens to register_time = DateTimeField(required=True) register_timeout = IntField(required=True) last_activity_time = DateTimeField(required=True) last_report_time = DateTimeField() def to_json(self): return json.dumps(self.to_struct()) @classmethod def from_json(cls, s): return cls(**json.loads(s))
class WorkerResponseEntry(WorkerEntry): task = EmbeddedField(CurrentTaskEntry) queue = EmbeddedField(QueueEntry) queues = ListField(QueueEntry)
class QueueEntry(IdNameEntry): next_task = EmbeddedField(IdNameEntry) num_tasks = IntField()
class GetActivityReportResponse(Base): total = EmbeddedField(ActivityReportSeries) active = EmbeddedField(ActivityReportSeries)
class CreateCredentialsResponse(Base): credentials = EmbeddedField(Credentials)
class GetSupportedModesResponse(Base): basic = EmbeddedField(BasicMode) server_errors = EmbeddedField(ServerErrors) sso = DictField([str, type(None)]) sso_providers = ListField([dict])
class NullableEmbedded(Base): field = EmbeddedField(Nullable, nullable=True)