コード例 #1
0
ファイル: serializers.py プロジェクト: mnjstwins/scale
class JobSerializer(JobBaseSerializer):
    """Converts job model fields to REST output."""
    from error.serializers import ErrorBaseSerializer
    from trigger.serializers import TriggerEventBaseSerializer

    job_type_rev = JobTypeRevisionBaseSerializer()
    event = TriggerEventBaseSerializer()
    error = ErrorBaseSerializer()

    timeout = serializers.IntegerField()
    max_tries = serializers.IntegerField()

    cpus_required = serializers.FloatField()
    mem_required = serializers.FloatField()
    disk_in_required = serializers.FloatField()
    disk_out_required = serializers.FloatField()

    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()
コード例 #2
0
class JobSerializerV6(JobBaseSerializerV6):
    """Converts job model fields to REST output."""
    from error.serializers import ErrorBaseSerializer
    from trigger.serializers import TriggerEventBaseSerializer

    job_type_rev = JobTypeRevisionBaseSerializer()
    event = TriggerEventBaseSerializer()
    node = NodeBaseSerializer()
    error = ErrorBaseSerializer()
    resources = serializers.JSONField(source='get_resources_dict')

    timeout = serializers.IntegerField()
    max_tries = serializers.IntegerField()

    input_file_size = serializers.FloatField()

    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()
コード例 #3
0
ファイル: serializers.py プロジェクト: mnjstwins/scale
class JobExecutionSerializer(JobExecutionBaseSerializer):
    """Converts job execution model fields to REST output"""
    from error.serializers import ErrorBaseSerializer
    from node.serializers import NodeBaseSerializerV4

    job = JobBaseSerializer()
    node = NodeBaseSerializerV4()
    error = ErrorBaseSerializer()
コード例 #4
0
class JobExecutionSerializerV6(JobExecutionBaseSerializerV6):
    """Converts job execution model fields to REST output"""

    from error.serializers import ErrorBaseSerializer
    from node.serializers import NodeBaseSerializer

    job = ModelIdSerializer()
    node = NodeBaseSerializer()
    error = ErrorBaseSerializer(source='jobexecutionend.error')
    job_type = JobTypeBaseSerializerV6()

    timeout = serializers.IntegerField()
    input_file_size = serializers.FloatField()
コード例 #5
0
ファイル: serializers.py プロジェクト: wong-j/scale
class MetricsErrorDetailsSerializer(MetricsTypeDetailsSerializer):
    """Converts ingest metrics details model fields to REST output"""
    from error.serializers import ErrorBaseSerializer

    choices = ErrorBaseSerializer(many=True)