summaryrefslogtreecommitdiffstats
path: root/zte/vmanager
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-27 09:09:30 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-27 09:55:57 +0800
commit93ff9fa6d86bde40a8982c7ebaea19f0d299b567 (patch)
treee93e16ecd04d2dab44d292e4689f3fd5e85edc37 /zte/vmanager
parent17088b6ddaadea95047edc5ea0ca6b894a3e99e2 (diff)
Add vfc-ztevnfmdriver samples swagger
Change-Id: Ibad2f83f6427aaf1a1b9cc0a2580d1a34884ba27 Issue-ID: VFC-736 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'zte/vmanager')
-rw-r--r--zte/vmanager/driver/interfaces/urls.py2
-rw-r--r--zte/vmanager/driver/interfaces/views.py11
2 files changed, 8 insertions, 5 deletions
diff --git a/zte/vmanager/driver/interfaces/urls.py b/zte/vmanager/driver/interfaces/urls.py
index ee7b07e6..e32e53ea 100644
--- a/zte/vmanager/driver/interfaces/urls.py
+++ b/zte/vmanager/driver/interfaces/urls.py
@@ -30,5 +30,5 @@ urlpatterns = [
views.Scale.as_view(), name='scale'),
url(r'^api/ztevnfmdriver/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<vnfInstanceId>[0-9a-zA-Z\-\_]+)/heal$',
views.Heal.as_view(), name='heal'),
- url(r'^samples/$', views.samples, name='samples')
+ url(r'^samples/$', views.SampleList.as_view(), name='samples')
]
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py
index 716f83e3..5a978c63 100644
--- a/zte/vmanager/driver/interfaces/views.py
+++ b/zte/vmanager/driver/interfaces/views.py
@@ -21,7 +21,6 @@ import traceback
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import status
-from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
@@ -612,6 +611,10 @@ def get_vdus(nf_model, aspect_id):
return members
-@api_view(http_method_names=['GET'])
-def samples(request, *args, **kwargs):
- return Response(data={"status": "ok"})
+class SampleList(APIView):
+ @swagger_auto_schema(
+ responses={
+ status.HTTP_200_OK: 'Successfully'})
+ def get(self, request):
+ logger.debug("get")
+ return Response({"status": "active"})