Remove useless 'allow_blank' sentences.
Change improper 'require' value, 'allow_null' value, and serializertype.
Add vnf_instances.py for multiple vnf instance serialization.
Change-Id: I483934d9e90b98dfeb881057cb7bc1bfe0bbc3f3
Issue-ID: VFC-1016
Signed-off-by: laili <lai.li@zte.com.cn>
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. \
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)
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)
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,
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. \
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",
allow_null=True)
_links = _LinksSerializer(
help_text="Links to resources related to this resource.",
- required=True,
+ required=False,
allow_null=False)
--- /dev/null
+# 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()
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,