summaryrefslogtreecommitdiffstats
path: root/zte/vmanager
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-07 11:00:34 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-07 11:00:34 +0800
commit2efba777e1c1da2090b5cdb54ac5c604aaaedfdf (patch)
treee6700fbeca38e783e05d69f6eee6631b7e48f480 /zte/vmanager
parentac847137bc2a6ff4291378e93e70f80d1ef530a5 (diff)
Add vfc-ztevnfmdriver notify schema
Change-Id: I81ebe936e78bfce7c6f5d408d3f1a08f3a807fe2 Issue-ID: VFC-736 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'zte/vmanager')
-rw-r--r--zte/vmanager/driver/interfaces/serializers.py100
1 files changed, 89 insertions, 11 deletions
diff --git a/zte/vmanager/driver/interfaces/serializers.py b/zte/vmanager/driver/interfaces/serializers.py
index 1792c2cd..cbf841ff 100644
--- a/zte/vmanager/driver/interfaces/serializers.py
+++ b/zte/vmanager/driver/interfaces/serializers.py
@@ -15,20 +15,97 @@
from rest_framework import serializers
+class VMIDlistSerializer(serializers.Serializer):
+ VMID = serializers.CharField(
+ help_text="VMID",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ VMName = serializers.CharField(
+ help_text="VMName",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ vimid = serializers.CharField(
+ help_text="vimid",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ tenant = serializers.CharField(
+ help_text="tenant",
+ max_length=255,
+ required=False,
+ allow_null=True)
+
+
+class VmlistSerializer(serializers.Serializer):
+ VMNumber = serializers.CharField(
+ help_text="VMNumber",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ vdutype = serializers.CharField(
+ help_text="vdutype",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ VMFlavor = serializers.CharField(
+ help_text="VMFlavor",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ VMIDlist = VMIDlistSerializer(help_text='VMIDlist', required=False, many=True)
+
+
+class NotifyReqSerializer(serializers.Serializer):
+ nfvoid = serializers.CharField(
+ help_text="nfvoid",
+ max_length=255,
+ required=True,
+ allow_null=True)
+ vnfmid = serializers.CharField(
+ help_text="vnfmid",
+ max_length=255,
+ required=True,
+ allow_null=True)
+ vimid = serializers.CharField(
+ help_text="vimid",
+ max_length=255,
+ required=True,
+ allow_null=True)
+ timestamp = serializers.CharField(
+ help_text="timestamp",
+ max_length=255,
+ required=False,
+ allow_blank=True)
+ vnfinstanceid = serializers.CharField(
+ help_text="vnfinstanceid",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ eventtype = serializers.CharField(
+ help_text="eventtype",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ vmlist = VmlistSerializer(help_text='vmlist', required=False, many=True)
+
+
class ScaleReqSerializer(serializers.Serializer):
type = serializers.CharField(
help_text="type",
max_length=255,
- required=True, allow_blank=True)
+ required=True,
+ allow_null=True)
aspectId = serializers.CharField(
help_text="aspectId",
max_length=255,
required=True,
- allow_null=False)
+ allow_null=True)
numberOfSteps = serializers.CharField(
help_text="numberOfSteps",
max_length=255,
- required=False,
+ required=True,
allow_null=True)
additionalParam = serializers.DictField(
help_text="additionalParam",
@@ -41,26 +118,27 @@ class AffectedvmSerializer(serializers.Serializer):
extention = serializers.CharField(
help_text="extention",
max_length=255,
- required=True, allow_blank=True)
+ required=True,
+ allow_blank=True)
vmid = serializers.CharField(
help_text="vmid",
max_length=255,
required=True,
- allow_null=False)
+ allow_null=True)
changtype = serializers.CharField(
help_text="changtype",
max_length=255,
- required=False,
+ required=True,
allow_null=True)
vduid = serializers.CharField(
help_text="vduid",
max_length=255,
required=True,
- allow_null=False)
+ allow_null=True)
vmname = serializers.CharField(
help_text="vmname",
max_length=255,
- required=False,
+ required=True,
allow_null=True)
flavour = serializers.DictField(
help_text="flavour",
@@ -74,7 +152,7 @@ class HealReqSerializer(serializers.Serializer):
help_text="action",
max_length=255,
required=True,
- allow_null=True)
+ allow_null=False)
lifecycleoperation = serializers.CharField(
help_text="lifecycleoperation",
max_length=255,
@@ -85,7 +163,7 @@ class HealReqSerializer(serializers.Serializer):
max_length=255,
required=False,
allow_null=True)
- affectedvm = AffectedvmSerializer(help_text='affectedvm', many=True)
+ affectedvm = AffectedvmSerializer(help_text='affectedvm', required=True, many=True)
class InstScaleHealRespSerializer(serializers.Serializer):
@@ -98,4 +176,4 @@ class InstScaleHealRespSerializer(serializers.Serializer):
help_text="nfInstanceId",
max_length=255,
required=True,
- allow_null=False)
+ allow_null=True)