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 lcm.ns.serializers.resource_handle import ResourceHandleSerializer
17 from lcm.ns.serializers.link import linkSerializer
18 from lcm.ns.serializers.pub_serializers import AddressRangeSerializer
19 from lcm.ns.serializers.ext_virtual_link_info import ExtVirtualLinkInfoSerializer
20 from lcm.ns.serializers.response import ProblemDetailsSerializer
22 # class ResourceHandleSerializer(serializers.Serializer):
23 # vimConnectionId = serializers.CharField(
24 # help_text="Identifier of the VIM connection to manage the resource.",
29 # resourceProviderId = serializers.CharField(
30 # help_text="Identifier of the entity responsible for the management of the resource.",
35 # resourceId = serializers.CharField(
36 # help_text="Identifier of the resource in the scope of the VIM or the resource provider.",
39 # vimLevelResourceType = serializers.CharField(
40 # help_text="Type of the resource in the scope of the VIM or the resource provider.",
47 class ResourceDefinitionSerializer(serializers.Serializer):
48 id = serializers.CharField(
49 help_text="Identifier of this ResourceDefinition, unique at least within the scope of the GrantRequest.",
52 type = serializers.ChoiceField(
53 help_text="Type of the resource definition referenced.",
54 choices=["COMPUTE", "VL", "STORAGE", "LINKPORT"],
57 vduId = serializers.CharField(
58 help_text="Reference to the related VDU in the VNFD applicable to this resource.",
63 resourceTemplateId = serializers.CharField(
64 help_text="Reference to a resource template(such as VnfVirtualLinkDesc) in the VNFD.",
69 resource = ResourceHandleSerializer(
70 help_text="Resource information for an existing resource.",
76 class ConstraintResourceRefSerializer(serializers.Serializer):
77 idType = serializers.ChoiceField(
78 help_text="The type of the identifier.",
79 choices=["RES_MGMT", "GRANT"],
82 resourceId = serializers.CharField(
83 help_text="An actual resource-management-level identifier(idType=RES_MGMT), or an identifier that references a ResourceDefinition(idType=GRANT).",
86 vimConnectionId = serializers.CharField(
92 resourceProviderId = serializers.CharField(
93 help_text="Identifier of the resource provider. It shall only be present when idType = RES_MGMT.",
100 class PlacementConstraintSerializer(serializers.Serializer):
101 affinityOrAntiAffinity = serializers.ChoiceField(
102 help_text="The type of the constraint.",
103 choices=["AFFINITY", "ANTI_AFFINITY"],
106 scope = serializers.ChoiceField(
107 help_text="The scope of the placement constraint indicating the category of the place where the constraint applies.",
108 choices=["NFVI_POP", "ZONE", "ZONE_GROUP", "NFVI_NODE"],
111 resource = ConstraintResourceRefSerializer(
112 help_text="References to resources in the constraint rule.",
118 class VimConstraintSerializer(serializers.Serializer):
119 sameResourceGroup = serializers.BooleanField(
120 help_text="Set to true when the constraint applies not only to the same VIM connection, but also to the same infrastructure resource group.",
123 resource = ConstraintResourceRefSerializer(
124 help_text="References to resources in the constraint rule.",
130 # class LinkSerializer(serializers.Serializer):
131 # href = serializers.CharField(
132 # help_text="URI of the referenced resource.",
137 class GrantRequestLinksSerializer(serializers.Serializer):
138 vnfLcmOpOcc = linkSerializer(
139 help_text="Related VNF lifecycle management operation occurrence.",
142 vnfInstance = linkSerializer(
143 help_text="Related VNF instance.",
148 class GrantRequestSerializer(serializers.Serializer):
149 vnfInstanceId = serializers.CharField(
150 help_text="Identifier of the VNF instance which this grant request is related to.",
153 vnfLcmOpOccId = serializers.CharField(
154 help_text="The identifier of the VNF lifecycle management operation occurrence associated to the GrantRequest.",
155 required=False, # TODO required
159 vnfdId = serializers.CharField(
160 help_text="Identifier of the VNFD that defines the VNF for which the LCM operation is to be granted.",
161 required=False, # TODO required
165 flavourId = serializers.CharField(
166 help_text="Identifier of the VNF deployment flavour of the VNFD that defines the VNF for which the LCM operation is to be granted.",
171 operation = serializers.ChoiceField(
172 help_text="The lifecycle management operation for which granting is requested.",
173 choices=["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"],
176 isAutomaticInvocation = serializers.BooleanField(
177 help_text="Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM, set to false otherwise.",
180 instantiationLevelId = serializers.CharField(
181 help_text="If operation=INSTANTIATE, the identifier of the instantiation level may be provided as an alternative way to define the resources to be added.",
186 addResources = ResourceDefinitionSerializer(
187 help_text="List of resource definitions in the VNFD for resources to be added by the LCM operation.",
191 tempResources = ResourceDefinitionSerializer(
192 help_text="List of resource definitions in the VNFD for resources to be temporarily instantiated during the runtime of the LCM operation.",
196 removeResources = ResourceDefinitionSerializer(
197 help_text="Provides the definitions of resources to be removed by the LCM operation.",
201 updateResources = ResourceDefinitionSerializer(
202 help_text="Provides the definitions of resources to be modified by the LCM operation.",
206 placementConstraints = PlacementConstraintSerializer(
207 help_text="Placement constraints that the VNFM may send to the NFVO in order to influence the resource placement decision.",
211 vimConstraints = VimConstraintSerializer(
212 help_text="Used by the VNFM to require that multiple resources are managed through the same VIM connection.",
216 additionalParams = serializers.DictField(
217 help_text="Additional parameters passed by the VNFM.",
218 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
222 _links = GrantRequestLinksSerializer(
223 help_text="Links to resources related to this request.",
224 required=False # TODO required
228 class VimConnectionInfoSerializer(serializers.Serializer):
229 id = serializers.CharField(
230 help_text="The identifier of the VIM Connection. This identifier is managed by the NFVO.",
233 vimId = serializers.CharField(
234 help_text="The identifier of the VIM instance. This identifier is managed by the NFVO.",
239 vimType = serializers.CharField(
240 help_text="Discriminator for the different types of the VIM information.",
245 interfaceInfo = serializers.DictField(
246 help_text="Information about the interface or interfaces to the VIM.",
247 child=serializers.CharField(help_text="Interface Info", allow_blank=True),
251 accessInfo = serializers.DictField(
252 help_text="Authentication credentials for accessing the VIM.",
253 child=serializers.CharField(help_text="Access Info", allow_blank=True),
257 extra = serializers.DictField(
258 help_text="VIM type specific additional information.",
259 child=serializers.CharField(help_text="Extra", allow_blank=True),
265 class ZoneInfoSerializer(serializers.Serializer):
266 id = serializers.CharField(
267 help_text="The identifier of this ZoneInfo instance, for the purpose of referencing it from other structures in the Grant structure.",
270 zoneId = serializers.CharField(
271 help_text="The identifier of the resource zone, as managed by the resource management layer(typically, the VIM).",
276 vimConnectionId = serializers.CharField(
277 help_text="Identifier of the connection to the VIM that manages the resource zone.",
282 resourceProviderId = serializers.CharField(
283 help_text="Identifies the entity responsible for the management the resource zone.",
290 class ZoneGroupInfoSerializer(serializers.Serializer):
291 zoneId = serializers.ListSerializer(
292 help_text="References of identifiers of ZoneInfo structures.",
293 child=serializers.CharField(help_text="IdentifierLocal", allow_blank=True),
299 class GrantInfoSerializer(serializers.Serializer):
300 resourceDefinitionId = serializers.CharField(
301 help_text="Identifier of the related ResourceDefinition from the related GrantRequest.",
304 reservationId = serializers.CharField(
305 help_text="The reservation identifier applicable to the VNFC/VirtualLink/VirtualStorage.",
310 vimConnectionId = serializers.CharField(
311 help_text="Identifier of the VIM connection to be used to manage this resource.",
316 resourceProviderId = serializers.CharField(
317 help_text="Identifies the entity responsible for the management of the virtualised resource.",
322 zoneId = serializers.CharField(
323 help_text="Reference to the identifier of the ZoneInfo in the Grant.",
328 resourceGroupId = serializers.CharField(
329 help_text="Identifier of the infrastructure resource group.",
336 class VimComputeResourceFlavourSerializer(serializers.Serializer):
337 vimConnectionId = serializers.CharField(
338 help_text="Identifier of the VIM connection to access the flavour referenced in this structure.",
343 resourceProviderId = serializers.CharField(
344 help_text="Identifies the entity responsible for the management of the virtualised resource.",
349 vnfdVirtualComputeDescId = serializers.CharField(
350 help_text="Identifier which references the virtual compute descriptor in the VNFD that maps to this flavour.",
355 vimFlavourId = serializers.CharField(
356 help_text="Identifier of the compute resource flavour in the resource management layer (i.e. VIM).",
363 class VimSoftwareImageSerializer(serializers.Serializer):
364 vimConnectionId = serializers.CharField(
365 help_text="Identifier of the VIM connection to access the flavour referenced in this structure.",
370 resourceProviderId = serializers.CharField(
371 help_text="Identifies the entity responsible for the management of the virtualised resource.",
376 vnfdSoftwareImageId = serializers.CharField(
377 help_text="Identifier which references the software image descriptor in the VNFD.",
382 vimSoftwareImageId = serializers.CharField(
383 help_text="Identifier of the software image in the resource management layer (i.e. VIM).",
390 class VimAssetsSerializer(serializers.Serializer):
391 computeResourceFlavours = VimComputeResourceFlavourSerializer(
392 help_text="Mappings between virtual compute descriptors defined in the VNFD and compute resource flavours managed in the VIM.",
396 softwareImages = VimSoftwareImageSerializer(
397 help_text="Mappings between software images defined in the VNFD and software images managed in the VIM.",
403 # class AddressRangeSerializer(serializers.Serializer):
404 # minAddress = serializers.CharField(
405 # help_text="Lowest IP address belonging to the range.",
408 # maxAddress = serializers.CharField(
409 # help_text="Highest IP address belonging to the range.",
414 class IpAddresseSerializer(serializers.Serializer):
415 type = serializers.ChoiceField(
416 help_text="The type of the IP addresses.",
417 choices=["IPV4", "IPV6"],
420 fixedAddresses = serializers.ListSerializer(
421 help_text="Fixed addresses to assign.",
422 child=serializers.CharField(help_text="IpAddress"),
426 numDynamicAddresses = serializers.IntegerField(
427 help_text="Number of dynamic addresses to assign.",
430 addressRange = AddressRangeSerializer(
431 help_text="An IP address range to be used, e.g. in case of egress connections.",
435 subnetId = serializers.CharField(
436 help_text="Subnet defined by the identifier of the subnet resource in the VIM.",
443 class IpOverEthernetAddressSerializer(serializers.Serializer):
444 macAddress = serializers.CharField(
445 help_text="MAC address.",
450 ipAddresses = IpAddresseSerializer(
451 help_text="List of IP addresses to assign to the CP instance.",
457 class CpProtocolDataConfigSerializer(serializers.Serializer):
458 layerProtocol = serializers.ChoiceField(
459 help_text="Identifier of layer(s) and protocol(s).",
460 choices=["IP_OVER_ETHERNET"],
463 ipOverEthernet = IpOverEthernetAddressSerializer(
464 help_text="Network address data for IP over Ethernet to assign to the extCP instance.",
470 class VnfExtCpConfigDataSerializer(serializers.Serializer):
471 cpInstanceId = serializers.CharField(
472 help_text="Identifier of the external CP instance to which this set of configuration parameters is requested to be applied.",
477 linkPortId = serializers.CharField(
478 help_text="Identifier of a pre-configured link port to which the external CP will be associated.",
483 cpProtocolData = CpProtocolDataConfigSerializer(
484 help_text="Parameters for configuring the network protocols on the link port that connects the CP to a VL.",
490 class VnfExtCpSerializer(serializers.Serializer):
491 cpdId = serializers.CharField(
492 help_text="The identifier of the CPD in the VNFD.",
495 cpConfig = VnfExtCpConfigDataSerializer(
496 help_text="List of instance data that need to be configured on the CP instances created from the respective CPD.",
502 class ExtLinkPortSerializer(serializers.Serializer):
503 id = serializers.CharField(
504 help_text="Identifier of this link port as provided by the entity that has created the link port.",
507 resourceHandle = serializers.CharField(
508 help_text="Reference to the virtualised resource realizing this link port.",
513 class ExtVirtualLinkSerializer(serializers.Serializer):
514 id = serializers.CharField(
515 help_text="The identifier of the external VL instance.",
518 vimConnectionId = serializers.CharField(
519 help_text="Identifier of the VIM connection to manage this resource.",
524 resourceProviderId = serializers.CharField(
525 help_text="Identifies the entity responsible for the management of this resource.",
530 resourceId = serializers.CharField(
531 help_text="The identifier of the resource in the scope of the VIM or the resource provider.",
534 extCps = VnfExtCpSerializer(
535 help_text="External CPs of the VNF to be connected to this external VL.",
539 extLinkPorts = ExtLinkPortSerializer(
540 help_text="Externally provided link ports to be used to connect external connection points to this external VL.",
546 class ExtManagedVirtualLinkSerializer(serializers.Serializer):
547 id = serializers.CharField(
548 help_text="The identifier of the externally-managed internal VL instance.",
551 virtualLinkDescId = serializers.CharField(
552 help_text="The identifier of the VLD in the VNFD for this VL.",
555 vimConnectionId = serializers.CharField(
556 help_text="Identifier of the VIM connection to manage this resource.",
561 resourceProviderId = serializers.CharField(
562 help_text="Identifies the entity responsible for the management of this resource.",
567 resourceId = serializers.CharField(
568 help_text="The identifier of the resource in the scope of the VIM or the resource provider.",
573 class GrantLinksSerializer(serializers.Serializer):
574 self = linkSerializer(
575 help_text="URI of this resource.",
578 vnfLcmOpOcc = linkSerializer(
579 help_text="Related VNF lifecycle management operation occurrence.",
582 vnfInstance = linkSerializer(
583 help_text="Related VNF instance.",
588 class GrantSerializer(serializers.Serializer):
589 id = serializers.CharField(
590 help_text="Identifier of the grant.",
593 vnfInstanceId = serializers.CharField(
594 help_text="Identifier of the related VNF instance.",
597 vnfLcmOpOccId = serializers.CharField(
598 help_text="Identifier of the related VNF lifecycle management operation occurrence.",
599 required=False, # TODO required
603 vimConnections = VimConnectionInfoSerializer(
604 help_text="Provides information regarding VIM connections that are approved to be used by the VNFM to allocate resources.",
608 zones = ZoneInfoSerializer(
609 help_text="Identifies resource zones where the resources are approved to be allocated by the VNFM.",
613 zoneGroups = ZoneGroupInfoSerializer(
614 help_text="Information about groups of resource zones.",
618 computeReservationId = serializers.CharField(
619 help_text="Information that identifies a reservation applicable to the compute resource requirements.",
624 networkReservationId = serializers.CharField(
625 help_text="Information that identifies a reservation applicable to the network resource requirements.",
630 storageReservationId = serializers.CharField(
631 help_text="Information that identifies a reservation applicable to the storage resource requirements.",
636 addResources = GrantInfoSerializer(
637 help_text="List of resources that are approved to be added.",
641 tempResources = GrantInfoSerializer(
642 help_text="List of resources that are approved to be temporarily instantiated during the runtime of the lifecycle operation.",
646 removeResources = GrantInfoSerializer(
647 help_text="List of resources that are approved to be removed.",
651 updateResources = GrantInfoSerializer(
652 help_text="List of resources that are approved to be modified.",
656 vimAssets = VimAssetsSerializer(
657 help_text="Information about assets for the VNF that are managed by the NFVO in the VIM.",
661 extVirtualLinks = ExtVirtualLinkSerializer(
662 help_text="Information about external VLs to connect the VNF to.",
666 extManagedVirtualLinks = ExtManagedVirtualLinkSerializer(
667 help_text="Information about internal VLs that are managed by other entities than the VNFM.",
671 additionalParams = serializers.DictField(
672 help_text="Additional parameters passed by the NFVO, \
673 specific to the VNF and the LCM operation.",
674 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
678 _links = GrantLinksSerializer(
679 help_text="Links to resources related to this resource.",
684 class AffectedVnfcSerializer(serializers.Serializer):
685 id = serializers.CharField(
686 help_text="Identifier of the Vnfc instance.",
689 vduId = serializers.CharField(
690 help_text="Identifier of the related VDU in the VNFD.",
693 changeType = serializers.ChoiceField(
694 help_text="Signals the type of change.",
695 choices=["ADDED", "REMOVED", "MODIFIED", "TEMPORARY"],
698 computeResource = ResourceHandleSerializer(
699 help_text="Reference to the VirtualCompute resource.",
702 metadata = serializers.DictField(
703 help_text="Metadata about this resource.",
704 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
708 affectedVnfcCpIds = serializers.ListSerializer(
709 help_text="Identifiers of CP(s) of the VNFC instance that were affected by the change.",
710 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
714 addedStorageResourceIds = serializers.ListSerializer(
715 help_text="References to VirtualStorage resources that have been added.",
716 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
720 removedStorageResourceIds = serializers.ListSerializer(
721 help_text="References to VirtualStorage resources that have been removed.",
722 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
728 class AffectedVirtualLinkSerializer(serializers.Serializer):
729 id = serializers.CharField(
730 help_text="Identifier of the virtual link instance.",
733 virtualLinkDescId = serializers.CharField(
734 help_text="Identifier of the related VLD in the VNFD.",
737 changeType = serializers.ChoiceField(
738 help_text="Signals the type of change.",
739 choices=["ADDED", "REMOVED", "MODIFIED", "TEMPORARY", "LINK_PORT_ADDED", "LINK_PORT_REMOVED"],
742 networkResource = ResourceHandleSerializer(
743 help_text="Reference to the VirtualNetwork resource.",
747 metadata = serializers.DictField(
748 help_text="Metadata about this resource.",
749 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
755 class AffectedVirtualStorageSerializer(serializers.Serializer):
756 id = serializers.CharField(
757 help_text="Identifier of the storage instance.",
760 virtualStorageDescId = serializers.CharField(
761 help_text="Identifier of the related VirtualStorage descriptor in the VNFD.",
764 changeType = serializers.ChoiceField(
765 help_text="Signals the type of change.",
766 choices=["ADDED", "REMOVED", "MODIFIED", "TEMPORARY"],
769 storageResource = ResourceHandleSerializer(
770 help_text="Reference to the VirtualStorage resource.",
774 metadata = serializers.DictField(
775 help_text="Metadata about this resource.",
776 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
782 class VnfInfoModificationsSerializer(serializers.Serializer):
783 vnfInstanceName = serializers.CharField(
784 help_text="If present, this attribute signals modifications of the vnfInstanceName attribute in VnfInstance.",
789 vnfInstanceDescription = serializers.CharField(
790 help_text="If present, this attribute signals modifications of the vnfInstanceDescription attribute in VnfInstance.",
795 vnfConfigurableProperties = serializers.DictField(
796 help_text="If present, this attribute signals modifications of the vnfConfigurableProperties attribute in VnfInstance.",
797 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
801 metadata = serializers.DictField(
802 help_text="If present, this attribute signals modifications of the metadata attribute in VnfInstance.",
803 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
807 extensions = serializers.DictField(
808 help_text="If present, this attribute signals modifications of the extensions attribute in VnfInstance.",
809 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
813 vimConnectionInfo = VimConnectionInfoSerializer(
814 help_text="If present, this attribute signals modifications of the vimConnectionInfo attribute in VnfInstance.",
818 vnfPkgId = serializers.CharField(
819 help_text="If present, this attribute signals modifications of the vnfPkgId attribute in VnfInstance.",
824 vnfdId = serializers.CharField(
825 help_text="If present, this attribute signals modifications of the vnfdId attribute in VnfInstance.",
830 vnfProvider = serializers.CharField(
831 help_text="If present, this attribute signals modifications of the vnfProvider attribute in VnfInstance.",
836 vnfProductName = serializers.CharField(
837 help_text="If present, this attribute signals modifications of the vnfProductName attribute in VnfInstance.",
842 vnfSoftwareVersion = serializers.CharField(
843 help_text="If present, this attribute signals modifications of the vnfSoftwareVersion attribute in VnfInstance.",
848 vnfdVersion = serializers.CharField(
849 help_text="If present, this attribute signals modifications of the vnfdVersion attribute in VnfInstance.",
856 class ExtLinkPortInfoSerializer(serializers.Serializer):
857 id = serializers.CharField(
858 help_text="Identifier of this link port as provided by the entity that has created the link port.",
861 resourceHandle = ResourceHandleSerializer(
862 help_text="Reference to the virtualised resource realizing this link port.",
865 cpInstanceId = serializers.CharField(
866 help_text="Identifier of the external CP of the VNF connected to this link port.",
873 # class ExtVirtualLinkInfoSerializer(serializers.Serializer):
874 # id = serializers.CharField(
875 # help_text="Identifier of the external VL and the related external VL information instance.",
878 # resourceHandle = ResourceHandleSerializer(
879 # help_text="Reference to the resource realizing this VL.",
882 # extLinkPorts = ExtLinkPortInfoSerializer(
883 # help_text="Link ports of this VL.",
889 # class ProblemDetailsSerializer(serializers.Serializer):
890 # type = serializers.CharField(
891 # help_text="A URI reference according to IETF RFC 3986 [5] that identifies the problem type.",
896 # title = serializers.CharField(
897 # help_text="A short, human-readable summary of the problem type.",
902 # status = serializers.IntegerField(
903 # help_text="The HTTP status code for this occurrence of the problem.",
906 # detail = serializers.CharField(
907 # help_text="A human-readable explanation specific to this occurrence of the problem.",
910 # instance = serializers.CharField(
911 # help_text="A URI reference that identifies the specific occurrence of the problem.",
918 class LccnLinksSerializer(serializers.Serializer):
919 vnfInstance = linkSerializer(
920 help_text="Link to the resource representing the VNF instance to which the notified change applies.",
923 subscription = linkSerializer(
924 help_text="Link to the related subscription.",
927 vnfLcmOpOcc = linkSerializer(
928 help_text="Link to the VNF lifecycle management operation occurrence that this notification is related to.",
934 class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
935 id = serializers.CharField(
936 help_text="Identifier of this notification.",
939 notificationType = serializers.ChoiceField(
940 help_text="Discriminator for the different notification types.",
942 'VnfLcmOperationOccurrenceNotification',
943 'VnfIdentifierCreationNotification',
944 'VnfIdentifierDeletionNotification'
948 subscriptionId = serializers.CharField(
949 help_text="Identifier of the subscription that this notification relates to.",
952 timeStamp = serializers.CharField(
953 help_text="Date-time of the generation of the notification.",
956 notificationStatus = serializers.ChoiceField(
957 help_text="Indicates whether this notification reports about the start of a lifecycle operation or the result of a lifecycle operation.",
958 choices=["START", "RESULT"],
961 operationState = serializers.ChoiceField(
962 help_text="The state of the VNF LCM operation occurrence.",
963 choices=["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"],
966 vnfInstanceId = serializers.CharField(
967 help_text="The identifier of the VNF instance affected.",
970 operation = serializers.ChoiceField(
971 help_text="The lifecycle management operation.",
972 choices=["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"],
975 isAutomaticInvocation = serializers.BooleanField(
976 help_text="Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM.",
979 vnfLcmOpOccId = serializers.CharField(
980 help_text="The identifier of the VNF lifecycle management operation occurrence associated to the notification.",
983 affectedVnfcs = AffectedVnfcSerializer(
984 help_text="Information about VNFC instances that were affected during the lifecycle operation.",
988 affectedVirtualLinks = AffectedVirtualLinkSerializer(
989 help_text="Information about VL instances that were affected during the lifecycle operation.",
993 affectedVirtualStorages = AffectedVirtualStorageSerializer(
994 help_text="Information about virtualised storage instances that were affected during the lifecycle operation.",
998 changedInfo = VnfInfoModificationsSerializer(
999 help_text="Information about the changed VNF instance information, including changed VNF configurable properties.",
1003 changedExtConnectivity = ExtVirtualLinkInfoSerializer(
1004 help_text="Information about changed external connectivity.",
1008 error = ProblemDetailsSerializer(
1009 help_text="Details of the latest error, if one has occurred during executing the LCM operation",
1013 _links = LccnLinksSerializer(
1014 help_text="Links to resources related to this notification.",
1020 class VnfIdentifierCreationNotificationSerializer(serializers.Serializer):
1021 id = serializers.CharField(
1022 help_text="Identifier of this notification. \
1023 If a notification is sent multiple times due to multiple subscriptions, \
1024 the id attribute of all these notifications shall have the same value.",
1029 notificationType = serializers.ChoiceField(
1030 help_text="Discriminator for the different notification types.",
1032 'VnfLcmOperationOccurrenceNotification',
1033 'VnfIdentifierCreationNotification',
1034 'VnfIdentifierDeletionNotification'
1038 subscriptionId = serializers.CharField(
1039 help_text="Identifier of the subscription that this notification relates to.",
1044 timeStamp = serializers.DateTimeField(
1045 help_text="Date-time of the generation of the notification.",
1049 vnfInstanceId = serializers.CharField(
1050 help_text="The created VNF instance identifier.",
1055 _links = LccnLinksSerializer(
1056 help_text="Links to resources related to this notification.",
1062 class VnfIdentifierDeletionNotificationSerializer(serializers.Serializer):
1063 id = serializers.CharField(
1064 help_text="Identifier of this notification. \
1065 If a notification is sent multiple times due to multiple subscriptions, \
1066 the id attribute of all these notifications shall have the same value.",
1071 notificationType = serializers.ChoiceField(
1072 help_text="Discriminator for the different notification types.",
1074 'VnfLcmOperationOccurrenceNotification',
1075 'VnfIdentifierCreationNotification',
1076 'VnfIdentifierDeletionNotification'
1080 subscriptionId = serializers.CharField(
1081 help_text="Identifier of the subscription that this notification relates to.",
1086 timeStamp = serializers.DateTimeField(
1087 help_text="Date-time of the generation of the notification.",
1091 vnfInstanceId = serializers.CharField(
1092 help_text="The deleted VNF instance identifier.",
1097 _links = LccnLinksSerializer(
1098 help_text="Links to resources related to this notification.",