2016-11-20 04:18:44 +00:00
|
|
|
# ~*~ coding: utf-8 ~*~
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from django.conf.urls import url, include
|
|
|
|
|
|
|
|
|
|
|
|
from api import views as api_view
|
|
|
|
import views as mvc_view
|
|
|
|
|
|
|
|
|
|
|
|
app_name = 'ops'
|
|
|
|
|
|
|
|
router = DefaultRouter()
|
2016-11-20 08:22:41 +00:00
|
|
|
router.register(r'host_alia', api_view.HostAliaViewSet)
|
|
|
|
router.register(r'user_alia', api_view.UserAliaViewSet)
|
|
|
|
router.register(r'cmd_alia', api_view.CmdAliaViewSet)
|
|
|
|
router.register(r'runas_alia', api_view.RunasAliaViewSet)
|
|
|
|
router.register(r'extra_conf', api_view.ExtraconfViewSet)
|
|
|
|
router.register(r'privilege', api_view.PrivilegeViewSet)
|
|
|
|
router.register(r'sudo', api_view.SudoViewSet)
|
2016-11-20 04:18:44 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
# Resource Sudo url
|
2016-11-20 06:48:18 +00:00
|
|
|
url(r'^sudo/list$', mvc_view.SudoListView.as_view(), name='sudo-list'),
|
|
|
|
url(r'^sudo/create$', mvc_view.SudoCreateView.as_view(), name='sudo-create'),
|
|
|
|
url(r'^sudo/detail$', mvc_view.SudoDetailView.as_view(), name='sudo-detail'),
|
|
|
|
url(r'^sudo/update$', mvc_view.SudoUpdateView.as_view(), name='sudo-update'),
|
2016-11-20 04:18:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
urlpatterns += [
|
2016-11-20 08:22:41 +00:00
|
|
|
url(r'^v1/sudo', include(router.urls)),
|
2016-11-20 04:18:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|