Пример #1
0
class RecipeTypeDetailsSerializer(RecipeTypeSerializer):
    """Converts recipe type model fields to REST output."""
    from job.serializers import JobTypeBaseSerializer
    from trigger.serializers import TriggerRuleDetailsSerializer

    class RecipeTypeDetailsJobSerializer(JobTypeBaseSerializer):
        interface = serializers.JSONField()

    trigger_rule = TriggerRuleDetailsSerializer()
    job_types = RecipeTypeDetailsJobSerializer(many=True)
Пример #2
0
class RecipeTypeDetailsSerializerV5(RecipeTypeSerializerV5):
    """Converts recipe type model fields to REST output."""
    from job.job_type_serializers import JobTypeBaseSerializerV5
    from trigger.serializers import TriggerRuleDetailsSerializer

    class RecipeTypeDetailsJobSerializer(JobTypeBaseSerializerV5):
        interface = serializers.JSONField(default=dict, source='manifest')

    trigger_rule = TriggerRuleDetailsSerializer()
    job_types = RecipeTypeDetailsJobSerializer(many=True)
Пример #3
0
class JobTypeDetailsSerializer(JobTypeSerializer):
    """Converts job type model fields to REST output."""
    from error.serializers import ErrorSerializer
    from trigger.serializers import TriggerRuleDetailsSerializer

    interface = serializers.JSONField(default=dict)
    error_mapping = serializers.JSONField(default=dict)
    errors = ErrorSerializer(many=True)
    trigger_rule = TriggerRuleDetailsSerializer()

    job_counts_6h = JobTypeStatusCountsSerializer(many=True)
    job_counts_12h = JobTypeStatusCountsSerializer(many=True)
    job_counts_24h = JobTypeStatusCountsSerializer(many=True)
Пример #4
0
class JobTypeDetailsSerializerV5(JobTypeSerializerV5):
    """Converts job type model fields to REST output for legacy job types."""
    from error.serializers import ErrorSerializerV5
    from trigger.serializers import TriggerRuleDetailsSerializer

    interface = serializers.JSONField(default=dict, source='manifest')

    configuration = serializers.JSONField(default=dict)
    custom_resources = serializers.JSONField(source='convert_custom_resources')
    error_mapping = serializers.JSONField(default=dict)
    errors = ErrorSerializerV5(many=True)
    trigger_rule = TriggerRuleDetailsSerializer()

    job_counts_6h = JobTypeStatusCountsSerializer(many=True)
    job_counts_12h = JobTypeStatusCountsSerializer(many=True)
    job_counts_24h = JobTypeStatusCountsSerializer(many=True)