From: tianxing <15210838572@139.com> Date: Mon, 18 Mar 2019 07:17:00 +0000 (+0800) Subject: Fix serialization bug of nslcm X-Git-Tag: 1.3.0~124 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c3dae07e482b87daa1bff52da36557cc36b8e299;hp=2be6623d01ec16b178ff1554af98430cf8bb95cb;p=vfc%2Fnfvo%2Flcm.git Fix serialization bug of nslcm Change-Id: I156f698a398f9c3ca0dfe907a3c3b0cd9df0d1d9 Issue-ID: VFC-1270 Signed-off-by: tianxing <15210838572@139.com> --- diff --git a/lcm/ns_vnfs/serializers/grant_vnf_serializer.py b/lcm/ns_vnfs/serializers/grant_vnf_serializer.py index 43ff5f0b..e77a091a 100644 --- a/lcm/ns_vnfs/serializers/grant_vnf_serializer.py +++ b/lcm/ns_vnfs/serializers/grant_vnf_serializer.py @@ -13,31 +13,32 @@ # limitations under the License. from rest_framework import serializers - - -class ResourceHandleSerializer(serializers.Serializer): - vimConnectionId = serializers.CharField( - help_text="Identifier of the VIM connection to manage the resource.", - required=False, - allow_null=True, - allow_blank=True - ) - resourceProviderId = serializers.CharField( - help_text="Identifier of the entity responsible for the management of the resource.", - required=False, - allow_null=True, - allow_blank=True - ) - resourceId = serializers.CharField( - help_text="Identifier of the resource in the scope of the VIM or the resource provider.", - required=True - ) - vimLevelResourceType = serializers.CharField( - help_text="Type of the resource in the scope of the VIM or the resource provider.", - required=False, - allow_null=True, - allow_blank=True - ) +from lcm.ns.serializers.resource_handle import ResourceHandleSerializer +from lcm.ns.serializers.link import linkSerializer + +# class ResourceHandleSerializer(serializers.Serializer): +# vimConnectionId = serializers.CharField( +# help_text="Identifier of the VIM connection to manage the resource.", +# required=False, +# allow_null=True, +# allow_blank=True +# ) +# resourceProviderId = serializers.CharField( +# help_text="Identifier of the entity responsible for the management of the resource.", +# required=False, +# allow_null=True, +# allow_blank=True +# ) +# resourceId = serializers.CharField( +# help_text="Identifier of the resource in the scope of the VIM or the resource provider.", +# required=True +# ) +# vimLevelResourceType = serializers.CharField( +# help_text="Type of the resource in the scope of the VIM or the resource provider.", +# required=False, +# allow_null=True, +# allow_blank=True +# ) class ResourceDefinitionSerializer(serializers.Serializer): @@ -123,19 +124,19 @@ class VimConstraintSerializer(serializers.Serializer): ) -class LinkSerializer(serializers.Serializer): - href = serializers.CharField( - help_text="URI of the referenced resource.", - required=True - ) +# class LinkSerializer(serializers.Serializer): +# href = serializers.CharField( +# help_text="URI of the referenced resource.", +# required=True +# ) class GrantRequestLinksSerializer(serializers.Serializer): - vnfLcmOpOcc = LinkSerializer( + vnfLcmOpOcc = linkSerializer( help_text="Related VNF lifecycle management operation occurrence.", required=True ) - vnfInstance = LinkSerializer( + vnfInstance = linkSerializer( help_text="Related VNF instance.", required=True ) @@ -567,15 +568,15 @@ class ExtManagedVirtualLinkSerializer(serializers.Serializer): class GrantLinksSerializer(serializers.Serializer): - self = LinkSerializer( + self = linkSerializer( help_text="URI of this resource.", required=True ) - vnfLcmOpOcc = LinkSerializer( + vnfLcmOpOcc = linkSerializer( help_text="Related VNF lifecycle management operation occurrence.", required=True ) - vnfInstance = LinkSerializer( + vnfInstance = linkSerializer( help_text="Related VNF instance.", required=True ) @@ -912,15 +913,15 @@ class ProblemDetailsSerializer(serializers.Serializer): class LccnLinksSerializer(serializers.Serializer): - vnfInstance = LinkSerializer( + vnfInstance = linkSerializer( help_text="Link to the resource representing the VNF instance to which the notified change applies.", required=True ) - subscription = LinkSerializer( + subscription = linkSerializer( help_text="Link to the related subscription.", required=True ) - vnfLcmOpOcc = LinkSerializer( + vnfLcmOpOcc = linkSerializer( help_text="Link to the VNF lifecycle management operation occurrence that this notification is related to.", required=False, allow_null=True