From: fujinhua Date: Mon, 5 Mar 2018 08:07:01 +0000 (+0800) Subject: Add Resource Handle Serializer of Grant Req X-Git-Tag: v1.1.0~96^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F33997%2F1;p=vfc%2Fnfvo%2Flcm.git Add Resource Handle Serializer of Grant Req Change-Id: I7b88ec635b210db8676c95df800d7272cddebfba Issue-ID: VFC-779 Signed-off-by: fujinhua --- diff --git a/lcm/v2/serializers.py b/lcm/v2/serializers.py index d8efb3e1..417282ee 100644 --- a/lcm/v2/serializers.py +++ b/lcm/v2/serializers.py @@ -15,6 +15,31 @@ 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 + ) + + class ResourceDefinitionSerializer(serializers.Serializer): id = serializers.CharField( help_text="Identifier of this ResourceDefinition, unique at least within the scope of the GrantRequest.", @@ -37,6 +62,11 @@ class ResourceDefinitionSerializer(serializers.Serializer): allow_null=True, allow_blank=True ) + resource = ResourceHandleSerializer( + help_text="Resource information for an existing resource.", + required=False, + allow_null=True + ) class GrantRequestSerializer(serializers.Serializer):