Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
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
94d2ea62
authored
Mar 13, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add initial template creation
parent
bad51a79
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
239 additions
and
117 deletions
+239
-117
.idea/workspace.xml
+60
-83
circle/circle/db.sqlite3
+0
-0
circle/network/migrations/0005_auto_20180313_1453.py
+53
-0
circle/vm/migrations/0009_auto_20180313_1453.py
+97
-0
circle/vm/models/instance.py
+19
-33
circle/vm/operations.py
+10
-1
No files found.
.idea/workspace.xml
View file @
94d2ea62
...
...
@@ -2,9 +2,9 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"1fbec8af-5a7c-40f9-b994-83ac07d1ae1d"
name=
"Default"
comment=
""
>
<change
beforePath=
""
afterPath=
"$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/circle/settings/base.py"
afterPath=
"$PROJECT_DIR$/circle/circle/settings/base.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/circle/db.sqlite3"
afterPath=
"$PROJECT_DIR$/circle/circle/db.sqlite3"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/vm/models/instance.py"
afterPath=
"$PROJECT_DIR$/circle/vm/models/instance.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/vm/operations.py"
afterPath=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
...
@@ -34,8 +34,8 @@
<file
leaf-file-name=
"vm.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
64
"
>
<caret
line=
"53
7"
column=
"31"
lean-forward=
"false"
selection-start-line=
"537"
selection-start-column=
"31"
selection-end-line=
"537"
selection-end-column=
"31
"
/>
<state
relative-caret-position=
"2
98
"
>
<caret
line=
"53
9"
column=
"112"
lean-forward=
"false"
selection-start-line=
"539"
selection-start-column=
"112"
selection-end-line=
"539"
selection-end-column=
"112
"
/>
<folding>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
...
...
@@ -43,44 +43,21 @@
</provider>
</entry>
</file>
<file
leaf-file-name=
"operations.py"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
leaf-file-name=
"operations.py"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
74
"
>
<caret
line=
"
126"
column=
"27"
lean-forward=
"true"
selection-start-line=
"126"
selection-start-column=
"27"
selection-end-line=
"126"
selection-end-column=
"27
"
/>
<state
relative-caret-position=
"
176
"
>
<caret
line=
"
531"
column=
"22"
lean-forward=
"false"
selection-start-line=
"531"
selection-start-column=
"22"
selection-end-line=
"531"
selection-end-column=
"22
"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"
circle_policy.json"
pinned=
"false"
current-in-tab=
"tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
circle/os_policies/circle_policy.json
"
>
<file
leaf-file-name=
"
instance.py"
pinned=
"false"
current-in-tab=
"fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
vm/models/instance.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"51"
>
<caret
line=
"3"
column=
"0"
lean-forward=
"true"
selection-start-line=
"3"
selection-start-column=
"0"
selection-end-line=
"3"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"template.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"267"
>
<caret
line=
"63"
column=
"33"
lean-forward=
"true"
selection-start-line=
"63"
selection-start-column=
"33"
selection-end-line=
"63"
selection-end-column=
"33"
/>
<folding>
<element
signature=
"e#731#787#0"
expanded=
"true"
/>
<marker
date=
"1520947233801"
expanded=
"true"
signature=
"9976:10189"
ph=
"SELECT count... vm_instance"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"base.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/settings/base.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"546"
>
<caret
line=
"563"
column=
"33"
lean-forward=
"false"
selection-start-line=
"563"
selection-start-column=
"33"
selection-end-line=
"563"
selection-end-column=
"33"
/>
<state
relative-caret-position=
"340"
>
<caret
line=
"145"
column=
"13"
lean-forward=
"false"
selection-start-line=
"145"
selection-start-column=
"13"
selection-end-line=
"145"
selection-end-column=
"13"
/>
<folding
/>
</state>
</provider>
...
...
@@ -98,7 +75,6 @@
</component>
<component
name=
"FindInProjectRecents"
>
<findStrings>
<find>
op.get
</find>
<find>
request.views.request-resource
</find>
<find>
get_status_icon
</find>
<find>
icon
</find>
...
...
@@ -128,6 +104,7 @@
<find>
True
</find>
<find>
template
</find>
<find>
saveas
</find>
<find>
save
</find>
</findStrings>
<replaceStrings>
<replace>
'ACTIVE'
</replace>
...
...
@@ -178,7 +155,6 @@
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html"
/>
<option
value=
"$PROJECT_DIR$/circle/network/models.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/index.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/models/instance.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/resources.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html"
/>
...
...
@@ -194,8 +170,9 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/settings/base.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/models/instance.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
</list>
</option>
</component>
...
...
@@ -297,7 +274,7 @@
<property
name=
"settings.editor.selected.configurable"
value=
"watcher.settings"
/>
<property
name=
"NewWatcherDialog.advanced.open"
value=
"true"
/>
<property
name=
"DefaultHtmlFileTemplate"
value=
"HTML File"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py opera	FILE	file:///home/h3yduck/cloud/circle/vm/operations.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py templat	null	null vmadd	null	null vmdetail	null	null addinterfa	null	null addin	null	null server	null	null Instance	null	null instance	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py operat	null	null ins	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py vmdetai	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html operationvi	null	null ser	null	null server.	FILE	file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py resources.	FILE	file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html vm-de	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html vxla	null	null urls	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py index-v	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html index-vm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html vmdeta	null	null create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html vxl	null	null nov	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py nova.p	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py vmdetailv	null	null editor	null	null networktopo	FILE	file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js bow	FILE	file:///home/h3yduck/cloud/circle/bower.json base.py	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py local	null	null vnc	null	null plain	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html forms	null	null vxlanform	null	null instanc	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py index-vxla	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html _vm-c	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html vmcrea	null	null loginV	null	null index.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html sleep	null	null Deploy	null	null Vmdeta	null	null list_from	null	null"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"
instancetem	null	null
base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py opera	FILE	file:///home/h3yduck/cloud/circle/vm/operations.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py templat	null	null vmadd	null	null vmdetail	null	null addinterfa	null	null addin	null	null server	null	null Instance	null	null instance	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py operat	null	null ins	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py vmdetai	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html operationvi	null	null ser	null	null server.	FILE	file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py resources.	FILE	file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html vm-de	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html vxla	null	null urls	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py index-v	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html index-vm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html vmdeta	null	null create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html vxl	null	null nov	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py nova.p	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py vmdetailv	null	null editor	null	null networktopo	FILE	file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js bow	FILE	file:///home/h3yduck/cloud/circle/bower.json base.py	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py local	null	null vnc	null	null plain	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html forms	null	null vxlanform	null	null instanc	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py index-vxla	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html _vm-c	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html vmcrea	null	null loginV	null	null index.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html sleep	null	null Deploy	null	null Vmdeta	null	null list_from	null	null"
/>
</component>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
...
...
@@ -436,7 +413,7 @@
<window_info
id=
"SciView"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"
tru
e"
show_stripe_button=
"true"
weight=
"0.7114165"
sideWeight=
"0.5101172"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"
fals
e"
show_stripe_button=
"true"
weight=
"0.7114165"
sideWeight=
"0.5101172"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
...
...
@@ -519,7 +496,7 @@
</properties>
</breakpoint>
</default-breakpoints>
<option
name=
"time"
value=
"22
6
"
/>
<option
name=
"time"
value=
"22
9
"
/>
</breakpoint-manager>
<watches-manager
/>
</component>
...
...
@@ -564,6 +541,11 @@
</expressions>
<expressions
id=
"evaluateExpression"
>
<expression>
<expression-string>
self.instance
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
type(self) == SaveAsTemplateOperation
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
...
...
@@ -603,30 +585,9 @@
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
instance_networks\
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
</expressions>
</component>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/client.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"274"
>
<caret
line=
"321"
column=
"21"
lean-forward=
"false"
selection-start-line=
"321"
selection-start-column=
"21"
selection-end-line=
"321"
selection-end-column=
"21"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/activity.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"195"
>
<caret
line=
"43"
column=
"8"
lean-forward=
"false"
selection-start-line=
"43"
selection-start-column=
"8"
selection-end-line=
"43"
selection-end-column=
"8"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/wsgi.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"376"
>
...
...
@@ -879,14 +840,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/instance.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"313"
>
<caret
line=
"215"
column=
"26"
lean-forward=
"true"
selection-start-line=
"215"
selection-start-column=
"26"
selection-end-line=
"215"
selection-end-column=
"26"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/forms.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"162"
>
...
...
@@ -983,22 +936,20 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
dashboard/views/vm.py
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
circle/os_policies/circle_policy.json
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"264"
>
<caret
line=
"537"
column=
"31"
lean-forward=
"false"
selection-start-line=
"537"
selection-start-column=
"31"
selection-end-line=
"537"
selection-end-column=
"31"
/>
<folding>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
<state
relative-caret-position=
"51"
>
<caret
line=
"3"
column=
"0"
lean-forward=
"true"
selection-start-line=
"3"
selection-start-column=
"0"
selection-end-line=
"3"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"267"
>
<caret
line=
"63"
column=
"33"
lean-forward=
"
tru
e"
selection-start-line=
"63"
selection-start-column=
"33"
selection-end-line=
"63"
selection-end-column=
"33"
/>
<caret
line=
"63"
column=
"33"
lean-forward=
"
fals
e"
selection-start-line=
"63"
selection-start-column=
"33"
selection-end-line=
"63"
selection-end-column=
"33"
/>
<folding>
<element
signature=
"e#731#787#0"
expanded=
"
tru
e"
/>
<element
signature=
"e#731#787#0"
expanded=
"
fals
e"
/>
<marker
date=
"1520947233801"
expanded=
"true"
signature=
"9976:10189"
ph=
"SELECT count... vm_instance"
/>
</folding>
</state>
...
...
@@ -1012,18 +963,44 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/
operations
.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/
models/common
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
74
"
>
<caret
line=
"1
26"
column=
"27"
lean-forward=
"true"
selection-start-line=
"126"
selection-start-column=
"27"
selection-end-line=
"126"
selection-end-column=
"27
"
/>
<state
relative-caret-position=
"
590
"
>
<caret
line=
"1
49"
column=
"19"
lean-forward=
"true"
selection-start-line=
"149"
selection-start-column=
"19"
selection-end-line=
"149"
selection-end-column=
"19
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/circle/circle/os_policies/circle_policy.json
"
>
<entry
file=
"file://$
USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/model_utils/models.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"51"
>
<caret
line=
"3"
column=
"0"
lean-forward=
"true"
selection-start-line=
"3"
selection-start-column=
"0"
selection-end-line=
"3"
selection-end-column=
"0"
/>
<state
relative-caret-position=
"204"
>
<caret
line=
"17"
column=
"6"
lean-forward=
"false"
selection-start-line=
"17"
selection-start-column=
"6"
selection-end-line=
"17"
selection-end-column=
"6"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/instance.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"340"
>
<caret
line=
"145"
column=
"13"
lean-forward=
"false"
selection-start-line=
"145"
selection-start-column=
"13"
selection-end-line=
"145"
selection-end-column=
"13"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"298"
>
<caret
line=
"539"
column=
"112"
lean-forward=
"false"
selection-start-line=
"539"
selection-start-column=
"112"
selection-end-line=
"539"
selection-end-column=
"112"
/>
<folding>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"176"
>
<caret
line=
"531"
column=
"22"
lean-forward=
"false"
selection-start-line=
"531"
selection-start-column=
"22"
selection-end-line=
"531"
selection-end-column=
"22"
/>
<folding
/>
</state>
</provider>
...
...
circle/circle/db.sqlite3
View file @
94d2ea62
No preview for this file type
circle/network/migrations/0005_auto_20180313_1453.py
0 → 100644
View file @
94d2ea62
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-03-13 13:53
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'network'
,
'0004_remove_vxlan_owner'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'vxlan'
,
options
=
{},
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'comment'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'created_at'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'description'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'modified_at'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'name'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'vlan'
,
),
migrations
.
RemoveField
(
model_name
=
'vxlan'
,
name
=
'vni'
,
),
migrations
.
AddField
(
model_name
=
'vxlan'
,
name
=
'os_network_id'
,
field
=
models
.
CharField
(
default
=
1
,
max_length
=
100
,
unique
=
True
),
preserve_default
=
False
,
),
]
circle/vm/migrations/0009_auto_20180313_1453.py
0 → 100644
View file @
94d2ea62
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-03-13 13:53
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'vm'
,
'0008_merge_20180226_1259'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'instancetemplate'
,
options
=
{
'ordering'
:
(
'name'
,),
'verbose_name'
:
'template'
,
'verbose_name_plural'
:
'templates'
},
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'access_method'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'boot_menu'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'disks'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'has_agent'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'lease'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'max_ram_size'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'num_cores'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'owner'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'parent'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'priority'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'ram_size'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'raw_data'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'req_traits'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'system'
,
),
migrations
.
RemoveField
(
model_name
=
'instancetemplate'
,
name
=
'tags'
,
),
migrations
.
AddField
(
model_name
=
'instancetemplate'
,
name
=
'flavor_id'
,
field
=
models
.
CharField
(
default
=
1
,
max_length
=
100
,
unique
=
True
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'instancetemplate'
,
name
=
'image_id'
,
field
=
models
.
CharField
(
default
=
1
,
max_length
=
100
,
unique
=
True
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'instancetemplate'
,
name
=
'owner_id'
,
field
=
models
.
CharField
(
default
=
1
,
max_length
=
100
,
unique
=
True
),
preserve_default
=
False
,
),
]
circle/vm/models/instance.py
View file @
94d2ea62
...
...
@@ -127,33 +127,29 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
abstract
=
True
class
InstanceTemplate
(
VirtualMachineDescModel
,
TimeStampedModel
):
class
InstanceTemplate
(
TimeStampedModel
):
"""Virtual machine template.
"""
name
=
CharField
(
max_length
=
100
,
verbose_name
=
_
(
'name'
),
help_text
=
_
(
'Human readable name of template.'
))
description
=
TextField
(
verbose_name
=
_
(
'description'
),
blank
=
True
)
parent
=
ForeignKey
(
'self'
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'parent template'
),
on_delete
=
SET_NULL
,
help_text
=
_
(
'Template which this one is derived of.'
))
disks
=
ManyToManyField
(
'storage.Disk'
,
verbose_name
=
_
(
'disks'
),
related_name
=
'template_set'
,
help_text
=
_
(
'Disks which are to be mounted.'
))
owner
=
ForeignKey
(
User
)
# parent = ForeignKey('self', null=True, blank=True,
# verbose_name=_('parent template'),
# on_delete=SET_NULL,
# help_text=_('Template which this one is derived of.'))
# disks = ManyToManyField('storage.Disk', verbose_name=_('disks'),
# related_name='template_set',
# help_text=_('Disks which are to be mounted.'))
# lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."),
# verbose_name=_("Lease"))
image_id
=
CharField
(
blank
=
False
,
max_length
=
100
,
unique
=
True
)
flavor_id
=
CharField
(
blank
=
False
,
max_length
=
100
,
unique
=
True
)
owner_id
=
CharField
(
blank
=
False
,
max_length
=
100
,
unique
=
True
)
class
Meta
:
app_label
=
'vm'
db_table
=
'vm_instancetemplate'
ordering
=
(
'name'
,
)
permissions
=
(
(
'create_template'
,
_
(
'Can create an instance template.'
)),
(
'create_base_template'
,
_
(
'Can create an instance template (base).'
)),
(
'change_template_resources'
,
_
(
'Can change resources of a template.'
)),
)
verbose_name
=
_
(
'template'
)
verbose_name_plural
=
_
(
'templates'
)
...
...
@@ -162,9 +158,7 @@ class InstanceTemplate(VirtualMachineDescModel, TimeStampedModel):
@property
def
running_instances
(
self
):
"""The number of running instances of the template.
"""
return
sum
(
1
for
i
in
self
.
instance_set
.
all
()
if
i
.
is_running
)
return
0
#TODO: see get_running_instances
@property
def
os_type
(
self
):
...
...
@@ -174,35 +168,27 @@ class InstanceTemplate(VirtualMachineDescModel, TimeStampedModel):
return
'windows'
else
:
return
'linux'
@property
def
is_ready
(
self
):
return
all
(
disk
.
is_ready
for
disk
in
self
.
disks
)
def
save
(
self
,
*
args
,
**
kwargs
):
is_new
=
getattr
(
self
,
"pk"
,
None
)
is
None
super
(
InstanceTemplate
,
self
)
.
save
(
*
args
,
**
kwargs
)
if
is_new
:
self
.
set_level
(
self
.
owner
,
'owner'
)
#TODO
@permalink
def
get_absolute_url
(
self
):
return
(
'dashboard.views.template-detail'
,
None
,
{
'pk'
:
self
.
pk
})
def
remove_disk
(
self
,
disk
,
**
kwargs
):
#TODO: why?
self
.
disks
.
remove
(
disk
)
def
destroy_disks
(
self
):
"""Destroy all associated disks.
"""
#TODO: why?
for
disk
in
self
.
disks
.
all
():
disk
.
destroy
()
def
get_running_instances
(
self
):
return
Instance
.
active
.
filter
(
template
=
self
,
status
=
"RUNNING"
)
return
()
#TODO: do we need this? if so, store created vm ids in template
@property
def
metric_prefix
(
self
):
#TODO: what is this?
return
'template.
%
d'
%
self
.
pk
...
...
circle/vm/operations.py
View file @
94d2ea62
...
...
@@ -521,7 +521,16 @@ class SaveAsTemplateOperation(InstanceOperation):
def
_operation
(
self
,
request
,
user
,
system
,
name
=
None
,
with_shutdown
=
True
,
clone
=
False
,
task
=
None
,
**
kwargs
):
print
"TODO: create template"
template_image_id
=
openstack_api
.
nova
.
snapshot_create
(
request
,
self
.
instance
.
id
,
name
)
template
=
InstanceTemplate
(
name
=
name
,
image_id
=
template_image_id
,
flavor_id
=
self
.
instance
.
flavor
[
"id"
],
owner_id
=
user
.
id
,
)
template
.
save
()
# return create_readable(
# ugettext_noop("New template: %(template)s"),
# template=reverse('dashboard.views.template-detail',
...
...
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