summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-01-29 13:16:19 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-01-29 13:16:19 +0800
commitd6f8f0f2835b5634f5509a1f011690cb1fcfd636 (patch)
treeac4e08d95559f800a14b05654622c7d6c2550e7e
parent91d7eefc6012ce29142f1f86588f17f84012f8c4 (diff)
Add vfc-vnfres Vm schema
Change-Id: I1d9f22ac47f68ebc7bc977d29fd244af7a77cf6b Issue-ID: VFC-679 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--res/res/resources/serializers.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/res/res/resources/serializers.py b/res/res/resources/serializers.py
index 9f3c8bb..ab3074b 100644
--- a/res/res/resources/serializers.py
+++ b/res/res/resources/serializers.py
@@ -15,6 +15,29 @@
from rest_framework import serializers
+class VmResponseSerializer(serializers.Serializer):
+ vmid = serializers.CharField(help_text="vmid", required=True)
+ vimid = serializers.CharField(help_text="the vim id", required=True)
+ resouceid = serializers.CharField(help_text="the resouce id", required=True)
+ tenant = serializers.IntegerField(help_text="tenant", required=True, allow_null=True)
+ instid = serializers.CharField(help_text="the inst id", required=True)
+ vmname = serializers.CharField(help_text="vmname", required=True)
+ insttype = serializers.IntegerField(help_text="insttype", required=True)
+ operationalstate = serializers.CharField(help_text="operationalstate", required=True, allow_null=True)
+ is_predefined = serializers.IntegerField(help_text="is_predefined", required=True)
+ security_groups = serializers.CharField(help_text="security_groups", required=True)
+ flavor_id = serializers.CharField(help_text="flavor_id", required=True)
+ availability_zone = serializers.CharField(help_text="availability_zone", required=True)
+ server_group = serializers.CharField(help_text="server_group", required=True)
+ volume_array = serializers.CharField(help_text="volume_array", required=True)
+ metadata = serializers.CharField(help_text="metadata", required=True)
+ nic_array = serializers.CharField(help_text="nic_array", required=True)
+
+
+class VmInfoSerializer(serializers.Serializer):
+ resp_data = VmResponseSerializer(help_text="the response data", many=True)
+
+
class FlavorResponseSerializer(serializers.Serializer):
flavourid = serializers.CharField(help_text="flavourid", required=True)
vimid = serializers.CharField(help_text="the vim id", required=True)