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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
34b69cf4
authored
Oct 30, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: create instance and deploy it
parent
40056847
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
circle/dashboard/views.py
+11
-0
No files found.
circle/dashboard/views.py
View file @
34b69cf4
...
...
@@ -122,9 +122,20 @@ class VmCreate(TemplateView):
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
if
self
.
request
.
user
.
is_authenticated
():
user
=
self
.
request
.
user
else
:
user
=
None
resp
=
request
.
POST
.
copy
()
resp
[
'managed-vlans'
]
=
request
.
POST
.
getlist
(
'managed-vlans'
)
resp
[
'unmanaged-vlans'
]
=
request
.
POST
.
getlist
(
'unmanaged-vlans'
)
resp
[
'disks'
]
=
request
.
POST
.
getlist
(
'disks'
)
template
=
InstanceTemplate
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
'template-pk'
))
inst
=
Instance
.
create_from_template
(
template
=
template
,
owner
=
user
)
inst
.
deploy_async
()
# TODO handle response
return
HttpResponse
(
json
.
dumps
(
resp
),
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