Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a588c8f8
authored
Apr 26, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: host listing added
parent
abb28742
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
firewall_gui/views.py
+27
-0
No files found.
firewall_gui/views.py
View file @
a588c8f8
...
@@ -50,3 +50,30 @@ def list_rules(request):
...
@@ -50,3 +50,30 @@ def list_rules(request):
}
for
rule
in
Rule
.
objects
.
all
()]
}
for
rule
in
Rule
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
rules
),
content_type
=
"application/json"
)
return
HttpResponse
(
json
.
dumps
(
rules
),
content_type
=
"application/json"
)
def
list_hosts
(
request
):
hosts
=
[{
"id"
:
host
.
id
,
"reverse"
:
host
.
reverse
,
"name"
:
host
.
hostname
,
"ipv4"
:
host
.
ipv4
,
"pub"
:
"foo"
,
#ide kell valami!
"shared_ip"
:
host
.
shared_ip
,
"description"
:
host
.
description
,
"comment"
:
host
.
comment
,
"location"
:
host
.
location
,
"vlan"
:
{
"name"
:
host
.
vlan
.
name
,
"id"
:
host
.
vlan
.
id
},
"owner"
:
{
"name"
:
str
(
host
.
owner
),
"id"
:
host
.
owner
.
id
},
"created_at"
:
host
.
created_at
.
isoformat
(),
"modified_at"
:
host
.
modified_at
.
isoformat
(),
"groups"
:
[{
"name"
:
group
.
name
,
"id"
:
group
.
id
,
}
for
group
in
host
.
groups
.
all
()]
}
for
host
in
Host
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
hosts
),
content_type
=
"application/json"
)
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