summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-01-25 09:41:06 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-01-25 09:41:06 +0800
commitd399489b17591260c77b128b5aac4a9578466a09 (patch)
tree05ac9d2f089680fba8f7d4e2bafabe7b6e7a1168
parent1f3ae91a97e741c2e1ec51bf4532b4db8a1f23f3 (diff)
Add vfc-vnfres cps schema
Change-Id: I49f78a9eedfcfec25952cf4b8a95744cca657eb7 Issue-ID: VFC-679 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--res/res/resources/serializers.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/res/res/resources/serializers.py b/res/res/resources/serializers.py
index 4d8229f..774d62c 100644
--- a/res/res/resources/serializers.py
+++ b/res/res/resources/serializers.py
@@ -19,6 +19,42 @@ class NoneSerializer(serializers.Serializer):
pass
+# {
+# "resp_data": [{
+# "cpinstanceid": "cp0",
+# "cpdid": "cpd0",
+# "cpinstancename": "cpinstname0",
+# "vlinstanceid": "vlinst0",
+# "ownertype": 0,
+# "ownerid": "01",
+# "relatedtype": 0
+# }]
+# }
+class CpsResponseSerializer(serializers.Serializer):
+ cpinstanceid = serializers.CharField(help_text="the cp instance id", required=True)
+ cpdid = serializers.CharField(help_text="the cpd id", required=True)
+ cpinstancename = serializers.CharField(help_text="the cp instance name of vnf", required=True)
+ vlinstanceid = serializers.CharField(help_text="the vl instance id of vnf", required=True)
+ ownertype = serializers.IntegerField(help_text="the owner type of vnf", required=True)
+ ownerid = serializers.CharField(help_text="the owner id of vnf", required=True)
+ relatedtype = serializers.IntegerField(help_text="the related type", required=True)
+
+
+class CpsInfoSerializer(serializers.Serializer):
+ resp_data = CpsResponseSerializer(help_text="the response data", many=True)
+
+
+# {
+# "resp_data": [{
+# "storageid": "st0",
+# "vimid": "vim0",
+# "resouceid": "res0",
+# "insttype": 0,
+# "instid": "01",
+# "storagetype": "stype0",
+# "size": "0"
+# }]
+# }
class VolumeResponseSerializer(serializers.Serializer):
storageid = serializers.CharField(help_text="the storage id", required=True)
vimid = serializers.CharField(help_text="the vim id", required=True)