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
6172a2f6
authored
Oct 07, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix doc comments
parent
822167c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
circle/vm/models.py
+26
-7
No files found.
circle/vm/models.py
View file @
6172a2f6
...
...
@@ -503,8 +503,17 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
self
.
save
()
def
deploy
(
self
,
user
=
None
,
task_uuid
=
None
):
""" Deploy new virtual machine with network
1. Schedule
"""Deploy new virtual machine with network
:param self: The virtual machine to deploy.
:type self: vm.models.Instance
:param user: The user who's issuing the command.
:type user: django.contrib.auth.models.User
:param task_uuid: The task's UUID, if the command is being executed
asynchronously.
:type task_uuid: str
"""
act
=
InstanceActivity
(
activity_code
=
'vm.Instance.deploy'
)
act
.
instance
=
self
...
...
@@ -542,7 +551,17 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
finish
(
result
=
'SUCCESS'
)
def
destroy
(
self
,
user
=
None
,
task_uuid
=
None
):
""" Remove Instance with its networks.
"""Remove virtual machine and its networks.
:param self: The virtual machine to destroy.
:type self: vm.models.Instance
:param user: The user who's issuing the command.
:type user: django.contrib.auth.models.User
:param task_uuid: The task's UUID, if the command is being executed
asynchronously.
:type task_uuid: str
"""
act
=
InstanceActivity
(
activity_code
=
'vm.Instance.destroy'
)
act
.
instance
=
self
...
...
@@ -560,7 +579,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
finish
(
result
=
"DONE"
)
def
destroy_async
(
self
,
user
=
None
):
"""Execute destroy
() asyncrhon
usly.
"""Execute destroy
asynchrono
usly.
"""
local_tasks
.
destroy
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
...
...
@@ -586,7 +605,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
finish
(
result
=
'SUCCESS'
)
def
sleep_async
(
self
,
user
=
None
):
"""Execute s
uspend()
asynchronously.
"""Execute s
leep
asynchronously.
"""
local_tasks
.
sleep
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
...
...
@@ -603,7 +622,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
finish
(
result
=
'SUCCESS'
)
def
wake_up_async
(
self
,
user
=
None
):
"""Execute
resume()
asynchronously.
"""Execute
wake_up
asynchronously.
"""
local_tasks
.
resume
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
...
...
@@ -649,7 +668,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
queue
=
"localhost.man"
)
def
reboot
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Reboot virtual machin
with ctr+alt+d
el signal.
"""Reboot virtual machin
e with Ctrl+Alt+D
el signal.
"""
act
=
InstanceActivity
(
activity_code
=
'vm.Instance.reboot'
)
act
.
instance
=
self
...
...
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