summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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",