oncall-engine/engine/apps/public_api/views/info.py
Innokentii Konstantinov af06d6491b Add info throttler
2022-06-08 18:25:58 +04:00

17 lines
551 B
Python

from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from apps.auth_token.auth import ApiTokenAuthentication
from apps.public_api.throttlers import InfoThrottler
class InfoView(APIView):
authentication_classes = (ApiTokenAuthentication,)
permission_classes = (IsAuthenticated,)
throttle_classes = [InfoThrottler]
def get(self, request):
response = {"url": self.request.auth.organization.grafana_url}
return Response(response)