9608 add peer_device, peer_interface back

This commit is contained in:
Arthur 2023-01-19 16:38:43 -08:00
parent bab1ce77e5
commit 9a56a9f8f6
2 changed files with 14 additions and 9 deletions

View File

@ -2,9 +2,8 @@ import socket
from django.http import Http404, HttpResponse, HttpResponseForbidden from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from drf_yasg import openapi from drf_spectacular.utils import OpenApiParameter
from drf_yasg.openapi import Parameter from drf_spectacular.types import OpenApiTypes
from drf_yasg.utils import swagger_auto_schema
from rest_framework.decorators import action from rest_framework.decorators import action
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.routers import APIRootView from rest_framework.routers import APIRootView
@ -727,19 +726,19 @@ class ConnectedDeviceViewSet(ViewSet):
* `peer_interface`: The name of the peer interface * `peer_interface`: The name of the peer interface
""" """
permission_classes = [IsAuthenticatedOrLoginNotRequired] permission_classes = [IsAuthenticatedOrLoginNotRequired]
_device_param = Parameter( _device_param = OpenApiParameter(
name='peer_device', name='peer_device',
in_='query', location='query',
description='The name of the peer device', description='The name of the peer device',
required=True, required=True,
type=openapi.TYPE_STRING type=OpenApiTypes.STR
) )
_interface_param = Parameter( _interface_param = OpenApiParameter(
name='peer_interface', name='peer_interface',
in_='query', location='query',
description='The name of the peer interface', description='The name of the peer interface',
required=True, required=True,
type=openapi.TYPE_STRING type=OpenApiTypes.STR
) )
def get_view_name(self): def get_view_name(self):

View File

@ -568,6 +568,12 @@ REST_FRAMEWORK = {
'VIEW_NAME_FUNCTION': 'utilities.api.get_view_name', 'VIEW_NAME_FUNCTION': 'utilities.api.get_view_name',
} }
#
# DRF Spectacular
#
SPECTACULAR_SETTINGS = {
}
# #
# Graphene # Graphene