summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-01-31 10:11:09 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-01-31 10:11:09 +0800
commit28e962f0fd3a2c3c153514575191e83f954d3136 (patch)
treef6aec2c7b5bc54bae8b3b37d20896aa503a7a36c /res
parent6bc9c5093a1ceb3c395a58723bc017be4d5385f9 (diff)
Update vfc-vnfres serializer file
Change-Id: I65bedb2141b5a7f9edb912ac806623cba1980123 Issue-ID: VFC-679 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'res')
-rw-r--r--res/res/resources/serializers.py57
1 files changed, 39 insertions, 18 deletions
diff --git a/res/res/resources/serializers.py b/res/res/resources/serializers.py
index 9b9d535..4897fa1 100644
--- a/res/res/resources/serializers.py
+++ b/res/res/resources/serializers.py
@@ -16,57 +16,78 @@ from rest_framework import serializers
class ResourceSerializer(serializers.Serializer):
- resourceId = serializers.CharField(help_text="resourceId", required=True)
- vimId = serializers.CharField(help_text="vimId", required=True)
+ resourceId = serializers.CharField(
+ help_text="resourceId",
+ required=True,
+ allow_null=True)
+ vimId = serializers.CharField(
+ help_text="vimId",
+ required=True,
+ allow_null=True)
class VirtualStorageResourceInfoSerializer(serializers.Serializer):
virtualStorageInstanceId = serializers.CharField(
- help_text="virtualStorageInstanceId", required=True)
+ help_text="virtualStorageInstanceId", required=False, allow_null=True)
virtualStorageDescId = serializers.CharField(
- help_text="virtualStorageDescId", required=True, allow_null=True)
+ help_text="virtualStorageDescId", required=False, allow_null=True)
storageResource = ResourceSerializer(
- help_text="storageResource", required=True)
+ help_text="storageResource", required=False, allow_null=True)
class VirtualLinkResourceInfoSerializer(serializers.Serializer):
virtualLinkInstanceId = serializers.IntegerField(
- help_text="virtualLinkInstanceId", required=True, allow_null=True)
+ help_text="virtualLinkInstanceId", required=False, allow_null=True)
virtualLinkDescId = serializers.IntegerField(
- help_text="virtualLinkDescId", required=True, allow_null=True)
+ help_text="virtualLinkDescId", required=False, allow_null=True)
networkResource = ResourceSerializer(
help_text="networkResource",
- required=True,
+ required=False,
allow_null=True)
class VnfcResourceInfoSerializer(serializers.Serializer):
vnfcInstanceId = serializers.IntegerField(
- help_text="vnfcInstanceId", required=True, allow_null=True)
+ help_text="vnfcInstanceId", required=False, allow_null=True)
vduId = serializers.IntegerField(
help_text="vduId",
- required=True,
+ required=False,
allow_null=True)
storageResourceIds = serializers.IntegerField(
- help_text="storageResourceIds", required=True, allow_null=True)
+ help_text="storageResourceIds", required=False, allow_null=True)
computeResource = ResourceSerializer(
help_text="computeResource",
- required=True,
+ required=False,
allow_null=True)
class AccessInfoSerializer(serializers.Serializer):
- tenant = serializers.CharField(help_text="tenant", required=True)
- username = serializers.CharField(help_text="username", required=True)
- password = serializers.CharField(help_text="password", required=True)
+ tenant = serializers.CharField(
+ help_text="tenant",
+ required=False,
+ allow_null=True)
+ username = serializers.CharField(
+ help_text="username",
+ required=False,
+ allow_null=True)
+ password = serializers.CharField(
+ help_text="password",
+ required=False,
+ allow_null=True)
class InterfaceInfoSerializer(serializers.Serializer):
- vimType = serializers.CharField(help_text="vimType", required=True)
- apiVersion = serializers.CharField(help_text="apiVersion", required=True)
+ vimType = serializers.CharField(
+ help_text="vimType",
+ required=False,
+ allow_null=True)
+ apiVersion = serializers.CharField(
+ help_text="apiVersion",
+ required=False,
+ allow_null=True)
protocolType = serializers.ChoiceField(
help_text="protocolType", choices=[
- 'http', 'https'], required=True)
+ 'http', 'https'], required=False, allow_null=True)
class VmResponseSerializer(serializers.Serializer):