From e9ffe8dc80c90e79938a0a095f6dfa766873b9d8 Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Fri, 9 Feb 2018 15:56:27 +0800 Subject: Modify vfc-vnfres swagger schemas Change-Id: I539d7c80d16c4923709bad6438ec363f78bd0e16 Issue-ID: VFC-679 Signed-off-by: ying.yunlong --- res/res/resources/serializers.py | 263 ++++++++++++++++++++++++++++----------- 1 file changed, 190 insertions(+), 73 deletions(-) (limited to 'res') diff --git a/res/res/resources/serializers.py b/res/res/resources/serializers.py index 893c7b8..92f83e9 100644 --- a/res/res/resources/serializers.py +++ b/res/res/resources/serializers.py @@ -40,7 +40,9 @@ class VirtualStorageResourceInfoSerializer(serializers.Serializer): max_length=255, allow_null=True) storageResource = ResourceSerializer( - help_text="storageResource", required=False, allow_null=True) + help_text="storageResource", + required=False, + allow_null=True) class VirtualLinkResourceInfoSerializer(serializers.Serializer): @@ -68,7 +70,9 @@ class VnfcResourceInfoSerializer(serializers.Serializer): allow_null=True) vduId = serializers.CharField( help_text="vduId", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) storageResourceIds = serializers.CharField( help_text="storageResourceIds", required=False, @@ -83,55 +87,83 @@ class VnfcResourceInfoSerializer(serializers.Serializer): class AccessInfoSerializer(serializers.Serializer): tenant = serializers.CharField( help_text="tenant", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) username = serializers.CharField( help_text="username", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) password = serializers.CharField( help_text="password", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) class InterfaceInfoSerializer(serializers.Serializer): vimType = serializers.CharField( help_text="vimType", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) apiVersion = serializers.CharField( help_text="apiVersion", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) protocolType = serializers.ChoiceField( - help_text="protocolType", choices=[ - 'http', 'https'], required=False, allow_null=True) + help_text="protocolType", + choices=['http', 'https'], + required=False, + allow_null=True) class VmResponseSerializer(serializers.Serializer): vmid = serializers.CharField( help_text="vmid", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) vimid = serializers.CharField( help_text="vimid", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) resouceid = serializers.CharField( help_text="resouceid", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) tenant = serializers.CharField( help_text="tenant", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) instid = serializers.CharField( help_text="instid", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) vmname = serializers.CharField( help_text="vmname", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) insttype = serializers.IntegerField( - help_text="insttype", required=True, allow_null=True) + help_text="insttype", + required=True, + allow_null=True) operationalstate = serializers.CharField( help_text="operationalstate", required=True, max_length=255, allow_null=True) is_predefined = serializers.IntegerField( - help_text="is_predefined", required=True, allow_null=True) + help_text="is_predefined", + required=True, + allow_null=True) security_groups = serializers.CharField( help_text="security_groups", required=True, @@ -139,7 +171,9 @@ class VmResponseSerializer(serializers.Serializer): allow_null=True) flavor_id = serializers.CharField( help_text="flavor_id", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) availability_zone = serializers.CharField( help_text="availability_zone", required=True, @@ -147,38 +181,56 @@ class VmResponseSerializer(serializers.Serializer): allow_null=True) server_group = serializers.CharField( help_text="server_group", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) volume_array = serializers.CharField( help_text="volume_array", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) metadata = serializers.CharField( help_text="metadata", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) nic_array = serializers.CharField( help_text="nic_array", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) create_time = serializers.CharField( help_text="create_time", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) nodeId = serializers.CharField( help_text="nodeId", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) class VimInfoSerializer(serializers.Serializer): vimInfoId = serializers.CharField( help_text="vimInfoId", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) vimId = serializers.CharField( help_text="vimId", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) interfaceEndpoint = serializers.CharField( help_text="interfaceEndpoint", required=False, max_length=255, allow_null=True) interfaceInfo = InterfaceInfoSerializer( - help_text="vimInfoId", required=False, allow_null=True) + help_text="vimInfoId", + required=False, + allow_null=True) accessInfo = AccessInfoSerializer( help_text="accessInfo", required=False, @@ -223,15 +275,19 @@ class ExtVirtualLinkInfoSerializer(serializers.Serializer): max_length=255, allow_null=True) resourceHandle = ResourceHandleSerializer( - help_text="iPAddress", required=True) + help_text="iPAddress", + required=True) linkPorts = LinkPortsSerializer( - help_text="iPAddress", many=True, allow_null=True) + help_text="iPAddress", + many=True, + allow_null=True) class L3AddressDataSerializer(serializers.Serializer): iPAddressType = serializers.ChoiceField( - help_text="iPAddressType", choices=[ - 'IPv4', 'IPv6'], required=True) + help_text="iPAddressType", + choices=['IPv4', 'IPv6'], + required=True) iPAddress = serializers.CharField( help_text="iPAddress", required=True, @@ -241,48 +297,60 @@ class L3AddressDataSerializer(serializers.Serializer): class NetworkAddressSerializer(serializers.Serializer): addressType = serializers.ChoiceField( - help_text="addressType", choices=[ - 'MAC', 'IP'], required=True) + help_text="addressType", + choices=['MAC', 'IP'], + required=True) l2AddressData = serializers.CharField( help_text="l2AddressData", required=False, max_length=255, allow_null=True) l3AddressData = L3AddressDataSerializer( - help_text="addresses", required=False) + help_text="addresses", + required=False) class ExtCpInfoSerializer(serializers.Serializer): cpInstanceId = serializers.CharField( help_text="cpInstanceId", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) cpdId = serializers.IntegerField( help_text="cpdId", required=True, allow_null=True) numDynamicAddresses = serializers.IntegerField( - help_text="numDynamicAddresses", required=False, allow_null=True) + help_text="numDynamicAddresses", + required=False, + allow_null=True) addresses = NetworkAddressSerializer( - help_text="addresses", many=True, allow_null=True) + help_text="addresses", + many=True, + allow_null=True) class ScaleInfoSerializer(serializers.Serializer): aspectId = serializers.CharField( help_text="aspectId", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) scaleLevel = serializers.IntegerField( - help_text="scaleLevel", required=True, allow_null=True) + help_text="scaleLevel", + required=True, + allow_null=True) class InstantiatedVnfInfoSerializer(serializers.Serializer): flavourId = serializers.CharField( help_text="flavourId", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) vnfState = serializers.ChoiceField( help_text="vnfState", - choices=[ - 'STARTED', - 'STOPPED'], + choices=['STARTED', 'STOPPED'], required=True, allow_null=True) localizationLanguage = serializers.CharField( @@ -290,13 +358,20 @@ class InstantiatedVnfInfoSerializer(serializers.Serializer): required=True, max_length=255, allow_null=True) - scaleStatus = ScaleInfoSerializer(help_text="scaleStatus", many=True) - extCpInfo = ExtCpInfoSerializer(help_text="extCpInfo", many=True) + scaleStatus = ScaleInfoSerializer( + help_text="scaleStatus", + many=True) + extCpInfo = ExtCpInfoSerializer( + help_text="extCpInfo", + many=True) extVirtualLink = ExtVirtualLinkInfoSerializer( - help_text="extVirtualLink", many=True) + help_text="extVirtualLink", + many=True) monitoringParameters = serializers.DictField( - help_text="monitoringParameters", child=serializers.CharField( - allow_blank=True), required=False, allow_null=True) + help_text="monitoringParameters", + child=serializers.CharField(allow_blank=True), + required=False, + allow_null=True) vmInfo = VmResponseSerializer( help_text="vmInfo", many=True, @@ -307,11 +382,14 @@ class InstantiatedVnfInfoSerializer(serializers.Serializer): required=False, allow_null=True) vnfcResourceInfo = VnfcResourceInfoSerializer( - help_text="vnfcResourceInfo", many=True) + help_text="vnfcResourceInfo", + many=True) virtualLinkResourceInfo = VirtualLinkResourceInfoSerializer( - help_text="virtualLinkResourceInfo", many=True) + help_text="virtualLinkResourceInfo", + many=True) virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer( - help_text="virtualStorageResourceInfo", many=True) + help_text="virtualStorageResourceInfo", + many=True) class VnfInfoSerializer(serializers.Serializer): @@ -337,10 +415,14 @@ class VnfInfoSerializer(serializers.Serializer): allow_null=True) vnfdId = serializers.CharField( help_text="vnfdId", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) vnfdVersion = serializers.CharField( help_text="vnfdVersion", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) vnfSoftwareVersion = serializers.CharField( help_text="vnfSoftwareVersion", required=True, @@ -348,7 +430,9 @@ class VnfInfoSerializer(serializers.Serializer): allow_null=True) vnfProvider = serializers.CharField( help_text="vnfProvider", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) vnfProductName = serializers.CharField( help_text="vnfProductName", required=False, @@ -366,20 +450,29 @@ class VnfInfoSerializer(serializers.Serializer): allow_null=True) extensions = serializers.CharField( help_text="extensions", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) metadata = serializers.CharField( help_text="metadata", - required=False, max_length=255, allow_null=True) + required=False, + max_length=255, + allow_null=True) instantiatedVnfInfo = InstantiatedVnfInfoSerializer( - help_text="instantiatedVnfInfo", required=True) + help_text="instantiatedVnfInfo", + required=True) class VnfsInfoSerializer(serializers.Serializer): - resp_data = VnfInfoSerializer(help_text="the response data", many=True) + resp_data = VnfInfoSerializer( + help_text="the response data", + many=True) class VmInfoSerializer(serializers.Serializer): - resp_data = VmResponseSerializer(help_text="the response data", many=True) + resp_data = VmResponseSerializer( + help_text="the response data", + many=True) class FlavorResponseSerializer(serializers.Serializer): @@ -400,7 +493,9 @@ class FlavorResponseSerializer(serializers.Serializer): allow_null=True) tenant = serializers.CharField( help_text="tenant", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) instid = serializers.CharField( help_text="instid", required=True, @@ -418,9 +513,13 @@ class FlavorResponseSerializer(serializers.Serializer): allow_null=True) create_time = serializers.CharField( help_text="create_time", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) memory = serializers.IntegerField( - help_text="memory", required=True, allow_null=True) + help_text="memory", + required=True, + allow_null=True) vcpu = serializers.IntegerField( help_text="vcpu", required=True, @@ -429,7 +528,8 @@ class FlavorResponseSerializer(serializers.Serializer): class FlavorInfoSerializer(serializers.Serializer): resp_data = FlavorResponseSerializer( - help_text="the response data", many=True) + help_text="the response data", + many=True) class NetworkResponseSerializer(serializers.Serializer): @@ -449,7 +549,9 @@ class NetworkResponseSerializer(serializers.Serializer): max_length=255, allow_null=True) insttype = serializers.IntegerField( - help_text="insttype", required=True, allow_null=True) + help_text="insttype", + required=True, + allow_null=True) instid = serializers.CharField( help_text="instid", required=True, @@ -464,7 +566,8 @@ class NetworkResponseSerializer(serializers.Serializer): class NetworkInfoSerializer(serializers.Serializer): resp_data = NetworkResponseSerializer( - help_text="the response data", many=True) + help_text="the response data", + many=True) class SubnetResponseSerializer(serializers.Serializer): @@ -489,7 +592,9 @@ class SubnetResponseSerializer(serializers.Serializer): max_length=255, allow_null=True) insttype = serializers.IntegerField( - help_text="insttype", required=True, allow_null=True) + help_text="insttype", + required=True, + allow_null=True) instid = serializers.CharField( help_text="instid", required=True, @@ -509,7 +614,8 @@ class SubnetResponseSerializer(serializers.Serializer): class SubnetInfoSerializer(serializers.Serializer): resp_data = SubnetResponseSerializer( - help_text="the response data", many=True) + help_text="the response data", + many=True) class CpResponseSerializer(serializers.Serializer): @@ -534,18 +640,24 @@ class CpResponseSerializer(serializers.Serializer): max_length=255, allow_null=True) ownertype = serializers.IntegerField( - help_text="ownertype", required=True, allow_null=True) + help_text="ownertype", + required=True, + allow_null=True) ownerid = serializers.CharField( help_text="ownerid", required=True, max_length=255, allow_null=True) relatedtype = serializers.IntegerField( - help_text="relatedtype", required=True, allow_null=True) + help_text="relatedtype", + required=True, + allow_null=True) class CpsInfoSerializer(serializers.Serializer): - resp_data = CpResponseSerializer(help_text="the response data", many=True) + resp_data = CpResponseSerializer( + help_text="the response data", + many=True) class VolumeResponseSerializer(serializers.Serializer): @@ -565,7 +677,9 @@ class VolumeResponseSerializer(serializers.Serializer): max_length=255, allow_null=True) insttype = serializers.IntegerField( - help_text="insttype", required=True, allow_null=True) + help_text="insttype", + required=True, + allow_null=True) instid = serializers.CharField( help_text="instid", required=True, @@ -578,9 +692,12 @@ class VolumeResponseSerializer(serializers.Serializer): allow_null=True) size = serializers.CharField( help_text="size", - required=True, max_length=255, allow_null=True) + required=True, + max_length=255, + allow_null=True) class VolumeInfoSerializer(serializers.Serializer): resp_data = VolumeResponseSerializer( - help_text="the response data", many=True) + help_text="the response data", + many=True) -- cgit 1.2.3-korg