From 9df5be00e5a73a26ab7eef8c8a4d81acd2629bb6 Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Thu, 8 Feb 2018 09:11:44 +0800 Subject: Add vfc-ztevnfmdriver job schema Change-Id: I7dbff3d6dbc81dce9cebc8f6930fda92b8d4e99d Issue-ID: VFC-736 Signed-off-by: ying.yunlong --- zte/vmanager/driver/interfaces/serializers.py | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'zte/vmanager') diff --git a/zte/vmanager/driver/interfaces/serializers.py b/zte/vmanager/driver/interfaces/serializers.py index e79ef983..f024d224 100644 --- a/zte/vmanager/driver/interfaces/serializers.py +++ b/zte/vmanager/driver/interfaces/serializers.py @@ -15,6 +15,65 @@ from rest_framework import serializers +class JobHistorySerializer(serializers.Serializer): + status = serializers.CharField( + help_text="Status of job", + required=True, + allow_null=False) + progress = serializers.CharField( + help_text="Progress of job", + required=True, + allow_null=False) + statusDescription = serializers.CharField( + help_text="Description of job", + required=False, + allow_null=True) + errorCode = serializers.CharField( + help_text="Error code of job", + required=False, + allow_null=True) + responseId = serializers.CharField( + help_text="Response index of job", + required=True, + allow_null=False) + + +class JobDescriptorSerializer(serializers.Serializer): + status = serializers.CharField( + help_text="Status of job", + required=True, + allow_null=False) + progress = serializers.CharField( + help_text="Progress of job", + required=True, + allow_null=False) + statusDescription = serializers.CharField( + help_text="Description of job", + required=False, + allow_null=True) + errorCode = serializers.CharField( + help_text="Error code of job", + required=False, + allow_null=True) + responseId = serializers.CharField( + help_text="Response index of job", + required=True, + allow_null=False) + responseHistoryList = JobHistorySerializer( + help_text="History of job", + many=True) + + +class JobQueryRespSerializer(serializers.Serializer): + jobId = serializers.CharField( + help_text="UUID of job", + required=True, + allow_null=False) + responseDescriptor = JobDescriptorSerializer( + help_text="Descriptor of job", + required=False) + + class GrantVmlistSerializer(serializers.Serializer): VMNumber = serializers.CharField( help_text="VMNumber", -- cgit 1.2.3-korg