Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
2494fa58
Commit
2494fa58
authored
Nov 24, 2016
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改url
parent
984391e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
50 deletions
+10
-50
urls.py
apps/jumpserver/urls.py
+1
-1
views.py
apps/ops/api/views.py
+9
-49
No files found.
apps/jumpserver/urls.py
View file @
2494fa58
...
...
@@ -42,7 +42,7 @@ urlpatterns = [
urlpatterns
+=
[
url
(
r'^api/v1/ops'
,
include
(
router
.
urls
)),
url
(
r'^ops/'
,
include
(
'ops.urls'
)),
url
(
r'^ops/'
,
include
(
'ops.urls'
,
namespace
=
'ops'
)),
]
if
settings
.
DEBUG
:
...
...
apps/ops/api/views.py
View file @
2494fa58
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
from
rest_framework
import
viewsets
,
mixins
from
rest_framework
import
viewsets
from
serializers
import
*
from
permissions
import
*
class
HostAliaViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
HostAliaViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
HostAlia
.
objects
.
all
()
serializer_class
=
HostAliaSerializer
permission_classes
=
(
AdminUserRequired
,)
class
CmdAliaViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
CmdAliaViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
CmdAlia
.
objects
.
all
()
serializer_class
=
CmdAliaSerializer
permission_classes
=
(
AdminUserRequired
,)
class
UserAliaViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
UserAliaViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
UserAlia
.
objects
.
all
()
serializer_class
=
UserAliaSerializer
permission_classes
=
(
AdminUserRequired
,)
class
RunasAliaViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
RunasAliaViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
RunasAlia
.
objects
.
all
()
serializer_class
=
RunasAliaSerializer
permission_classes
=
(
AdminUserRequired
,)
class
ExtraconfViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
ExtraconfViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Extra_conf
.
objects
.
all
()
serializer_class
=
ExtraconfSerializer
permission_classes
=
(
AdminUserRequired
,)
class
PrivilegeViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
PrivilegeViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Privilege
.
objects
.
all
()
serializer_class
=
PrivilegeSerializer
permission_classes
=
(
AdminUserRequired
,)
class
SudoViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
SudoViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Sudo
.
objects
.
all
()
serializer_class
=
SudoSerializer
permission_classes
=
(
AdminUserRequired
,)
class
CronTableViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
ListModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
DestroyModelMixin
,
viewsets
.
GenericViewSet
):
class
CronTableViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
CronTable
.
objects
.
all
()
serializer_class
=
CronTableSerializer
permission_classes
=
(
AdminUserRequired
,)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment