Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d1d3fba5
authored
Jul 12, 2019
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test data from the view
parent
f99a7459
Pipeline
#765
failed with stages
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
recircle/instance/views.py
+7
-15
No files found.
recircle/instance/views.py
View file @
d1d3fba5
...
@@ -19,30 +19,22 @@ class InstanceList(APIView):
...
@@ -19,30 +19,22 @@ class InstanceList(APIView):
def
post
(
self
,
request
,
format
=
None
):
def
post
(
self
,
request
,
format
=
None
):
data
=
request
.
data
data
=
request
.
data
template
=
InstanceTemplate
(
template
=
InstanceTemplate
.
objects
.
get
(
pk
=
data
[
"template"
])
name
=
"test1"
,
description
=
"adsasdasd"
,
flavor
=
Flavor
.
objects
.
get
(
pk
=
data
[
"flavor"
])
remote_ID
=
"da51253f-867c-472d-8ce0-81e7b7126d60"
)
lease
=
lease
.
objects
.
get
(
pk
=
data
[
"lease"
])
flavor
=
Flavor
(
name
=
"asd"
,
description
=
"asd"
,
remote_id
=
"1"
)
flavor
.
save
()
lease
=
Lease
(
name
=
"test_lease"
,
description
=
"test"
,
suspend_interval_in_sec
=
100
,
delete_interval_in_sec
=
100
)
lease
.
save
()
newInstance
=
Instance
.
create_instance_from_template
(
newInstance
=
Instance
.
create_instance_from_template
(
params
=
{
"name"
:
data
[
"name"
],
params
=
{
"name"
:
data
[
"name"
],
"description"
:
data
[
"description"
],
"description"
:
data
[
"description"
],
"access_method"
:
"ssh"
,
"access_method"
:
data
[
"access"
]
,
"system"
:
data
[
"system"
],
"system"
:
data
[
"system"
],
"deleted"
:
False
,
"password"
:
"asd"
,
},
},
lease
=
lease
,
lease
=
lease
,
networks
=
[{
"uuid"
:
"c03d0d4b-413e-4cc6-9ebe-c0b5ca0dac3a"
}]
,
networks
=
template
.
networks
,
template
=
template
,
template
=
template
,
flavor
=
flavor
,
flavor
=
flavor
,
owner
=
User
.
objects
.
get
(
pk
=
1
)
,
owner
=
request
.
user
,
disks
=
"asdasd"
disks
=
template
.
disks
)
)
return
Response
(
newInstance
.
pk
)
return
Response
(
newInstance
.
pk
)
...
...
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