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
17 from lcm.ns.serializers.sol.ext_virtual_link_info import ExtVirtualLinkInfoSerializer
18 from lcm.ns.serializers.sol.cp_serializers import AddressRangeSerializer
19 from lcm.ns.serializers.sol.resource_handle import ResourceHandleSerializer
20 from lcm.ns.serializers.sol.pub_serializers import ProblemDetailsSerializer, LinkSerializer
21 from lcm.ns.enum import LAYER_PROTOCOL, IPADDRESSES_TYPE, AFFINITY_OR_ANTIAFFIINTY_SCOPE, AFFINITY_OR_ANTIAFFIINTY, LCM_NOTIFICATION_STATUS, OPERATION_STATE_TYPE
22 from lcm.ns_vnfs.enum import STORAGE_CHANGE_TYPE, VNFC_CHANGE_TYPE, VL_CHANGE_TYPE, RESOURE_TYPE, RESOURCE_ID_TYPE, GRANT_OPERATION, VNF_NOTIFICATION_TYPE
23 from lcm.pub.utils.enumutil import enum_to_list
26 class ResourceDefinitionSerializer(serializers.Serializer):
27 id = serializers.CharField(
28 help_text="Identifier of this ResourceDefinition, unique at least within the scope of the GrantRequest.",
31 type = serializers.ChoiceField(
32 help_text="Type of the resource definition referenced.",
33 choices=enum_to_list(RESOURE_TYPE),
36 vduId = serializers.CharField(
37 help_text="Reference to the related VDU in the VNFD applicable to this resource.",
42 resourceTemplateId = serializers.CharField(
43 help_text="Reference to a resource template(such as VnfVirtualLinkDesc) in the VNFD.",
48 resource = ResourceHandleSerializer(
49 help_text="Resource information for an existing resource.",
55 class ConstraintResourceRefSerializer(serializers.Serializer):
56 idType = serializers.ChoiceField(
57 help_text="The type of the identifier.",
58 choices=enum_to_list(RESOURCE_ID_TYPE),
61 resourceId = serializers.CharField(
62 help_text="An actual resource-management-level identifier(idType=RES_MGMT), or an identifier that references a ResourceDefinition(idType=GRANT).",
65 vimConnectionId = serializers.CharField(
71 resourceProviderId = serializers.CharField(
72 help_text="Identifier of the resource provider. It shall only be present when idType = RES_MGMT.",
79 class PlacementConstraintSerializer(serializers.Serializer):
80 affinityOrAntiAffinity = serializers.ChoiceField(
81 help_text="The type of the constraint.",
82 choices=enum_to_list(AFFINITY_OR_ANTIAFFIINTY),
85 scope = serializers.ChoiceField(
86 help_text="The scope of the placement constraint indicating the category of the place where the constraint applies.",
87 choices=enum_to_list(AFFINITY_OR_ANTIAFFIINTY_SCOPE),
90 resource = ConstraintResourceRefSerializer(
91 help_text="References to resources in the constraint rule.",
97 class VimConstraintSerializer(serializers.Serializer):
98 sameResourceGroup = serializers.BooleanField(
99 help_text="Set to true when the constraint applies not only to the same VIM connection, but also to the same infrastructure resource group.",
102 resource = ConstraintResourceRefSerializer(
103 help_text="References to resources in the constraint rule.",
109 # class LinkSerializer(serializers.Serializer):
110 # href = serializers.CharField(
111 # help_text="URI of the referenced resource.",
116 class GrantRequestLinksSerializer(serializers.Serializer):
117 vnfLcmOpOcc = LinkSerializer(
118 help_text="Related VNF lifecycle management operation occurrence.",
121 vnfInstance = LinkSerializer(
122 help_text="Related VNF instance.",
127 class GrantRequestSerializer(serializers.Serializer):
128 vnfInstanceId = serializers.CharField(
129 help_text="Identifier of the VNF instance which this grant request is related to.",
132 vnfLcmOpOccId = serializers.CharField(
133 help_text="The identifier of the VNF lifecycle management operation occurrence associated to the GrantRequest.",
134 required=False, # TODO required
138 vnfdId = serializers.CharField(
139 help_text="Identifier of the VNFD that defines the VNF for which the LCM operation is to be granted.",
140 required=False, # TODO required
144 flavourId = serializers.CharField(
145 help_text="Identifier of the VNF deployment flavour of the VNFD that defines the VNF for which the LCM operation is to be granted.",
150 operation = serializers.ChoiceField(
151 help_text="The lifecycle management operation for which granting is requested.",
152 choices=enum_to_list(GRANT_OPERATION),
155 isAutomaticInvocation = serializers.BooleanField(
156 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.",
159 instantiationLevelId = serializers.CharField(
160 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.",
165 addResources = ResourceDefinitionSerializer(
166 help_text="List of resource definitions in the VNFD for resources to be added by the LCM operation.",
170 tempResources = ResourceDefinitionSerializer(
171 help_text="List of resource definitions in the VNFD for resources to be temporarily instantiated during the runtime of the LCM operation.",
175 removeResources = ResourceDefinitionSerializer(
176 help_text="Provides the definitions of resources to be removed by the LCM operation.",
180 updateResources = ResourceDefinitionSerializer(
181 help_text="Provides the definitions of resources to be modified by the LCM operation.",
185 placementConstraints = PlacementConstraintSerializer(
186 help_text="Placement constraints that the VNFM may send to the NFVO in order to influence the resource placement decision.",
190 vimConstraints = VimConstraintSerializer(
191 help_text="Used by the VNFM to require that multiple resources are managed through the same VIM connection.",
195 additionalParams = serializers.DictField(
196 help_text="Additional parameters passed by the VNFM.",
197 # child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
201 _links = GrantRequestLinksSerializer(
202 help_text="Links to resources related to this request.",
203 required=False # TODO required
207 class VimConnectionInfoSerializer(serializers.Serializer):
208 id = serializers.CharField(
209 help_text="The identifier of the VIM Connection. This identifier is managed by the NFVO.",
212 vimId = serializers.CharField(
213 help_text="The identifier of the VIM instance. This identifier is managed by the NFVO.",
218 vimType = serializers.CharField(
219 help_text="Discriminator for the different types of the VIM information.",
224 interfaceInfo = serializers.DictField(
225 help_text="Information about the interface or interfaces to the VIM.",
226 child=serializers.CharField(help_text="Interface Info", allow_blank=True),
230 accessInfo = serializers.DictField(
231 help_text="Authentication credentials for accessing the VIM.",
232 child=serializers.CharField(help_text="Access Info", allow_blank=True),
236 extra = serializers.DictField(
237 help_text="VIM type specific additional information.",
238 child=serializers.CharField(help_text="Extra", allow_blank=True),
244 class ZoneInfoSerializer(serializers.Serializer):
245 id = serializers.CharField(
246 help_text="The identifier of this ZoneInfo instance, for the purpose of referencing it from other structures in the Grant structure.",
249 zoneId = serializers.CharField(
250 help_text="The identifier of the resource zone, as managed by the resource management layer(typically, the VIM).",
255 vimConnectionId = serializers.CharField(
256 help_text="Identifier of the connection to the VIM that manages the resource zone.",
261 resourceProviderId = serializers.CharField(
262 help_text="Identifies the entity responsible for the management the resource zone.",
269 class ZoneGroupInfoSerializer(serializers.Serializer):
270 zoneId = serializers.ListSerializer(
271 help_text="References of identifiers of ZoneInfo structures.",
272 child=serializers.CharField(help_text="IdentifierLocal", allow_blank=True),
278 class GrantInfoSerializer(serializers.Serializer):
279 resourceDefinitionId = serializers.CharField(
280 help_text="Identifier of the related ResourceDefinition from the related GrantRequest.",
283 reservationId = serializers.CharField(
284 help_text="The reservation identifier applicable to the VNFC/VirtualLink/VirtualStorage.",
289 vimConnectionId = serializers.CharField(
290 help_text="Identifier of the VIM connection to be used to manage this resource.",
295 resourceProviderId = serializers.CharField(
296 help_text="Identifies the entity responsible for the management of the virtualised resource.",
301 zoneId = serializers.CharField(
302 help_text="Reference to the identifier of the ZoneInfo in the Grant.",
307 resourceGroupId = serializers.CharField(
308 help_text="Identifier of the infrastructure resource group.",
315 class VimComputeResourceFlavourSerializer(serializers.Serializer):
316 vimConnectionId = serializers.CharField(
317 help_text="Identifier of the VIM connection to access the flavour referenced in this structure.",
322 resourceProviderId = serializers.CharField(
323 help_text="Identifies the entity responsible for the management of the virtualised resource.",
328 vnfdVirtualComputeDescId = serializers.CharField(
329 help_text="Identifier which references the virtual compute descriptor in the VNFD that maps to this flavour.",
334 vimFlavourId = serializers.CharField(
335 help_text="Identifier of the compute resource flavour in the resource management layer (i.e. VIM).",
342 class VimSoftwareImageSerializer(serializers.Serializer):
343 vimConnectionId = serializers.CharField(
344 help_text="Identifier of the VIM connection to access the flavour referenced in this structure.",
349 resourceProviderId = serializers.CharField(
350 help_text="Identifies the entity responsible for the management of the virtualised resource.",
355 vnfdSoftwareImageId = serializers.CharField(
356 help_text="Identifier which references the software image descriptor in the VNFD.",
361 vimSoftwareImageId = serializers.CharField(
362 help_text="Identifier of the software image in the resource management layer (i.e. VIM).",
369 class VimAssetsSerializer(serializers.Serializer):
370 computeResourceFlavours = VimComputeResourceFlavourSerializer(
371 help_text="Mappings between virtual compute descriptors defined in the VNFD and compute resource flavours managed in the VIM.",
375 softwareImages = VimSoftwareImageSerializer(
376 help_text="Mappings between software images defined in the VNFD and software images managed in the VIM.",
382 # class AddressRangeSerializer(serializers.Serializer):
383 # minAddress = serializers.CharField(
384 # help_text="Lowest IP address belonging to the range.",
387 # maxAddress = serializers.CharField(
388 # help_text="Highest IP address belonging to the range.",
393 class IpAddresseSerializer(serializers.Serializer):
394 type = serializers.ChoiceField(
395 help_text="The type of the IP addresses.",
396 choices=enum_to_list(IPADDRESSES_TYPE),
399 fixedAddresses = serializers.ListSerializer(
400 help_text="Fixed addresses to assign.",
401 child=serializers.CharField(help_text="IpAddress"),
405 numDynamicAddresses = serializers.IntegerField(
406 help_text="Number of dynamic addresses to assign.",
409 addressRange = AddressRangeSerializer(
410 help_text="An IP address range to be used, e.g. in case of egress connections.",
414 subnetId = serializers.CharField(
415 help_text="Subnet defined by the identifier of the subnet resource in the VIM.",
422 class IpOverEthernetAddressSerializer(serializers.Serializer):
423 macAddress = serializers.CharField(
424 help_text="MAC address.",
429 ipAddresses = IpAddresseSerializer(
430 help_text="List of IP addresses to assign to the CP instance.",
436 class CpProtocolDataConfigSerializer(serializers.Serializer):
437 layerProtocol = serializers.ChoiceField(
438 help_text="Identifier of layer(s) and protocol(s).",
439 choices=enum_to_list(LAYER_PROTOCOL),
442 ipOverEthernet = IpOverEthernetAddressSerializer(
443 help_text="Network address data for IP over Ethernet to assign to the extCP instance.",
449 class VnfExtCpConfigDataSerializer(serializers.Serializer):
450 cpInstanceId = serializers.CharField(
451 help_text="Identifier of the external CP instance to which this set of configuration parameters is requested to be applied.",
456 linkPortId = serializers.CharField(
457 help_text="Identifier of a pre-configured link port to which the external CP will be associated.",
462 cpProtocolData = CpProtocolDataConfigSerializer(
463 help_text="Parameters for configuring the network protocols on the link port that connects the CP to a VL.",
469 class VnfExtCpSerializer(serializers.Serializer):
470 cpdId = serializers.CharField(
471 help_text="The identifier of the CPD in the VNFD.",
474 cpConfig = VnfExtCpConfigDataSerializer(
475 help_text="List of instance data that need to be configured on the CP instances created from the respective CPD.",
481 class ExtLinkPortSerializer(serializers.Serializer):
482 id = serializers.CharField(
483 help_text="Identifier of this link port as provided by the entity that has created the link port.",
486 resourceHandle = serializers.CharField(
487 help_text="Reference to the virtualised resource realizing this link port.",
492 class ExtVirtualLinkSerializer(serializers.Serializer):
493 id = serializers.CharField(
494 help_text="The identifier of the external VL instance.",
497 vimConnectionId = serializers.CharField(
498 help_text="Identifier of the VIM connection to manage this resource.",
503 resourceProviderId = serializers.CharField(
504 help_text="Identifies the entity responsible for the management of this resource.",
509 resourceId = serializers.CharField(
510 help_text="The identifier of the resource in the scope of the VIM or the resource provider.",
513 extCps = VnfExtCpSerializer(
514 help_text="External CPs of the VNF to be connected to this external VL.",
518 extLinkPorts = ExtLinkPortSerializer(
519 help_text="Externally provided link ports to be used to connect external connection points to this external VL.",
525 class ExtManagedVirtualLinkSerializer(serializers.Serializer):
526 id = serializers.CharField(
527 help_text="The identifier of the externally-managed internal VL instance.",
530 virtualLinkDescId = serializers.CharField(
531 help_text="The identifier of the VLD in the VNFD for this VL.",
534 vimConnectionId = serializers.CharField(
535 help_text="Identifier of the VIM connection to manage this resource.",
540 resourceProviderId = serializers.CharField(
541 help_text="Identifies the entity responsible for the management of this resource.",
546 resourceId = serializers.CharField(
547 help_text="The identifier of the resource in the scope of the VIM or the resource provider.",
552 class GrantLinksSerializer(serializers.Serializer):
553 self = LinkSerializer(
554 help_text="URI of this resource.",
557 vnfLcmOpOcc = LinkSerializer(
558 help_text="Related VNF lifecycle management operation occurrence.",
561 vnfInstance = LinkSerializer(
562 help_text="Related VNF instance.",
567 class GrantSerializer(serializers.Serializer):
568 id = serializers.CharField(
569 help_text="Identifier of the grant.",
572 vnfInstanceId = serializers.CharField(
573 help_text="Identifier of the related VNF instance.",
576 vnfLcmOpOccId = serializers.CharField(
577 help_text="Identifier of the related VNF lifecycle management operation occurrence.",
578 required=False, # TODO required
582 vimConnections = VimConnectionInfoSerializer(
583 help_text="Provides information regarding VIM connections that are approved to be used by the VNFM to allocate resources.",
587 zones = ZoneInfoSerializer(
588 help_text="Identifies resource zones where the resources are approved to be allocated by the VNFM.",
592 zoneGroups = ZoneGroupInfoSerializer(
593 help_text="Information about groups of resource zones.",
597 computeReservationId = serializers.CharField(
598 help_text="Information that identifies a reservation applicable to the compute resource requirements.",
603 networkReservationId = serializers.CharField(
604 help_text="Information that identifies a reservation applicable to the network resource requirements.",
609 storageReservationId = serializers.CharField(
610 help_text="Information that identifies a reservation applicable to the storage resource requirements.",
615 addResources = GrantInfoSerializer(
616 help_text="List of resources that are approved to be added.",
620 tempResources = GrantInfoSerializer(
621 help_text="List of resources that are approved to be temporarily instantiated during the runtime of the lifecycle operation.",
625 removeResources = GrantInfoSerializer(
626 help_text="List of resources that are approved to be removed.",
630 updateResources = GrantInfoSerializer(
631 help_text="List of resources that are approved to be modified.",
635 vimAssets = VimAssetsSerializer(
636 help_text="Information about assets for the VNF that are managed by the NFVO in the VIM.",
640 extVirtualLinks = ExtVirtualLinkSerializer(
641 help_text="Information about external VLs to connect the VNF to.",
645 extManagedVirtualLinks = ExtManagedVirtualLinkSerializer(
646 help_text="Information about internal VLs that are managed by other entities than the VNFM.",
650 additionalParams = serializers.DictField(
651 help_text="Additional parameters passed by the NFVO, \
652 specific to the VNF and the LCM operation.",
653 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
657 _links = GrantLinksSerializer(
658 help_text="Links to resources related to this resource.",
663 class AffectedVnfcSerializer(serializers.Serializer):
664 id = serializers.CharField(
665 help_text="Identifier of the Vnfc instance.",
668 vduId = serializers.CharField(
669 help_text="Identifier of the related VDU in the VNFD.",
672 changeType = serializers.ChoiceField(
673 help_text="Signals the type of change.",
674 choices=enum_to_list(VNFC_CHANGE_TYPE),
677 computeResource = ResourceHandleSerializer(
678 help_text="Reference to the VirtualCompute resource.",
681 metadata = serializers.DictField(
682 help_text="Metadata about this resource.",
683 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
687 affectedVnfcCpIds = serializers.ListSerializer(
688 help_text="Identifiers of CP(s) of the VNFC instance that were affected by the change.",
689 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
693 addedStorageResourceIds = serializers.ListSerializer(
694 help_text="References to VirtualStorage resources that have been added.",
695 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
699 removedStorageResourceIds = serializers.ListSerializer(
700 help_text="References to VirtualStorage resources that have been removed.",
701 child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
707 class AffectedVirtualLinkSerializer(serializers.Serializer):
708 id = serializers.CharField(
709 help_text="Identifier of the virtual link instance.",
712 virtualLinkDescId = serializers.CharField(
713 help_text="Identifier of the related VLD in the VNFD.",
716 changeType = serializers.ChoiceField(
717 help_text="Signals the type of change.",
718 choices=enum_to_list(VL_CHANGE_TYPE),
721 networkResource = ResourceHandleSerializer(
722 help_text="Reference to the VirtualNetwork resource.",
726 metadata = serializers.DictField(
727 help_text="Metadata about this resource.",
728 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
734 class AffectedVirtualStorageSerializer(serializers.Serializer):
735 id = serializers.CharField(
736 help_text="Identifier of the storage instance.",
739 virtualStorageDescId = serializers.CharField(
740 help_text="Identifier of the related VirtualStorage descriptor in the VNFD.",
743 changeType = serializers.ChoiceField(
744 help_text="Signals the type of change.",
745 choices=enum_to_list(STORAGE_CHANGE_TYPE),
748 storageResource = ResourceHandleSerializer(
749 help_text="Reference to the VirtualStorage resource.",
753 metadata = serializers.DictField(
754 help_text="Metadata about this resource.",
755 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
761 class VnfInfoModificationsSerializer(serializers.Serializer):
762 vnfInstanceName = serializers.CharField(
763 help_text="If present, this attribute signals modifications of the vnfInstanceName attribute in VnfInstance.",
768 vnfInstanceDescription = serializers.CharField(
769 help_text="If present, this attribute signals modifications of the vnfInstanceDescription attribute in VnfInstance.",
774 vnfConfigurableProperties = serializers.DictField(
775 help_text="If present, this attribute signals modifications of the vnfConfigurableProperties attribute in VnfInstance.",
776 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
780 metadata = serializers.DictField(
781 help_text="If present, this attribute signals modifications of the metadata attribute in VnfInstance.",
782 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
786 extensions = serializers.DictField(
787 help_text="If present, this attribute signals modifications of the extensions attribute in VnfInstance.",
788 child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
792 vimConnectionInfo = VimConnectionInfoSerializer(
793 help_text="If present, this attribute signals modifications of the vimConnectionInfo attribute in VnfInstance.",
797 vnfPkgId = serializers.CharField(
798 help_text="If present, this attribute signals modifications of the vnfPkgId attribute in VnfInstance.",
803 vnfdId = serializers.CharField(
804 help_text="If present, this attribute signals modifications of the vnfdId attribute in VnfInstance.",
809 vnfProvider = serializers.CharField(
810 help_text="If present, this attribute signals modifications of the vnfProvider attribute in VnfInstance.",
815 vnfProductName = serializers.CharField(
816 help_text="If present, this attribute signals modifications of the vnfProductName attribute in VnfInstance.",
821 vnfSoftwareVersion = serializers.CharField(
822 help_text="If present, this attribute signals modifications of the vnfSoftwareVersion attribute in VnfInstance.",
827 vnfdVersion = serializers.CharField(
828 help_text="If present, this attribute signals modifications of the vnfdVersion attribute in VnfInstance.",
835 class ExtLinkPortInfoSerializer(serializers.Serializer):
836 id = serializers.CharField(
837 help_text="Identifier of this link port as provided by the entity that has created the link port.",
840 resourceHandle = ResourceHandleSerializer(
841 help_text="Reference to the virtualised resource realizing this link port.",
844 cpInstanceId = serializers.CharField(
845 help_text="Identifier of the external CP of the VNF connected to this link port.",
852 # class ExtVirtualLinkInfoSerializer(serializers.Serializer):
853 # id = serializers.CharField(
854 # help_text="Identifier of the external VL and the related external VL information instance.",
857 # resourceHandle = ResourceHandleSerializer(
858 # help_text="Reference to the resource realizing this VL.",
861 # extLinkPorts = ExtLinkPortInfoSerializer(
862 # help_text="Link ports of this VL.",
868 # class ProblemDetailsSerializer(serializers.Serializer):
869 # type = serializers.CharField(
870 # help_text="A URI reference according to IETF RFC 3986 [5] that identifies the problem type.",
875 # title = serializers.CharField(
876 # help_text="A short, human-readable summary of the problem type.",
881 # status = serializers.IntegerField(
882 # help_text="The HTTP status code for this occurrence of the problem.",
885 # detail = serializers.CharField(
886 # help_text="A human-readable explanation specific to this occurrence of the problem.",
889 # instance = serializers.CharField(
890 # help_text="A URI reference that identifies the specific occurrence of the problem.",
897 class LccnLinksSerializer(serializers.Serializer):
898 vnfInstance = LinkSerializer(
899 help_text="Link to the resource representing the VNF instance to which the notified change applies.",
902 subscription = LinkSerializer(
903 help_text="Link to the related subscription.",
906 vnfLcmOpOcc = LinkSerializer(
907 help_text="Link to the VNF lifecycle management operation occurrence that this notification is related to.",
913 class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
914 id = serializers.CharField(
915 help_text="Identifier of this notification.",
918 notificationType = serializers.ChoiceField(
919 help_text="Discriminator for the different notification types.",
920 choices=enum_to_list(VNF_NOTIFICATION_TYPE),
923 subscriptionId = serializers.CharField(
924 help_text="Identifier of the subscription that this notification relates to.",
927 timeStamp = serializers.CharField(
928 help_text="Date-time of the generation of the notification.",
931 notificationStatus = serializers.ChoiceField(
932 help_text="Indicates whether this notification reports about the start of a lifecycle operation or the result of a lifecycle operation.",
933 choices=enum_to_list(LCM_NOTIFICATION_STATUS),
936 operationState = serializers.ChoiceField(
937 help_text="The state of the VNF LCM operation occurrence.",
938 choices=enum_to_list(OPERATION_STATE_TYPE),
941 vnfInstanceId = serializers.CharField(
942 help_text="The identifier of the VNF instance affected.",
945 operation = serializers.ChoiceField(
946 help_text="The lifecycle management operation.",
947 choices=enum_to_list(GRANT_OPERATION),
950 isAutomaticInvocation = serializers.BooleanField(
951 help_text="Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM.",
954 vnfLcmOpOccId = serializers.CharField(
955 help_text="The identifier of the VNF lifecycle management operation occurrence associated to the notification.",
958 affectedVnfcs = AffectedVnfcSerializer(
959 help_text="Information about VNFC instances that were affected during the lifecycle operation.",
963 affectedVirtualLinks = AffectedVirtualLinkSerializer(
964 help_text="Information about VL instances that were affected during the lifecycle operation.",
968 affectedVirtualStorages = AffectedVirtualStorageSerializer(
969 help_text="Information about virtualised storage instances that were affected during the lifecycle operation.",
973 changedInfo = VnfInfoModificationsSerializer(
974 help_text="Information about the changed VNF instance information, including changed VNF configurable properties.",
978 changedExtConnectivity = ExtVirtualLinkInfoSerializer(
979 help_text="Information about changed external connectivity.",
983 error = ProblemDetailsSerializer(
984 help_text="Details of the latest error, if one has occurred during executing the LCM operation",
988 _links = LccnLinksSerializer(
989 help_text="Links to resources related to this notification.",
995 class VnfIdentifierCreationNotificationSerializer(serializers.Serializer):
996 id = serializers.CharField(
997 help_text="Identifier of this notification. \
998 If a notification is sent multiple times due to multiple subscriptions, \
999 the id attribute of all these notifications shall have the same value.",
1004 notificationType = serializers.ChoiceField(
1005 help_text="Discriminator for the different notification types.",
1006 choices=enum_to_list(VNF_NOTIFICATION_TYPE),
1009 subscriptionId = serializers.CharField(
1010 help_text="Identifier of the subscription that this notification relates to.",
1015 timeStamp = serializers.DateTimeField(
1016 help_text="Date-time of the generation of the notification.",
1020 vnfInstanceId = serializers.CharField(
1021 help_text="The created VNF instance identifier.",
1026 _links = LccnLinksSerializer(
1027 help_text="Links to resources related to this notification.",
1033 class VnfIdentifierDeletionNotificationSerializer(serializers.Serializer):
1034 id = serializers.CharField(
1035 help_text="Identifier of this notification. \
1036 If a notification is sent multiple times due to multiple subscriptions, \
1037 the id attribute of all these notifications shall have the same value.",
1042 notificationType = serializers.ChoiceField(
1043 help_text="Discriminator for the different notification types.",
1044 choices=enum_to_list(VNF_NOTIFICATION_TYPE),
1047 subscriptionId = serializers.CharField(
1048 help_text="Identifier of the subscription that this notification relates to.",
1053 timeStamp = serializers.DateTimeField(
1054 help_text="Date-time of the generation of the notification.",
1058 vnfInstanceId = serializers.CharField(
1059 help_text="The deleted VNF instance identifier.",
1064 _links = LccnLinksSerializer(
1065 help_text="Links to resources related to this notification.",