Exemple #1
0
class ProductFileSerializer(ProductFileBaseSerializer):
    """Converts product file model fields to REST output"""
    from job.job_type_serializers import JobTypeBaseSerializerV6

    job_type = JobTypeBaseSerializerV6()
    batch = BatchBaseSerializerV6()
    recipe_type = RecipeTypeBaseSerializerV6()
Exemple #2
0
class QueueStatusSerializerV6(serializers.Serializer):
    """Converts queue status model fields to REST output"""
    from job.job_type_serializers import JobTypeBaseSerializerV6

    job_type = JobTypeBaseSerializerV6()
    count = serializers.IntegerField()
    longest_queued = serializers.DateTimeField()
    highest_priority = serializers.IntegerField()
Exemple #3
0
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()
Exemple #4
0
class ScaleFileSerializerV6(ScaleFileBaseSerializerV6):
    """Converts Scale file model fields to REST output"""
    from batch.serializers import BatchBaseSerializerV6
    from job.job_type_serializers import JobTypeBaseSerializerV6
    from recipe.serializers import RecipeTypeBaseSerializerV6

    workspace = WorkspaceBaseSerializer()
    data_type_tags = serializers.ListField(child=serializers.CharField())
    media_type = serializers.CharField()
    file_type = serializers.CharField()
    file_size = serializers.IntegerField()  # TODO: BigIntegerField?
    file_path = serializers.CharField()
    is_deleted = serializers.BooleanField()
    url = serializers.URLField()

    created = serializers.DateTimeField()
    deleted = serializers.DateTimeField()
    data_started = serializers.DateTimeField()
    data_ended = serializers.DateTimeField()
    source_started = serializers.DateTimeField()
    source_ended = serializers.DateTimeField()
    source_sensor_class = serializers.CharField()
    source_sensor = serializers.CharField()
    source_collection = serializers.CharField()
    source_task = serializers.CharField()
    last_modified = serializers.DateTimeField()
    # TODO: update to use GeoJson instead of WKT
    geometry = WktField()
    center_point = WktField()
    countries = serializers.StringRelatedField(many=True, read_only=True)

    job_type = JobTypeBaseSerializerV6()
    job = ModelIdSerializer()
    job_exe = ModelIdSerializer()
    job_output = serializers.CharField()

    recipe_type = RecipeTypeBaseSerializerV6()
    recipe = ModelIdSerializer()
    recipe_node = serializers.CharField()
    batch = BatchBaseSerializerV6()

    is_superseded = serializers.BooleanField()
    superseded = serializers.DateTimeField()
Exemple #5
0
class RecipeDetailsSerializerV6(RecipeSerializerV6):
    """Converts related recipe model fields to REST output."""
    from trigger.serializers import TriggerEventDetailsSerializerV6
    from ingest.ingest_event_serializers import IngestEventDetailsSerializerV6
    from job.job_type_serializers import JobTypeBaseSerializerV6

    recipe_type_rev = RecipeTypeRevisionDetailsSerializerV6()
    event = TriggerEventDetailsSerializerV6()
    ingest_event = IngestEventDetailsSerializerV6()

    superseded_recipe = RecipeBaseSerializerV6()
    superseded_by_recipe = RecipeBaseSerializerV6()

    input = serializers.JSONField(source='get_v6_input_data_json')

    details = serializers.JSONField(source='get_v6_recipe_instance_json')

    job_types = JobTypeBaseSerializerV6(many=True)
    sub_recipe_types = RecipeTypeBaseSerializerV6(many=True)
Exemple #6
0
class MetricsJobTypeDetailsSerializer(MetricsTypeDetailsSerializer):
    """Converts job type metrics details model fields to REST output"""
    from job.job_type_serializers import JobTypeBaseSerializerV6

    choices = JobTypeBaseSerializerV6(many=True)
Exemple #7
0
class JobBaseSerializerV6(ModelIdSerializer):
    """Converts job model fields to REST output."""
    job_type = JobTypeBaseSerializerV6()
    status = serializers.ChoiceField(choices=Job.JOB_STATUSES)