You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/apps/settings/api/sms.py

23 lines
587 B

from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from common.permissions import IsSuperUser
from common.message.backends.sms import BACKENDS
from settings.serializers.sms import SMSBackendSerializer
class SMSBackendAPI(ListAPIView):
permission_classes = (IsSuperUser,)
serializer_class = SMSBackendSerializer
def list(self, request, *args, **kwargs):
data = [
{
'name': b,
'label': b.label
}
for b in BACKENDS
]
return Response(data)