diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-02-01 09:56:17 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-02-01 09:56:17 +0800 |
commit | 9f680fa6e7e31e750d46ed0e645026427ec7bfad (patch) | |
tree | e1de9d2015de525e3eefb20a4361c29070a58961 | |
parent | 262a2b0a4167f9e0d11430d1c7f41a7f1d373626 (diff) |
Modify vfc-vnfmgr serializer file
Change-Id: Ic5856d81a4975c4a666259cbcf2b18e033ec428c
Issue-ID: VFC-670
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | mgr/mgr/vnfreg/serializers.py | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/mgr/mgr/vnfreg/serializers.py b/mgr/mgr/vnfreg/serializers.py index e49f7b4..84b1250 100644 --- a/mgr/mgr/vnfreg/serializers.py +++ b/mgr/mgr/vnfreg/serializers.py @@ -17,42 +17,77 @@ from rest_framework import serializers class VnfInfoSerializer(serializers.Serializer): vnfInstId = serializers.CharField( - help_text="the instance id of vnf", required=True) - ip = serializers.CharField(help_text="the ip of vnf", required=True) - port = serializers.CharField(help_text="the port of vnf", required=True) + help_text="the instance id of vnf", + required=True, + max_length=200, + allow_null=True) + ip = serializers.CharField( + help_text="the ip of vnf", + required=True, + max_length=200, + allow_null=True) + port = serializers.CharField( + help_text="the port of vnf", + required=True, + max_length=200, + allow_null=True) username = serializers.CharField( - help_text="the username of vnf", required=True) + help_text="the username of vnf", + required=True, + max_length=255, + allow_null=True) password = serializers.CharField( - help_text="the password of vnf", required=True) + help_text="the password of vnf", + required=True, + max_length=255, + allow_null=True) class ResponseSerializer(serializers.Serializer): vnfInstId = serializers.CharField( - help_text="the instance id of vnf", required=True) + help_text="the instance id of vnf", + required=True, + max_length=200, + allow_null=False) class CpSerializer(serializers.Serializer): - cpId = serializers.CharField(help_text="the cps id of vnf", required=True) + cpId = serializers.CharField( + help_text="the cps id of vnf", + required=True, + max_length=200, + allow_null=True) cpdId = serializers.CharField( help_text="the cpds id of vnf", - required=True) + required=True, max_length=200, allow_null=True) class SpecificDataSerializer(serializers.Serializer): autoScalable = serializers.CharField( - help_text="the autoScalable of vnf", required=True) + help_text="the autoScalable of vnf", + required=True, + max_length=200, + allow_null=True) autoHealable = serializers.CharField( - help_text="the autoHealable of vnf", required=True) + help_text="the autoHealable of vnf", + required=True, + max_length=200, + allow_null=True) class ConfigDataSerializer(serializers.Serializer): - cp = CpSerializer(help_text="the cps of vnf", many=True) + cp = CpSerializer(help_text="the cps of vnf", many=True, allow_null=True) vnfSpecificData = SpecificDataSerializer( - help_text="the vnfSpecificData of vnf", required=True) + help_text="the vnfSpecificData of vnf", required=True, allow_null=True) class VnfConfigSerializer(serializers.Serializer): vnfInstanceId = serializers.CharField( - help_text="the instance id of vnf", required=True) + help_text="the instance id of vnf", + required=True, + max_length=200, + allow_null=True) vnfConfigurationData = ConfigDataSerializer( - help_text="the ConfigDataSerializer of vnf", required=True) + help_text="the ConfigDataSerializer of vnf", + required=True, + allow_null=True) |