class JobSerializerV5(JobBaseSerializerV5): """Converts job model fields to REST output.""" from error.serializers import ErrorBaseSerializerV5 from trigger.serializers import TriggerEventBaseSerializerV5 job_type_rev = JobTypeRevisionBaseSerializer() event = TriggerEventBaseSerializerV5() node = NodeBaseSerializer() error = ErrorBaseSerializerV5() timeout = serializers.IntegerField() max_tries = serializers.IntegerField() cpus_required = '' mem_required = '' disk_out_required = '' disk_in_required = serializers.FloatField(source='input_file_size') is_superseded = serializers.BooleanField() root_superseded_job = ModelIdSerializer() superseded_job = ModelIdSerializer() superseded_by_job = ModelIdSerializer() delete_superseded = serializers.BooleanField() created = serializers.DateTimeField() queued = serializers.DateTimeField() started = serializers.DateTimeField() ended = serializers.DateTimeField() last_status_change = serializers.DateTimeField() superseded = serializers.DateTimeField() last_modified = serializers.DateTimeField()
class JobSerializerV6(JobBaseSerializerV6): """Converts job model fields to REST output.""" from batch.serializers import BatchBaseSerializerV6 from error.serializers import ErrorBaseSerializerV6 from recipe.serializers import RecipeBaseSerializerV6 from trigger.serializers import TriggerEventSerializerV6 job_type_rev = JobTypeRevisionBaseSerializer() event = TriggerEventSerializerV6() recipe = RecipeBaseSerializerV6() batch = BatchBaseSerializerV6() is_superseded = serializers.BooleanField() superseded_job = ModelIdSerializer() status = serializers.ChoiceField(choices=Job.JOB_STATUSES) node = NodeBaseSerializer() error = ErrorBaseSerializerV6() num_exes = serializers.IntegerField() input_file_size = serializers.FloatField() source_started = serializers.DateTimeField() source_ended = serializers.DateTimeField() created = serializers.DateTimeField() queued = serializers.DateTimeField() started = serializers.DateTimeField() ended = serializers.DateTimeField() last_status_change = serializers.DateTimeField() superseded = serializers.DateTimeField() last_modified = serializers.DateTimeField()
class JobExecutionSerializer(JobExecutionBaseSerializer): """Converts job execution model fields to REST output""" from error.serializers import ErrorBaseSerializer from node.serializers import NodeBaseSerializer job = JobBaseSerializer() node = NodeBaseSerializer() error = ErrorBaseSerializer()
class JobExecutionSerializerV6(JobExecutionBaseSerializerV6): """Converts job execution model fields to REST output""" from error.serializers import ErrorBaseSerializerV6 from node.serializers import NodeBaseSerializer job = ModelIdSerializer() node = NodeBaseSerializer() error = ErrorBaseSerializerV6(source='jobexecutionend.error') job_type = JobTypeBaseSerializerV6() timeout = serializers.IntegerField() input_file_size = serializers.FloatField()