2016-11-20 04:18:44 +00:00
|
|
|
# ~*~ coding: utf-8 ~*~
|
|
|
|
from __future__ import unicode_literals
|
2016-11-24 14:34:55 +00:00
|
|
|
from rest_framework import viewsets
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
from serializers import *
|
2016-11-20 08:22:41 +00:00
|
|
|
from permissions import *
|
|
|
|
|
2016-12-11 04:05:11 +00:00
|
|
|
__all__ = ["HostAliaViewSet",
|
|
|
|
"CmdAliaViewSet",
|
|
|
|
"UserAliaViewSet",
|
|
|
|
"RunasAliaViewSet",
|
|
|
|
"ExtraconfViewSet",
|
|
|
|
"PrivilegeViewSet",
|
|
|
|
"SudoViewSet",
|
|
|
|
"CronTableViewSet",
|
2016-12-19 06:07:21 +00:00
|
|
|
"TaskViewSet",
|
2016-12-19 15:46:03 +00:00
|
|
|
"SubTaskViewSet",
|
2016-12-11 04:05:11 +00:00
|
|
|
]
|
|
|
|
|
2016-11-20 04:18:44 +00:00
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class HostAliaViewSet(viewsets.ModelViewSet):
|
2016-11-20 04:18:44 +00:00
|
|
|
queryset = HostAlia.objects.all()
|
|
|
|
serializer_class = HostAliaSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class CmdAliaViewSet(viewsets.ModelViewSet):
|
2016-11-20 04:18:44 +00:00
|
|
|
queryset = CmdAlia.objects.all()
|
|
|
|
serializer_class = CmdAliaSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class UserAliaViewSet(viewsets.ModelViewSet):
|
2016-11-20 04:18:44 +00:00
|
|
|
queryset = UserAlia.objects.all()
|
|
|
|
serializer_class = UserAliaSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class RunasAliaViewSet(viewsets.ModelViewSet):
|
2016-11-20 04:18:44 +00:00
|
|
|
queryset = RunasAlia.objects.all()
|
|
|
|
serializer_class = RunasAliaSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class ExtraconfViewSet(viewsets.ModelViewSet):
|
2016-11-20 04:18:44 +00:00
|
|
|
queryset = Extra_conf.objects.all()
|
|
|
|
serializer_class = ExtraconfSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class PrivilegeViewSet(viewsets.ModelViewSet):
|
2016-11-20 06:48:18 +00:00
|
|
|
queryset = Privilege.objects.all()
|
|
|
|
serializer_class = PrivilegeSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 06:48:18 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class SudoViewSet(viewsets.ModelViewSet):
|
2016-11-20 06:48:18 +00:00
|
|
|
queryset = Sudo.objects.all()
|
|
|
|
serializer_class = SudoSerializer
|
2016-11-20 08:22:41 +00:00
|
|
|
permission_classes = (AdminUserRequired,)
|
2016-11-20 06:48:18 +00:00
|
|
|
|
|
|
|
|
2016-11-24 14:34:55 +00:00
|
|
|
class CronTableViewSet(viewsets.ModelViewSet):
|
2016-11-22 02:41:18 +00:00
|
|
|
queryset = CronTable.objects.all()
|
|
|
|
serializer_class = CronTableSerializer
|
|
|
|
permission_classes = (AdminUserRequired,)
|
|
|
|
|
2016-12-19 06:07:21 +00:00
|
|
|
class TaskViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = Task.objects.all()
|
|
|
|
serializer_class = TaskSerializer
|
|
|
|
permission_classes = (AdminUserRequired,)
|
|
|
|
|
2016-12-19 15:46:03 +00:00
|
|
|
class SubTaskViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = SubTask.objects.all()
|
|
|
|
serializer_class = SubTaskSerializer
|
|
|
|
permission_classes = (AdminUserRequired,)
|
|
|
|
|
2016-11-22 02:41:18 +00:00
|
|
|
|
2016-11-20 06:48:18 +00:00
|
|
|
|