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
081af2f9
Commit
081af2f9
authored
Oct 09, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proxy log api for create or update
parent
0c8922e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
api.py
apps/audits/api.py
+9
-1
models.py
apps/audits/models.py
+1
-0
urls.py
apps/audits/urls.py
+3
-2
No files found.
apps/audits/api.py
View file @
081af2f9
...
...
@@ -6,8 +6,16 @@ from rest_framework import generics
import
serializers
from
.models
import
ProxyLog
class
ProxyLogCreateApi
(
generics
.
CreateAPIView
):
class
ProxyLogListCreateApi
(
generics
.
ListCreateAPIView
):
queryset
=
ProxyLog
.
objects
.
all
()
serializer_class
=
serializers
.
ProxyLogSerializer
class
ProxyLogDetailApi
(
generics
.
RetrieveUpdateDestroyAPIView
):
queryset
=
ProxyLog
.
objects
.
all
()
serializer_class
=
serializers
.
ProxyLogSerializer
...
...
apps/audits/models.py
View file @
081af2f9
...
...
@@ -40,6 +40,7 @@ class ProxyLog(models.Model):
system_user
=
models
.
CharField
(
max_length
=
20
,
verbose_name
=
_
(
'System user'
))
login_type
=
models
.
CharField
(
choices
=
LOGIN_TYPE_CHOICE
,
max_length
=
1
,
verbose_name
=
_
(
'Login type'
))
log_file
=
models
.
CharField
(
max_length
=
1000
,
blank
=
True
,
null
=
True
)
was_failed
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
'Did connect failed'
))
is_finished
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
'Is finished'
))
date_start
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
_
(
'Date start'
))
date_finished
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
_
(
'Date finished'
))
...
...
apps/audits/urls.py
View file @
081af2f9
...
...
@@ -11,6 +11,7 @@ urlpatterns = [
urlpatterns
+=
[
url
(
r'^v1/proxy-log$'
,
api
.
ProxyLogCreateApi
.
as_view
(),
name
=
'proxy-log-create-api'
),
url
(
r'^v1/command-log$'
,
api
.
CommandLogCreateApi
.
as_view
(),
name
=
'command-log-create-api'
),
url
(
r'^v1/proxy-log/$'
,
api
.
ProxyLogListCreateApi
.
as_view
(),
name
=
'proxy-log-list-create-api'
),
url
(
r'^v1/proxy-log/(?P<pk>\d+)/$'
,
api
.
ProxyLogDetailApi
.
as_view
(),
name
=
'proxy-log-detail-api'
),
url
(
r'^v1/command-log/$'
,
api
.
CommandLogCreateApi
.
as_view
(),
name
=
'command-log-create-api'
),
]
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