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
9cfa0f18
authored
Nov 06, 2020
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to instance template model to get template instances of a user
parent
59621987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
circle/vm/models/instance.py
+3
-0
No files found.
circle/vm/models/instance.py
View file @
9cfa0f18
...
@@ -200,6 +200,9 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -200,6 +200,9 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
def
get_running_instances
(
self
):
def
get_running_instances
(
self
):
return
Instance
.
active
.
filter
(
template
=
self
,
status
=
"RUNNING"
)
return
Instance
.
active
.
filter
(
template
=
self
,
status
=
"RUNNING"
)
def
get_user_instances
(
self
,
user
):
return
Instance
.
active
.
filter
(
template
=
self
,
owner
=
user
)
@property
@property
def
metric_prefix
(
self
):
def
metric_prefix
(
self
):
return
'template.
%
d'
%
self
.
pk
return
'template.
%
d'
%
self
.
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