Example #1
0
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()
Example #2
0
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()
Example #3
0
class Pet(models.Base):
    id = IntField()
    category = EmbeddedField(Category)
    name = StringField()
    photo_urls = ListField(str)
    tags = ListField(Tag)
    status = StringField()
Example #4
0
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)
Example #5
0
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])
Example #6
0
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])
Example #7
0
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))
Example #8
0
class WorkerResponseEntry(WorkerEntry):
    task = EmbeddedField(CurrentTaskEntry)
    queue = EmbeddedField(QueueEntry)
    queues = ListField(QueueEntry)
Example #9
0
class QueueEntry(IdNameEntry):
    next_task = EmbeddedField(IdNameEntry)
    num_tasks = IntField()
Example #10
0
class GetActivityReportResponse(Base):
    total = EmbeddedField(ActivityReportSeries)
    active = EmbeddedField(ActivityReportSeries)
Example #11
0
class CreateCredentialsResponse(Base):
    credentials = EmbeddedField(Credentials)
Example #12
0
class GetSupportedModesResponse(Base):
    basic = EmbeddedField(BasicMode)
    server_errors = EmbeddedField(ServerErrors)
    sso = DictField([str, type(None)])
    sso_providers = ListField([dict])
Example #13
0
class NullableEmbedded(Base):
    field = EmbeddedField(Nullable, nullable=True)