summaryrefslogtreecommitdiffstats
path: root/zte
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-08 09:11:44 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-08 09:11:44 +0800
commit9df5be00e5a73a26ab7eef8c8a4d81acd2629bb6 (patch)
treeb84d88bb6933b4728b6c6529ac8c19d7b3b42fa5 /zte
parent2f7b29e8c2e5714a9572edfcde4248b584301f96 (diff)
Add vfc-ztevnfmdriver job schema
Change-Id: I7dbff3d6dbc81dce9cebc8f6930fda92b8d4e99d Issue-ID: VFC-736 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'zte')
-rw-r--r--zte/vmanager/driver/interfaces/serializers.py59
1 files changed, 59 insertions, 0 deletions
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",