summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/serializers/instantiated_vnf_info.py13
-rw-r--r--lcm/lcm/nf/serializers/scale_info.py3
-rw-r--r--lcm/lcm/nf/serializers/virtual_storage_resource_info.py6
-rw-r--r--lcm/lcm/nf/serializers/vnf_instance.py32
-rw-r--r--lcm/lcm/nf/serializers/vnf_instances.py17
-rw-r--r--lcm/lcm/nf/serializers/vnfc_resource_info.py8
6 files changed, 45 insertions, 34 deletions
diff --git a/lcm/lcm/nf/serializers/instantiated_vnf_info.py b/lcm/lcm/nf/serializers/instantiated_vnf_info.py
index 1324b9b0..82c2ec5b 100644
--- a/lcm/lcm/nf/serializers/instantiated_vnf_info.py
+++ b/lcm/lcm/nf/serializers/instantiated_vnf_info.py
@@ -28,13 +28,13 @@ class InstantiatedVnfInfoSerializer(serializers.Serializer):
help_text="Identifier of the VNF deployment flavour applied to this VNF instance.",
max_length=255,
required=True,
- allow_null=False,
+ allow_null=True,
allow_blank=False)
vnfState = serializers.ChoiceField(
help_text="State of the VNF instance.",
choices=["STARTED", "STOPPED"],
required=True,
- allow_null=False,
+ allow_null=True,
allow_blank=False)
scaleStatus = ScaleInfoSerializer(
help_text="Scale status of the VNF, one entry per aspect. \
@@ -72,17 +72,14 @@ class InstantiatedVnfInfoSerializer(serializers.Serializer):
help_text="Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.",
many=True,
required=False,
- allow_null=True,
- allow_blank=True)
+ allow_null=True)
vnfVirtualLinkResourceInfo = VnfVirtualLinkResourceInfoSerializer(
help_text="Information about the virtualised network resources used by the VLs of the VNF instance.",
many=True,
required=False,
- allow_null=True,
- allow_blank=True)
+ allow_null=True)
virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer(
help_text="Information about the virtualised storage resources used as storage for the VNF instance.",
many=True,
required=False,
- allow_null=True,
- allow_blank=True)
+ allow_null=True)
diff --git a/lcm/lcm/nf/serializers/scale_info.py b/lcm/lcm/nf/serializers/scale_info.py
index a97d42c2..08372e73 100644
--- a/lcm/lcm/nf/serializers/scale_info.py
+++ b/lcm/lcm/nf/serializers/scale_info.py
@@ -26,5 +26,4 @@ class ScaleInfoSerializer(serializers.Serializer):
help_text="Indicates the scale level. \
The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.",
required=True,
- allow_null=False,
- allow_blank=False)
+ allow_null=False)
diff --git a/lcm/lcm/nf/serializers/virtual_storage_resource_info.py b/lcm/lcm/nf/serializers/virtual_storage_resource_info.py
index 5c864f9b..8ec23a37 100644
--- a/lcm/lcm/nf/serializers/virtual_storage_resource_info.py
+++ b/lcm/lcm/nf/serializers/virtual_storage_resource_info.py
@@ -27,9 +27,9 @@ class VirtualStorageResourceInfoSerializer(serializers.Serializer):
virtualStorageDescId = serializers.CharField(
help_text="Identifier of the VirtualStorageDesc in the VNFD.",
max_length=255,
- required=True,
- allow_null=False,
- allow_blank=False)
+ required=False,
+ allow_null=True,
+ allow_blank=True)
storageResource = ResourceHandleSerializer(
help_text="Reference to the VirtualStorage resource.",
required=True,
diff --git a/lcm/lcm/nf/serializers/vnf_instance.py b/lcm/lcm/nf/serializers/vnf_instance.py
index bfcbd298..bd453629 100644
--- a/lcm/lcm/nf/serializers/vnf_instance.py
+++ b/lcm/lcm/nf/serializers/vnf_instance.py
@@ -43,43 +43,43 @@ class VnfInstanceSerializer(serializers.Serializer):
vnfdId = serializers.CharField(
help_text="Identifier of the VNFD on which the VNF instance is based.",
max_length=255,
- required=True,
- allow_null=False,
- allow_blank=False)
+ required=False,
+ allow_null=True,
+ allow_blank=True)
vnfProvider = serializers.CharField(
help_text="Provider of the VNF and the VNFD. \
The value is copied from the VNFD. ",
max_length=255,
required=True,
- allow_null=False,
+ allow_null=True,
allow_blank=False)
vnfProductName = serializers.CharField(
help_text="Name to identify the VNF Product. \
The value is copied from the VNFD.",
max_length=255,
- required=True,
- allow_null=False,
- allow_blank=False)
+ required=False,
+ allow_null=True,
+ allow_blank=True)
vnfSoftwareVersion = serializers.CharField(
help_text="Software version of the VNF. \
The value is copied from the VNFD.",
max_length=255,
- required=True,
- allow_null=False,
- allow_blank=False)
+ required=False,
+ allow_null=True,
+ allow_blank=True)
vnfdVersion = serializers.CharField(
help_text="Identifies the version of the VNFD. \
The value is copied from the VNFD.",
max_length=255,
required=True,
- allow_null=False,
+ allow_null=True,
allow_blank=False)
vnfPkgId = serializers.CharField(
help_text="Identifier of information held by the NFVO about the specific VNF package on which the VNF is based. \
This attribute can be modified with the PATCH method.",
max_length=255,
required=True,
- allow_null=False,
+ allow_null=True,
allow_blank=False)
vnfConfigurableProperties = serializers.DictField(
help_text="Current values of the configurable properties of the VNF instance. \
@@ -95,9 +95,9 @@ class VnfInstanceSerializer(serializers.Serializer):
instantiationState = serializers.ChoiceField(
help_text="The instantiation state of the VNF.",
choices=["NOT_INSTANTIATED", "INSTANTIATED"],
- required=True,
- allow_null=False,
- allow_blank=False)
+ required=False,
+ allow_null=True,
+ allow_blank=True)
instantiatedVnfInfo = InstantiatedVnfInfoSerializer(
help_text="Information specific to an instantiated VNF instance. \
This attribute shall be present if the instantiateState attribute value is INSTANTIATED",
@@ -117,5 +117,5 @@ class VnfInstanceSerializer(serializers.Serializer):
allow_null=True)
_links = _LinksSerializer(
help_text="Links to resources related to this resource.",
- required=True,
+ required=False,
allow_null=False)
diff --git a/lcm/lcm/nf/serializers/vnf_instances.py b/lcm/lcm/nf/serializers/vnf_instances.py
new file mode 100644
index 00000000..f3132904
--- /dev/null
+++ b/lcm/lcm/nf/serializers/vnf_instances.py
@@ -0,0 +1,17 @@
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from rest_framework import serializers
+from vnf_instance import VnfInstanceSerializer
+
+
+class VnfInstancesSerializer(serializers.ListSerializer):
+ child = VnfInstanceSerializer()
diff --git a/lcm/lcm/nf/serializers/vnfc_resource_info.py b/lcm/lcm/nf/serializers/vnfc_resource_info.py
index 2c6c4f19..3ad0c6f5 100644
--- a/lcm/lcm/nf/serializers/vnfc_resource_info.py
+++ b/lcm/lcm/nf/serializers/vnfc_resource_info.py
@@ -33,14 +33,12 @@ class VnfcResourceInfoSerializer(serializers.Serializer):
help_text="Reference to the VirtualCompute resource.",
required=True,
allow_null=False)
- storageResourceIds = serializers.CharField(
+ storageResourceIds = serializers.ListSerializer(
help_text="References to the VirtualStorage resources. \
The value refers to a VirtualStorageResourceInfo item in the VnfInstance.",
- max_length=255,
- many=True,
+ child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
required=False,
- allow_null=True,
- allow_blank=True)
+ allow_null=True)
reservationId = serializers.CharField(
help_text="The reservation identifier applicable to the resource.",
max_length=255,