1 # Copyright 2018 ZTE Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from rest_framework import serializers
16 from .checksum import ChecksumSerializer
19 class VnfPackageSoftwareImageInfoSerializer(serializers.Serializer):
20 id = serializers.CharField(
21 help_text="Identifier of the software image.",
26 name = serializers.CharField(
27 help_text="Name of the software image.",
32 provider = serializers.CharField(
33 help_text="Provider of the software image.",
38 version = serializers.CharField(
39 help_text="Version of the software image.",
44 checksum = ChecksumSerializer(
45 help_text="Checksum of the software image file.",
49 containerFormat = serializers.ChoiceField(
50 help_text="terminationType: Indicates whether forceful or graceful termination is requested.",
51 choices=["AKI", "AMI", "ARI", "BARE", "DOCKER", "OVA", "OVF"],
55 diskFormat = serializers.ChoiceField(
56 help_text="Disk format of a software image is the format of the underlying disk image.",
57 choices=["AKI", "AMI", "ARI", "ISO", "QCOW2", "RAW", "VDI", "VHD", "VHDX", "VMDK"],
61 createdAt = serializers.DateTimeField(
62 help_text="Time when this software image was created.",
67 minDisk = serializers.IntegerField(
68 help_text="The minimal disk for this software image in bytes.",
72 minRam = serializers.IntegerField(
73 help_text="The minimal RAM for this software image in bytes.",
77 size = serializers.IntegerField(
78 help_text="Size of this software image in bytes.",
82 userMetadata = serializers.DictField(
83 help_text="User-defined data.",
84 child=serializers.CharField(
85 help_text="KeyValue Pairs",
91 imagePath = serializers.CharField(
92 help_text="Path in the VNF package.",