Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
2b0eb332
authored
Mar 11, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instance: added shut_off and shut_off_async
parent
764e597b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
circle/vm/models/instance.py
+17
-0
No files found.
circle/vm/models/instance.py
View file @
2b0eb332
...
...
@@ -758,6 +758,23 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
return
local_tasks
.
redeploy
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
def
shut_off
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Shut off VM. (plug-out)
"""
with
instance_activity
(
code_suffix
=
'shut_off'
,
instance
=
self
,
task_uuid
=
task_uuid
,
user
=
user
)
as
act
:
# Destroy VM
if
self
.
node
:
self
.
__destroy_vm
(
act
)
self
.
__cleanup_after_destroy_vm
(
act
)
def
shut_off_async
(
self
,
user
=
None
):
"""Shut off VM. (plug-out)
"""
return
local_tasks
.
shut_off
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
def
destroy
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Remove virtual machine and its networks.
...
...
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