Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
896412ac
authored
Apr 18, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement floating IP remove operation
parent
02238427
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
61 deletions
+141
-61
.idea/workspace.xml
+87
-59
circle/dashboard/forms.py
+15
-0
circle/dashboard/templates/dashboard/vm-detail/network.html
+11
-1
circle/dashboard/views/vm.py
+19
-1
circle/vm/operations.py
+9
-0
No files found.
.idea/workspace.xml
View file @
896412ac
...
...
@@ -39,8 +39,38 @@
<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=
"293"
>
<caret
line=
"182"
column=
"81"
lean-forward=
"false"
selection-start-line=
"182"
selection-start-column=
"81"
selection-end-line=
"182"
selection-end-column=
"81"
/>
<state
relative-caret-position=
"148"
>
<caret
line=
"586"
column=
"0"
lean-forward=
"false"
selection-start-line=
"586"
selection-start-column=
"0"
selection-end-line=
"586"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"operations.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/common/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"148"
>
<caret
line=
"69"
column=
"0"
lean-forward=
"false"
selection-start-line=
"69"
selection-start-column=
"0"
selection-end-line=
"69"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"util.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/util.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"148"
>
<caret
line=
"296"
column=
"19"
lean-forward=
"true"
selection-start-line=
"296"
selection-start-column=
"19"
selection-end-line=
"296"
selection-end-column=
"32"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"urls.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"614"
>
<caret
line=
"228"
column=
"22"
lean-forward=
"true"
selection-start-line=
"228"
selection-start-column=
"22"
selection-end-line=
"228"
selection-end-column=
"22"
/>
<folding
/>
</state>
</provider>
...
...
@@ -49,30 +79,30 @@
<file
leaf-file-name=
"forms.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/forms.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
304
"
>
<caret
line=
"10
18"
column=
"40"
lean-forward=
"false"
selection-start-line=
"1018"
selection-start-column=
"40"
selection-end-line=
"1018"
selection-end-column=
"40
"
/>
<state
relative-caret-position=
"
259
"
>
<caret
line=
"10
40"
column=
"31"
lean-forward=
"false"
selection-start-line=
"1040"
selection-start-column=
"31"
selection-end-line=
"1040"
selection-end-column=
"31
"
/>
<folding
/>
</state>
</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=
"
306
"
>
<caret
line=
"4
65"
column=
"0"
lean-forward=
"true"
selection-start-line=
"465"
selection-start-column=
"0"
selection-end-line=
"465"
selection-end-column=
"0
"
/>
<state
relative-caret-position=
"
148
"
>
<caret
line=
"4
72"
column=
"55"
lean-forward=
"false"
selection-start-line=
"472"
selection-start-column=
"55"
selection-end-line=
"472"
selection-end-column=
"55
"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"network.html"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
leaf-file-name=
"network.html"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"3
23
"
>
<caret
line=
"6
4"
column=
"20"
lean-forward=
"true"
selection-start-line=
"64"
selection-start-column=
"20"
selection-end-line=
"64"
selection-end-column=
"20
"
/>
<state
relative-caret-position=
"3
57
"
>
<caret
line=
"6
3"
column=
"24"
lean-forward=
"false"
selection-start-line=
"63"
selection-start-column=
"20"
selection-end-line=
"63"
selection-end-column=
"24
"
/>
<folding>
<marker
date=
"152405
1869354"
expanded=
"false"
signature=
"3016:3034
"
ph=
"..."
/>
<marker
date=
"152405
2679121"
expanded=
"false"
signature=
"3492:3510
"
ph=
"..."
/>
</folding>
</state>
</provider>
...
...
@@ -90,9 +120,6 @@
</component>
<component
name=
"FindInProjectRecents"
>
<findStrings>
<find>
LocalClient
</find>
<find>
trait
</find>
<find>
class NodeActivity
</find>
<find>
compileless
</find>
<find>
less
</find>
<find>
installed
</find>
...
...
@@ -102,7 +129,6 @@
<find>
DEFAULT_SUBNETPOOL_NAME_FOR_USER
</find>
<find>
get_id
</find>
<find>
add_port
</find>
<find>
vm_ops
</find>
<find>
VmPortAddView
</find>
<find>
VmPortAddForm
</find>
<find>
vm_opts
</find>
...
...
@@ -120,6 +146,10 @@
<find>
publicip
</find>
<find>
portadd
</find>
<find>
vmdeta
</find>
<find>
vm_ops
</find>
<find>
vm_
</find>
<find>
detailview
</find>
<find>
vmdetailview
</find>
</findStrings>
<replaceStrings>
<replace>
'ACTIVE'
</replace>
...
...
@@ -186,11 +216,11 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-plain-image-create.html"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/settings/base.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/models.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_network-public-ip-add.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/forms.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/
dashboard/templates/dashboard/vm-detail/network.html
"
/>
<option
value=
"$PROJECT_DIR$/circle/
vm/operations.py
"
/>
</list>
</option>
</component>
...
...
@@ -457,7 +487,7 @@
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32492113"
sideWeight=
"0.50745475"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Python Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.43023255"
sideWeight=
"0.43610224"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32769555"
sideWeight=
"0.49574015"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.
5674653
"
sideWeight=
"0.5058573"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.
47568712
"
sideWeight=
"0.5058573"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.20074548"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Docker"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"8"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Database"
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"
/>
...
...
@@ -556,7 +586,7 @@
</properties>
</breakpoint>
</default-breakpoints>
<option
name=
"time"
value=
"3
29
"
/>
<option
name=
"time"
value=
"3
31
"
/>
</breakpoint-manager>
<watches-manager
/>
</component>
...
...
@@ -624,6 +654,11 @@ certifi.where()</expression-string>
</expressions>
<expressions
id=
"evaluateExpression"
>
<expression>
<expression-string>
self.get_op()
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
openstack_api.neutron.tenant_floating_ip_list(self.request)
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
...
...
@@ -663,11 +698,6 @@ certifi.where()</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
openstack_api.neutron.float
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
</expressions>
</component>
<component
name=
"editorHistoryManager"
>
...
...
@@ -948,16 +978,6 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"590"
>
<caret
line=
"228"
column=
"19"
lean-forward=
"true"
selection-start-line=
"228"
selection-start-column=
"19"
selection-end-line=
"228"
selection-end-column=
"19"
/>
<folding>
<element
signature=
"e#732#770#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_network-port-add.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"238"
>
...
...
@@ -989,7 +1009,7 @@ certifi.where()</expression-string>
<state
relative-caret-position=
"-357"
>
<caret
line=
"36"
column=
"6"
lean-forward=
"false"
selection-start-line=
"36"
selection-start-column=
"6"
selection-end-line=
"36"
selection-end-column=
"6"
/>
<folding>
<element
signature=
"e#731#787#0"
expanded=
"
tru
e"
/>
<element
signature=
"e#731#787#0"
expanded=
"
fals
e"
/>
</folding>
</state>
</provider>
...
...
@@ -1018,61 +1038,69 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/circle/common/operations
.py"
>
<entry
file=
"file://$
USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/base
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1
82
"
>
<caret
line=
"
93"
column=
"0"
lean-forward=
"true"
selection-start-line=
"93"
selection-start-column=
"0"
selection-end-line=
"93
"
selection-end-column=
"0"
/>
<state
relative-caret-position=
"1
56
"
>
<caret
line=
"
87"
column=
"0"
lean-forward=
"false"
selection-start-line=
"87"
selection-start-column=
"0"
selection-end-line=
"87
"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$
USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/base
.py"
>
<entry
file=
"file://$
PROJECT_DIR$/circle/dashboard/urls
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
156
"
>
<caret
line=
"
87"
column=
"0"
lean-forward=
"false"
selection-start-line=
"87"
selection-start-column=
"0"
selection-end-line=
"87"
selection-end-column=
"0
"
/>
<state
relative-caret-position=
"
614
"
>
<caret
line=
"
228"
column=
"22"
lean-forward=
"true"
selection-start-line=
"228"
selection-start-column=
"22"
selection-end-line=
"228"
selection-end-column=
"22
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
views/util.py
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templates/dashboard/vm-detail/network.html
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"530"
>
<caret
line=
"306"
column=
"39"
lean-forward=
"false"
selection-start-line=
"306"
selection-start-column=
"24"
selection-end-line=
"306"
selection-end-column=
"39"
/>
<folding
/>
<state
relative-caret-position=
"357"
>
<caret
line=
"63"
column=
"24"
lean-forward=
"false"
selection-start-line=
"63"
selection-start-column=
"20"
selection-end-line=
"63"
selection-end-column=
"24"
/>
<folding>
<marker
date=
"1524052679121"
expanded=
"false"
signature=
"3492:3510"
ph=
"..."
/>
</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=
"
293
"
>
<caret
line=
"
182"
column=
"81"
lean-forward=
"false"
selection-start-line=
"182"
selection-start-column=
"81"
selection-end-line=
"182"
selection-end-column=
"81
"
/>
<state
relative-caret-position=
"
148
"
>
<caret
line=
"
586"
column=
"0"
lean-forward=
"false"
selection-start-line=
"586"
selection-start-column=
"0"
selection-end-line=
"586"
selection-end-column=
"0
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
forms
.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
views/util
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
304
"
>
<caret
line=
"
1018"
column=
"40"
lean-forward=
"false"
selection-start-line=
"1018"
selection-start-column=
"40"
selection-end-line=
"1018"
selection-end-column=
"40
"
/>
<state
relative-caret-position=
"
148
"
>
<caret
line=
"
296"
column=
"19"
lean-forward=
"true"
selection-start-line=
"296"
selection-start-column=
"19"
selection-end-line=
"296"
selection-end-column=
"32
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
vm
/operations.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
common
/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
306
"
>
<caret
line=
"
465"
column=
"0"
lean-forward=
"true"
selection-start-line=
"465"
selection-start-column=
"0"
selection-end-line=
"465
"
selection-end-column=
"0"
/>
<state
relative-caret-position=
"
148
"
>
<caret
line=
"
69"
column=
"0"
lean-forward=
"false"
selection-start-line=
"69"
selection-start-column=
"0"
selection-end-line=
"69
"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templates/dashboard/vm-detail/network.html
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
forms.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"323"
>
<caret
line=
"64"
column=
"20"
lean-forward=
"true"
selection-start-line=
"64"
selection-start-column=
"20"
selection-end-line=
"64"
selection-end-column=
"20"
/>
<folding>
<marker
date=
"1524051869354"
expanded=
"false"
signature=
"3016:3034"
ph=
"..."
/>
</folding>
<state
relative-caret-position=
"259"
>
<caret
line=
"1040"
column=
"31"
lean-forward=
"false"
selection-start-line=
"1040"
selection-start-column=
"31"
selection-end-line=
"1040"
selection-end-column=
"31"
/>
<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=
"148"
>
<caret
line=
"472"
column=
"55"
lean-forward=
"false"
selection-start-line=
"472"
selection-start-column=
"55"
selection-end-line=
"472"
selection-end-column=
"55"
/>
<folding
/>
</state>
</provider>
</entry>
...
...
circle/dashboard/forms.py
View file @
896412ac
...
...
@@ -1027,6 +1027,21 @@ class VmPublicIpAddForm(OperationForm):
)
return
helper
class
VmPublicIpRemoveForm
(
OperationForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
public_ip_id
=
kwargs
.
pop
(
'public_ip_id'
)
super
(
VmPublicIpRemoveForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
'public_ip_id'
]
=
forms
.
CharField
(
widget
=
forms
.
HiddenInput
(),
initial
=
public_ip_id
)
@property
def
helper
(
self
):
helper
=
super
(
VmPublicIpRemoveForm
,
self
)
.
helper
helper
.
layout
=
Layout
(
Field
(
"public_ip_id"
),
)
return
helper
class
CircleAuthenticationForm
(
AuthenticationForm
):
# fields: username, password
...
...
circle/dashboard/templates/dashboard/vm-detail/network.html
View file @
896412ac
...
...
@@ -53,7 +53,17 @@
<span
class=
"pull-right"
>
{% if i.public_ip %}
<dl>
<dt>
{% trans "Public IP address" %}:
</dt>
<dt>
{% trans "Public IP address" %}
{% with op=op.remove_public_ip %}{% if op %}
<span
class=
"operation-wrapper"
>
<a
href=
"{{op.get_url}}?public_ip_id={{ i.public_ip_id }}"
class=
"btn btn-{{op.effect}} btn-xs operation"
{%
if
op
.
disabled
%}
disabled
{%
endif
%}
>
{% trans "remove" %}
</a>
</span>
{% endif %}{% endwith %}
</dt>
<dd>
{{ i.public_ip }}
</dd>
</dl>
{% else %}
...
...
circle/dashboard/views/vm.py
View file @
896412ac
...
...
@@ -63,7 +63,7 @@ from .util import (
)
from
..forms
import
(
AclUserOrGroupAddForm
,
VmResourcesForm
,
VmCustomizeForm
,
VmDeployForm
,
VmFromPlainImageForm
,
VmRemoveInterfaceForm
,
VmAddInterfaceForm
,
VmSaveForm
,
VmPortAddForm
,
VmPublicIpAddForm
)
VmAddInterfaceForm
,
VmSaveForm
,
VmPortAddForm
,
VmPublicIpAddForm
,
VmPublicIpRemoveForm
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -185,6 +185,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
if
floating_ip
.
port_id
in
instance_ports_by_id
.
keys
():
port
=
instance_ports_by_id
[
floating_ip
.
port_id
]
instance_networks
[
port
.
network_id
]
.
public_ip
=
floating_ip
.
ip
instance_networks
[
port
.
network_id
]
.
public_ip_id
=
floating_ip
.
id
context
[
'networks'
]
=
instance_networks
.
values
()
...
...
@@ -571,6 +572,22 @@ class VmPublicIpAddView(FormOperationMixin, VmOperationView):
return
val
class
VmPublicIpRemoveView
(
FormOperationMixin
,
VmOperationView
):
op
=
'remove_public_ip'
show_in_toolbar
=
False
icon
=
'times'
effect
=
"danger"
form_class
=
VmPublicIpRemoveForm
def
get_form_kwargs
(
self
):
public_ip_id
=
self
.
request
.
GET
.
get
(
'public_ip_id'
)
val
=
super
(
VmPublicIpRemoveView
,
self
)
.
get_form_kwargs
()
val
.
update
({
'public_ip_id'
:
public_ip_id
})
return
val
class
VmSaveView
(
FormOperationMixin
,
VmOperationView
):
op
=
'save_as_template'
...
...
@@ -837,6 +854,7 @@ vm_ops = OrderedDict([
# ('remove_port', VmPortRemoveView),
# ('add_port', VmPortAddView),
(
'add_public_ip'
,
VmPublicIpAddView
),
(
'remove_public_ip'
,
VmPublicIpRemoveView
),
# ('renew', VmRenewView),
# ('resources_change', VmResourcesChangeView),
# ('password_reset', VmOperationView.factory(
...
...
circle/vm/operations.py
View file @
896412ac
...
...
@@ -465,6 +465,15 @@ class AddPublicIPOperation(InstanceOperation):
openstack_api
.
neutron
.
floating_ip_associate
(
request
,
floating_ip
.
id
,
port_id
)
@register_operation
class
RemovePublicIPOperation
(
InstanceOperation
):
id
=
'remove_public_ip'
name
=
_
(
"remove public ip"
)
def
_operation
(
self
,
request
,
public_ip_id
):
openstack_api
.
neutron
.
floating_ip_disassociate
(
request
,
public_ip_id
)
openstack_api
.
neutron
.
tenant_floating_ip_release
(
request
,
public_ip_id
)
@register_operation
class
RemoveDiskOperation
(
InstanceOperation
):
id
=
'remove_disk'
name
=
_
(
"remove disk"
)
...
...
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