summaryrefslogtreecommitdiffstats
path: root/zte/vmanager
diff options
context:
space:
mode:
Diffstat (limited to 'zte/vmanager')
-rw-r--r--zte/vmanager/driver/interfaces/serializers.py46
-rw-r--r--zte/vmanager/driver/interfaces/views.py8
2 files changed, 53 insertions, 1 deletions
diff --git a/zte/vmanager/driver/interfaces/serializers.py b/zte/vmanager/driver/interfaces/serializers.py
index b549b364..9384b21f 100644
--- a/zte/vmanager/driver/interfaces/serializers.py
+++ b/zte/vmanager/driver/interfaces/serializers.py
@@ -499,3 +499,49 @@ class SubscribeRespSerializer(serializers.Serializer):
max_length=255,
required=True,
allow_null=True)
+
+
+class VnfPkgSerializer(serializers.Serializer):
+ packageid = serializers.CharField(
+ help_text="packageid",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ vendor = serializers.CharField(
+ help_text="vendor",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ type = serializers.CharField(
+ help_text="type",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ vnfdfile = serializers.CharField(
+ help_text="vnfdfile",
+ max_length=255,
+ required=False,
+ allow_null=True)
+ imagefiles = serializers.ListSerializer(
+ help_text='imagefiles',
+ child=serializers.CharField(help_text='imagefile', required=True),
+ required=False,
+ allow_null=True)
+ swfiles = serializers.ListSerializer(
+ help_text='swfiles',
+ child=serializers.CharField(help_text='swfile', required=True),
+ required=False,
+ allow_null=True)
+ description = serializers.CharField(
+ help_text="description",
+ max_length=255,
+ required=False,
+ allow_null=True)
+
+
+class VnfPkgsSerializer(serializers.Serializer):
+ data = VnfPkgSerializer(
+ help_text="Vnf package",
+ many=True,
+ required=False,
+ allow_null=True)
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py
index 1c4625d5..292e7488 100644
--- a/zte/vmanager/driver/interfaces/views.py
+++ b/zte/vmanager/driver/interfaces/views.py
@@ -28,7 +28,7 @@ from django.http import StreamingHttpResponse
from driver.interfaces.serializers import HealReqSerializer, InstScaleHealRespSerializer, ScaleReqSerializer, \
NotifyReqSerializer, GrantRespSerializer, GrantReqSerializer, JobQueryRespSerializer, TerminateVnfRequestSerializer, \
InstantiateVnfRequestSerializer, QueryVnfResponseSerializer, SubscribesRespSerializer, \
- SubscribeReqSerializer, SubscribeRespSerializer
+ SubscribeReqSerializer, SubscribeRespSerializer, VnfPkgsSerializer
from driver.pub.config.config import VNF_FTP
from driver.pub.utils import restcall
from driver.pub.utils.restcall import req_by_msb
@@ -675,6 +675,12 @@ class SubscribeDetail(APIView):
class VnfPkgs(APIView):
+ @swagger_auto_schema(
+ responses={
+ status.HTTP_200_OK: VnfPkgsSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: "Internal error"
+ }
+ )
def get(self, request):
logger.debug("====VnfPkgs get====")
resp_data = {