Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
511666cb
authored
Oct 02, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: addign remove() method
parent
516a0b21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
circle/vm/models.py
+24
-0
No files found.
circle/vm/models.py
View file @
511666cb
...
@@ -625,6 +625,30 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -625,6 +625,30 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
local_tasks
.
save_as
.
apply_async
(
args
=
[
self
,
user
],
local_tasks
.
save_as
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
queue
=
"localhost.man"
)
def
remove
(
self
,
user
=
None
,
task_uuid
=
None
):
""" Remove Instance with its networks.
"""
act
=
InstanceActivity
(
activity_code
=
'vm.Instance.remove'
)
act
.
instance
=
self
act
.
user
=
user
act
.
started
=
timezone
.
now
()
act
.
task_uuid
=
task_uuid
act
.
save
()
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
# Delete instance
vm_tasks
.
delete
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
# Delete networks
for
net
in
self
.
interface_set
.
all
():
net
.
remove
()
act
.
finish
(
result
=
"DONE"
)
def
remove_async
(
self
,
user
=
None
):
""" Asyncron remove()
"""
local_tasks
.
delete
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
def
renew
(
self
,
which
=
'both'
):
def
renew
(
self
,
which
=
'both'
):
"""Renew virtual machine instance leases.
"""Renew virtual machine instance leases.
"""
"""
...
...
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