summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-01-31 09:39:36 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-01-31 09:39:36 +0800
commit44dcff6aec926b143c4de59f77e4de37540299e9 (patch)
tree39c3dab9a1ec67eca670993797c89d7ff41f8887
parentae06a2fc3bd8c283fd03dcab6e91098de9cfb3c8 (diff)
Fix vfc-vnflcm pep8 E501 issue
Change-Id: I1d46bf5f4ec53aec3a3768a753141d9ed70c51ac Issue-ID: VFC-682 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/nf/vnfs/serializers.py217
1 files changed, 156 insertions, 61 deletions
diff --git a/lcm/lcm/nf/vnfs/serializers.py b/lcm/lcm/nf/vnfs/serializers.py
index f4348d9b..d1f462a2 100644
--- a/lcm/lcm/nf/vnfs/serializers.py
+++ b/lcm/lcm/nf/vnfs/serializers.py
@@ -17,12 +17,15 @@ from rest_framework import serializers
class CreateVnfReqSerializer(serializers.Serializer):
vnfdId = serializers.CharField(help_text="vnfd Id", required=True)
- vnfInstanceName = serializers.CharField(help_text="vnf Instance Name", required=True)
- vnfInstanceDescription = serializers.CharField(help_text="vnf Instance Description", required=False, allow_null=True)
+ vnfInstanceName = serializers.CharField(
+ help_text="vnf Instance Name", required=True)
+ vnfInstanceDescription = serializers.CharField(
+ help_text="vnf Instance Description", required=False, allow_null=True)
class CreateVnfRespSerializer(serializers.Serializer):
- vnfInstanceId = serializers.CharField(help_text="vnf Instance Id", required=True)
+ vnfInstanceId = serializers.CharField(
+ help_text="vnf Instance Id", required=True)
class ResourceSerializer(serializers.Serializer):
@@ -31,22 +34,40 @@ class ResourceSerializer(serializers.Serializer):
class VirtualStorageResourceInfoSerializer(serializers.Serializer):
- virtualStorageInstanceId = serializers.CharField(help_text="virtualStorageInstanceId", required=False, allow_null=True)
- virtualStorageDescId = serializers.CharField(help_text="virtualStorageDescId", required=False, allow_null=True)
- storageResource = ResourceSerializer(help_text="storageResource", required=False, allow_null=True)
+ virtualStorageInstanceId = serializers.CharField(
+ help_text="virtualStorageInstanceId", required=False, allow_null=True)
+ virtualStorageDescId = serializers.CharField(
+ help_text="virtualStorageDescId", required=False, allow_null=True)
+ storageResource = ResourceSerializer(
+ help_text="storageResource",
+ required=False,
+ allow_null=True)
class VirtualLinkResourceInfoSerializer(serializers.Serializer):
- virtualLinkInstanceId = serializers.IntegerField(help_text="virtualLinkInstanceId", required=False, allow_null=True)
- virtualLinkDescId = serializers.IntegerField(help_text="virtualLinkDescId", required=False, allow_null=True)
- networkResource = ResourceSerializer(help_text="networkResource", required=False, allow_null=True)
+ virtualLinkInstanceId = serializers.IntegerField(
+ help_text="virtualLinkInstanceId", required=False, allow_null=True)
+ virtualLinkDescId = serializers.IntegerField(
+ help_text="virtualLinkDescId", required=False, allow_null=True)
+ networkResource = ResourceSerializer(
+ help_text="networkResource",
+ required=False,
+ allow_null=True)
class VnfcResourceInfoSerializer(serializers.Serializer):
- vnfcInstanceId = serializers.IntegerField(help_text="vnfcInstanceId", required=False, allow_null=True)
- vduId = serializers.IntegerField(help_text="vduId", required=False, allow_null=True)
- storageResourceIds = serializers.IntegerField(help_text="storageResourceIds", required=False, allow_null=True)
- computeResource = ResourceSerializer(help_text="computeResource", required=False, allow_null=True)
+ vnfcInstanceId = serializers.IntegerField(
+ help_text="vnfcInstanceId", required=False, allow_null=True)
+ vduId = serializers.IntegerField(
+ help_text="vduId",
+ required=False,
+ allow_null=True)
+ storageResourceIds = serializers.IntegerField(
+ help_text="storageResourceIds", required=False, allow_null=True)
+ computeResource = ResourceSerializer(
+ help_text="computeResource",
+ required=False,
+ allow_null=True)
class AccessInfoSerializer(serializers.Serializer):
@@ -58,15 +79,28 @@ class AccessInfoSerializer(serializers.Serializer):
class InterfaceInfoSerializer(serializers.Serializer):
vimType = serializers.CharField(help_text="vimType", required=True)
apiVersion = serializers.CharField(help_text="apiVersion", required=True)
- protocolType = serializers.ChoiceField(help_text="protocolType", choices=['http', 'https'], required=True)
+ protocolType = serializers.ChoiceField(
+ help_text="protocolType", choices=[
+ 'http', 'https'], required=True)
class VimInfoSerializer(serializers.Serializer):
- vimInfoId = serializers.CharField(help_text="vimInfoId", required=False, allow_null=True)
- vimId = serializers.CharField(help_text="vimId", required=False, allow_null=True)
- interfaceEndpoint = serializers.CharField(help_text="interfaceEndpoint", required=False, allow_null=True)
- interfaceInfo = InterfaceInfoSerializer(help_text="vimInfoId", required=False, allow_null=True)
- accessInfo = AccessInfoSerializer(help_text="accessInfo", required=False, allow_null=True)
+ vimInfoId = serializers.CharField(
+ help_text="vimInfoId",
+ required=False,
+ allow_null=True)
+ vimId = serializers.CharField(
+ help_text="vimId",
+ required=False,
+ allow_null=True)
+ interfaceEndpoint = serializers.CharField(
+ help_text="interfaceEndpoint", required=False, allow_null=True)
+ interfaceInfo = InterfaceInfoSerializer(
+ help_text="vimInfoId", required=False, allow_null=True)
+ accessInfo = AccessInfoSerializer(
+ help_text="accessInfo",
+ required=False,
+ allow_null=True)
class LinkPortsSerializer(serializers.Serializer):
@@ -77,61 +111,99 @@ class LinkPortsSerializer(serializers.Serializer):
class ResourceHandleSerializer(serializers.Serializer):
resourceId = serializers.CharField(help_text="resourceId", required=True)
vimId = serializers.CharField(help_text="vimId", required=False)
- resourceProviderId = serializers.CharField(help_text="resourceProviderId", required=False)
+ resourceProviderId = serializers.CharField(
+ help_text="resourceProviderId", required=False)
class ExtVirtualLinkInfoSerializer(serializers.Serializer):
- extVirtualLinkId = serializers.CharField(help_text="extVirtualLinkId", required=True)
- resourceHandle = ResourceHandleSerializer(help_text="iPAddress", required=True)
- linkPorts = LinkPortsSerializer(help_text="iPAddress", many=True, allow_null=True)
+ extVirtualLinkId = serializers.CharField(
+ help_text="extVirtualLinkId", required=True)
+ resourceHandle = ResourceHandleSerializer(
+ help_text="iPAddress", required=True)
+ linkPorts = LinkPortsSerializer(
+ help_text="iPAddress", many=True, allow_null=True)
class L3AddressDataSerializer(serializers.Serializer):
- iPAddressType = serializers.ChoiceField(help_text="iPAddressType", choices=['IPv4', 'IPv6'], required=True)
+ iPAddressType = serializers.ChoiceField(
+ help_text="iPAddressType", choices=[
+ 'IPv4', 'IPv6'], required=True)
iPAddress = serializers.CharField(help_text="iPAddress", required=True)
class NetworkAddressSerializer(serializers.Serializer):
- addressType = serializers.ChoiceField(help_text="addressType", choices=['MAC', 'IP'], required=True)
- l2AddressData = serializers.CharField(help_text="l2AddressData", required=False)
- l3AddressData = L3AddressDataSerializer(help_text="addresses", required=False)
+ addressType = serializers.ChoiceField(
+ help_text="addressType", choices=[
+ 'MAC', 'IP'], required=True)
+ l2AddressData = serializers.CharField(
+ help_text="l2AddressData", required=False)
+ l3AddressData = L3AddressDataSerializer(
+ help_text="addresses", required=False)
class ExtCpInfoSerializer(serializers.Serializer):
- cpInstanceId = serializers.CharField(help_text="cpInstanceId", required=False, allow_null=True)
+ cpInstanceId = serializers.CharField(
+ help_text="cpInstanceId",
+ required=False,
+ allow_null=True)
cpdId = serializers.IntegerField(help_text="cpdId", required=True)
- numDynamicAddresses = serializers.IntegerField(help_text="numDynamicAddresses", required=False, allow_null=True)
- addresses = NetworkAddressSerializer(help_text="addresses", many=True, allow_null=True)
+ numDynamicAddresses = serializers.IntegerField(
+ help_text="numDynamicAddresses", required=False, allow_null=True)
+ addresses = NetworkAddressSerializer(
+ help_text="addresses", many=True, allow_null=True)
class ScaleInfoSerializer(serializers.Serializer):
aspectId = serializers.CharField(help_text="aspectId", required=True)
- scaleLevel = serializers.IntegerField(help_text="scaleLevel", required=True)
+ scaleLevel = serializers.IntegerField(
+ help_text="scaleLevel", required=True)
class instantiatedVnfInfoSerializer(serializers.Serializer):
- flavourId = serializers.CharField(help_text="flavour Id", required=True, allow_null=True)
- vnfState = serializers.ChoiceField(help_text="vnf State", choices=['STARTED', 'STOPPED'], required=True, allow_null=True)
+ flavourId = serializers.CharField(
+ help_text="flavour Id",
+ required=True,
+ allow_null=True)
+ vnfState = serializers.ChoiceField(
+ help_text="vnf State",
+ choices=[
+ 'STARTED',
+ 'STOPPED'],
+ required=True,
+ allow_null=True)
scaleStatus = ScaleInfoSerializer(help_text="scaleStatus", many=True)
extCpInfo = ExtCpInfoSerializer(help_text="extCpInfo", many=True)
- extVirtualLink = ExtVirtualLinkInfoSerializer(help_text="extVirtualLink", many=True)
- monitoringParameters = serializers.DictField(help_text="monitoringParameters",
- child=serializers.CharField(allow_blank=True), required=False,
- allow_null=True)
+ extVirtualLink = ExtVirtualLinkInfoSerializer(
+ help_text="extVirtualLink", many=True)
+ monitoringParameters = serializers.DictField(
+ help_text="monitoringParameters", child=serializers.CharField(
+ allow_blank=True), required=False, allow_null=True)
vimInfo = VimInfoSerializer(help_text="vimInfo", many=True)
- vnfcResourceInfo = VnfcResourceInfoSerializer(help_text="vnfcResourceInfo", many=True)
- virtualLinkResourceInfo = VirtualLinkResourceInfoSerializer(help_text="virtualLinkResourceInfo", many=True)
- virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer(help_text="virtualStorageResourceInfo", many=True)
+ vnfcResourceInfo = VnfcResourceInfoSerializer(
+ help_text="vnfcResourceInfo", many=True)
+ virtualLinkResourceInfo = VirtualLinkResourceInfoSerializer(
+ help_text="virtualLinkResourceInfo", many=True)
+ virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer(
+ help_text="virtualStorageResourceInfo", many=True)
class VnfInfoSerializer(serializers.Serializer):
- vnfInstanceId = serializers.CharField(help_text="vnf Instance Id", required=True)
- vnfInstanceName = serializers.CharField(help_text="vnf Instance Name", required=True)
- onboardedVnfPkgInfoId = serializers.CharField(help_text="onboarded Vnf Pkg Info Id", required=False,
- allow_null=True)
- vnfdVersion = serializers.CharField(help_text="vnfd Version", required=False, allow_null=True)
- vnfProvider = serializers.CharField(help_text="vnf Provider", required=False, allow_null=True)
- instantiatedVnfInfo = instantiatedVnfInfoSerializer(help_text="instantiatedVnfInfo", required=True)
+ vnfInstanceId = serializers.CharField(
+ help_text="vnf Instance Id", required=True)
+ vnfInstanceName = serializers.CharField(
+ help_text="vnf Instance Name", required=True)
+ onboardedVnfPkgInfoId = serializers.CharField(
+ help_text="onboarded Vnf Pkg Info Id", required=False, allow_null=True)
+ vnfdVersion = serializers.CharField(
+ help_text="vnfd Version",
+ required=False,
+ allow_null=True)
+ vnfProvider = serializers.CharField(
+ help_text="vnf Provider",
+ required=False,
+ allow_null=True)
+ instantiatedVnfInfo = instantiatedVnfInfoSerializer(
+ help_text="instantiatedVnfInfo", required=True)
class VnfsInfoSerializer(serializers.ListSerializer):
@@ -139,34 +211,57 @@ class VnfsInfoSerializer(serializers.ListSerializer):
class ExtVirtualLinkSerizlizer(serializers.Serializer):
- vlInstanceId = serializers.CharField(help_text="vlInstanceId", required=False, allow_null=True)
- resourceSubnetId = serializers.CharField(help_text="resourceSubnetId", required=False, allow_null=True)
- cpdId = serializers.CharField(help_text="cpdId", required=False, allow_null=True)
- resourceId = serializers.CharField(help_text="resourceId", required=False, allow_null=True)
+ vlInstanceId = serializers.CharField(
+ help_text="vlInstanceId",
+ required=False,
+ allow_null=True)
+ resourceSubnetId = serializers.CharField(
+ help_text="resourceSubnetId", required=False, allow_null=True)
+ cpdId = serializers.CharField(
+ help_text="cpdId",
+ required=False,
+ allow_null=True)
+ resourceId = serializers.CharField(
+ help_text="resourceId",
+ required=False,
+ allow_null=True)
vim = VimInfoSerializer(help_text="vim", required=False, allow_null=True)
- extCps = ExtCpInfoSerializer(help_text="extCps", many=True, required=False, allow_null=True)
+ extCps = ExtCpInfoSerializer(
+ help_text="extCps",
+ many=True,
+ required=False,
+ allow_null=True)
class ExtVirtualLinksSerializer(serializers.ListSerializer):
- child = ExtVirtualLinkSerizlizer(help_text="extVirtualLink", required=False, allow_null=True)
+ child = ExtVirtualLinkSerizlizer(
+ help_text="extVirtualLink",
+ required=False,
+ allow_null=True)
class AdditionalParamsSerializer(serializers.Serializer):
inputs = serializers.DictField(
help_text="inputs",
- child=serializers.CharField(help_text="but i needed to test these 2 fields somehow", allow_blank=True),
+ child=serializers.CharField(
+ help_text="but i needed to test these 2 fields somehow",
+ allow_blank=True),
required=False,
- allow_null=True
- )
- extVirtualLinks = ExtVirtualLinksSerializer(help_text="extVirtualLinks", required=False, allow_null=True)
+ allow_null=True)
+ extVirtualLinks = ExtVirtualLinksSerializer(
+ help_text="extVirtualLinks", required=False, allow_null=True)
class InstantiateVnfRequestSerializer(serializers.Serializer):
flavourId = serializers.CharField(help_text="flavourId", required=True)
- instantiationLevelId = serializers.CharField(help_text="instantiationLevelId", required=True, allow_null=True)
- localizationLanguage = serializers.CharField(help_text="localizationLanguage", required=True, allow_null=True)
- extVirtualLinks = ExtVirtualLinksSerializer(help_text="extVirtualLinks", required=False, allow_null=True)
- additionalParams = AdditionalParamsSerializer(help_text="additionalParams", required=False, allow_null=True)
+ instantiationLevelId = serializers.CharField(
+ help_text="instantiationLevelId", required=True, allow_null=True)
+ localizationLanguage = serializers.CharField(
+ help_text="localizationLanguage", required=True, allow_null=True)
+ extVirtualLinks = ExtVirtualLinksSerializer(
+ help_text="extVirtualLinks", required=False, allow_null=True)
+ additionalParams = AdditionalParamsSerializer(
+ help_text="additionalParams", required=False, allow_null=True)
class InstantiateVnfResponseSerializer(serializers.Serializer):