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
e77cbe27
authored
Dec 02, 2020
by
Belákovics Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add network fix and vnc console
parent
b7d22c8a
Pipeline
#1381
failed with stages
in 42 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
2 deletions
+12
-2
recircle/instance/models.py
+3
-0
recircle/instance/views.py
+6
-1
recircle/interface_openstack
+1
-1
recircle/template/models.py
+1
-0
recircle/template/views.py
+1
-0
No files found.
recircle/instance/models.py
View file @
e77cbe27
...
...
@@ -282,6 +282,9 @@ class Instance(BaseMachineDescriptor):
self
.
description
=
new_description
self
.
save
()
def
get_vnc_console
(
self
):
return
interface
.
get_vnc_console
(
self
.
remote_id
)
def
destroy
(
self
):
self
.
deleted
=
True
self
.
save
()
recircle/instance/views.py
View file @
e77cbe27
...
...
@@ -122,7 +122,7 @@ class InstanceViewSet(AuthorizationMixin, ViewSet):
instance
.
destroy
()
return
Response
(
status
=
status
.
HTTP_204_NO_CONTENT
)
@action
(
detail
=
True
,
methods
=
[
"
post
"
])
@action
(
detail
=
True
,
methods
=
[
"
POST
"
])
def
template
(
self
,
request
,
pk
):
instance
=
self
.
get_object
(
pk
)
if
not
self
.
has_perms_for_model
(
request
.
user
,
'template'
):
...
...
@@ -166,6 +166,11 @@ class InstanceViewSet(AuthorizationMixin, ViewSet):
else
:
return
Response
(
data
=
"No new lease provided"
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
@action
(
detail
=
True
,
methods
=
[
"GET"
])
def
get_vnc_console
(
self
,
request
,
pk
):
instance
=
self
.
get_object
(
pk
)
return
Response
(
data
=
instance
.
get_vnc_console
())
@action
(
detail
=
True
,
methods
=
[
"POST"
])
def
resize
(
self
,
request
,
pk
):
pass
...
...
interface_openstack
@
0b5dc350
Subproject commit
cc7bd247b4457b1020c6442a6c944e1c3ba0caff
Subproject commit
0b5dc350a10e6f6805815acb5c91f98d307bad32
recircle/template/models.py
View file @
e77cbe27
...
...
@@ -29,5 +29,6 @@ class ImageTemplate(BaseMachineDescriptor):
access_protocol
=
instance
.
access_protocol
,
lease
=
instance
.
lease
,
flavor
=
instance
.
flavor
,
network_id
=
instance
.
network_id
,
type
=
"INSTANCE"
)
return
new_template
recircle/template/views.py
View file @
e77cbe27
...
...
@@ -27,6 +27,7 @@ class ImageTemplateViewSet(ModelViewSet):
image
=
data
[
"image"
],
lease
=
data
[
"lease"
],
flavor
=
data
[
"flavor"
],
network_id
=
"7245c546-2f22-4ab2-abc9-9eb59c2e6627"
,
# TODO: replace
type
=
"IMAGE"
)
new_template
.
save
()
...
...
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