144 Commits

Author SHA1 Message Date
Zuul
ed6a22b0fd Merge "Support security groups association per port" 2017-11-08 08:39:24 +00:00
Trygve Vea
edcd22244f Add a checkbox to disable SNAT on routers
When creating a router, or when setting a gateway on a router - a checkbox
is displayed, which can be unchecked to disable SNAT.

Change-Id: I8bc040018645fe2bde534b7d48e14c17984cc9c4
Closes-bug: #1673076
2017-10-23 16:10:48 +00:00
Zuul
842e2cdd0c Merge "Hide IPv6-addresses when assigning floating IP addresses" 2017-10-21 00:38:17 +00:00
Kenji Ishii
e9db12382e Support security groups association per port
This patch support operation for operators and project users to
associate security groups to a port. The feature is mentioned at
the neutron user feedback session in Barcelona summit [1].

This function UI is same as the function of security groups
association per instance. To realize this, the way of implementation
for 'Edit port' is changed, which move from a single modal to a
workflow base.

[1] https://etherpad.openstack.org/p/ocata-neutron-end-user-operator-feedback (L.35+)

Also we need to display how security groups is associated at a port.
At the moment, there is not way to be able to see it (only this function).
It should be done as an another patch.

Change-Id: I96e0fafdffbf05b8167ec1b85f7430176fdaab90
Closes-Bug: #1637444
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2017-10-20 23:57:40 +00:00
Trygve Vea
9d5be5251f Hide IPv6-addresses when assigning floating IP addresses
A floating IP can only be associated with an IPv4 address, so we should
not show IPv6 addresses in the list of ports when assigning floating IP
addresses.

Change-Id: I7b39a263445204a9efbc8fe113cc79146d9bee8c
Closes-Bug: #1703360
Closes-Bug: #1724393
2017-10-20 21:30:27 +00:00
Trygve Vea
b9664a1bf1 Routers can be created with availability zone
When 'availability_zone'-extension is enabled, we present the user with
a drop-down menu containing a list of available availability zones.
This sets the 'availability_zone_hints' parameter on router creation.

Change-Id: I96293202ddd855823e89c4c7ba0b1f6a6423aab2
Partial-bug: #1716638
2017-10-19 11:53:39 +02:00
Jenkins
bc80696cd8 Merge "Do not call servers_update_addresses if no instances loaded" 2017-10-06 11:45:03 +00:00
Akihiro Motoki
61ad9f69bd Fix a bug to unable to retrieve ports when no trunk ext
When neutron trunk extension is not enabled, we cannot retrieve
network ports for a new instance. The current version of
port_list_with_trunk_types assumes the trunk extension is always
available, so if it is not enabled we cannot retrieve network ports.
This commit changes the logic to check whether the trunk extension
is enabled and if not it does not retrieve trunk information.

Change-Id: I2aa476790820f9512fe4728e0a806bd543021b0b
Closes-Bug: #1717893
2017-09-19 18:01:52 +00:00
Ferenc Cserepkei
748d9860bb TrunkPort, Horizon workflow: launch instance
Ethernet trunks (network interfaces having a vlan tag) cannot be used
as a boot interface. This is a DHCP/PXE limitation. So instead the
interface without the vlan tag can be used. In neutron's nomenclature
they are the trunk parents. It is also an OpenStack limitation. Subports
should not be passed to 'openstack server create --nic ...'. But if you
do, there's no clear error message about it. Please see Armando's
analysis here why:
https://bugs.launchpad.net/neutron/+bug/1636485/comments/9

The server part of this patch signals port kind (i.e. plain, trunkparent,
trunksubport) so the launch widget can easily filter out trunksubports,
what are not suitable for boot interface.

Change-Id: Ie3a6710eeffefcb472c569898d0f1f1554e599f7
Partially-Implements: blueprint neutron-trunk-ui
Signed-off-by: Ferenc Cserepkei <ferenc.cserepkei@ericsson.com>
2017-08-31 21:33:56 +00:00
Ivan Kolodyazhny
f61d41384b Do not call servers_update_addresses if no instances loaded
We don't need to call neutron's servers_update_addresses on instances
page if no instances are shown.

Change-Id: I98b595e443603f1409336ce61811c0ae3cbd2b21
2017-08-22 22:59:44 +03:00
Akihiro Motoki
15d996f7e4 Allow admin to create port on networks of different projects
Due to the change in the neutron API wrapper [1],
admin cannot create a port on networks owned by different project.
This is because api.neutron.network_get returns subnet detail
(Subnet object) only when project_id matches that of a target network.
This commit changes the logic to try to retrieve subnet detail first.
The condition is not simple and it looks wise to let neutron decide it.

The error reported in the bug also happens in the Port Create form
in the project dashboard if a user tries to create a port on an
external network. To handle the situation, handle() in CreatePort form
honors whether subnet detail is retrieved or not by checking a subnet
information is an instance of api.neutron.Subnet class.
This is a bit tricky but considering the current policy for create_port
I believe it is a good compromise.

Also fixes the wrong initial value of 'specify_ip' field of CreatePort
form. The initial value should be one of choices or None. Otherwise,
when 'specify_ip' field is hidden, an error message is returned
(though the message is not visible in the form), a user cannot submit
the form and the form is displayed continuously....

[1] commit 803209e237ea2987cfa2fad5f0e07a8c30d6d901

Closes-Bug: #1645708
Change-Id: I6aae0a29eedebc920247912fec0729bf47cda002
2017-08-21 10:30:12 +00:00
Kenji Ishii
5aab8bf508 Refactor the current UpdatePort form to workflow version
This patch change UpdatePort form to workflow in order to
be able to add extra tabs like the setting of security groups.
Originally, this work is a part of the subsequent patch
"Support security groups association per port",
but the changes are big so it is divided into two patches.
This patch focuses on refactoring the existing implementation
from the form to the workflow.

Change-Id: Id42b311242b66ee25e8870ed86e45b5464e19c01
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Related-bug: #1637444
2017-08-09 12:41:16 +00:00
Lajos Katona
da92f24bc2 Trunks panel: details for trunks and subports
Add details link to the trunk panel to show details of the given trunk,
like the subports list, with port_id and segmentation details.

Co-Authored-By: Bence Romsics <bence.romsics@ericsson.com>
Change-Id: I9000e2907a8f188d5e72e36818b7171f35158eb9
Partially-Implements: blueprint neutron-trunk-ui
2017-07-27 10:48:55 +02:00
Beth Elwell
b81c5901cd Add details to network_qos panel
This patch adds details drawer summary to network_qos panel to show
policy descriptions and details page with further information and
associated rules.

Implements: blueprint network-bandwidth-limiting-qos

Change-Id: I1a8032206b576cf8dad5f75077bac7a093971973
2017-07-24 13:07:44 +01:00
Jenkins
4a882c14b9 Merge "Show security groups in Port detail page" 2017-06-20 12:16:12 +00:00
Bence Romsics
9120b40038 Trunks panel: item and batch delete
Add delete buttons to the Project/Network/Trunks panel. There is one
button per each trunk item deleting only that trunk. Plus a select and
delete many trunks at once by checkboxes and then delete all selected.
The usual extras (confirmations and toast notifications) are included.

Change-Id: Ie88e169072a563fa238bf870664b71aa7f2a883d
Partially-Implements: bp/neutron-trunk-ui
2017-06-16 09:11:40 +02:00
Akihiro Motoki
21e4222f61 Show security groups in Port detail page
Closes-Bug: #1677535
Change-Id: I3558b0354dfd91fa3b30afee9263e8bf90482ebd
2017-06-16 00:16:18 +00:00
Akihiro Motoki
cabdbcccb3 api.neutron: Explicit member of FloatingIpTarget class
This is a minor refactoring.
Members of FloatingIpTarget class is not clear.
From maintenance perspective, it would be nice if we have
explicit member definitions in the class definition.

TrivialFix

Change-Id: Iaaf5f8351e8ea35d19dc79c8dbfcc256f70d2e63
2017-06-14 09:05:18 +00:00
Beth Elwell
12fe351823 Adds basic angular QoS panel to Horizon
This patch adds the QoS panel which displays Neutron QoS policies.
This patch allows read only view of the policies, displaying the name,
id, description and shared status of each policy. Policy actions and
rules to be added in follow-up patches.

To test:
Neutron's QoS plugin must be enabled in your setup.
To enable the QoS plugin in devstack please add the following lines
in the local.conf

    enable_plugin neutron git://git.openstack.org/openstack/neutron
    enable_service q-qos

and rebuild your stack (./stack.sh).

Create some qos policies via CLI (neutron qos-policy-create policy1).
now you can list the policies using this patch.

Based on initial commit: https://review.openstack.org/#/c/247997
Co-Authored-By: Masco <mkaliyam@redhat.com>
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>

Change-Id: If46aeb04879d91a1a9305a94a23cecea2041d378
Implements: blueprint network-bandwidth-limiting-qos
2017-06-13 16:36:29 +01:00
Akihiro Motoki
9067ae8b0f Move SG and FIP API wrapper to api.neutron
We no longer need to have SG and FIP API wrapper in api.network
as we only supports a single network back-end.

Completes blueprint drop-nova-network

Change-Id: I4e59d897508b497a3cd2ae2fda93b30b786610dc
2017-06-04 17:51:25 +00:00
Akihiro Motoki
393f8fa84c Remove openstack_dashboard.api.network_base
network_base module was introduced to abstract the difference of
FIP and security groups implementation between nova and neutron.
Now we only support neutron, so this module is no longer needed.

There were useful docstrings in api.network_base module.
They are moved to api.neutron.

Part of blueprint drop-nova-network

Change-Id: Ia73e1c8335b0be90139bcdfd4bb0599bb0779af6
2017-05-31 12:02:12 +00:00
Jenkins
cd931258b4 Merge "Fix duplicating <network_entity>_list() calls in api.network" 2017-05-24 09:25:38 +00:00
Timur Sufiev
6f982b3ead Fix duplicating <network_entity>_list() calls in api.network
The solution is trivial - to add @memoize decorator to the following
calls:
* api.neutron.subnet_list
* api.neutron.port_list
* api.network.tenant_floating_ip_list
* api.network.security_group_list

Closes-Bug: #1592940
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: Ibc0d227e07adfcc18bd2d0ed114d1da0f4ff04ad
2017-05-24 11:28:27 +03:00
Lajos Katona
3524b3d4f7 New readonly panel for trunks
Enable display of trunks on the project dashboard.

To test it devstack needs to have neutron with trunk support, eg:

 local.conf:
 enable_plugin neutron https://git.openstack.org/openstack/neutron
 enable_service q-trunk

No special horizon config is needed. As long as the 'trunk'
API extension is available (openstack extension show trunk)
the panel should automatically appear under Project/Network/Trunks.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Co-Authored-By: Bence Romsics <bence.romsics@ericsson.com>
Change-Id: Iacb83f22f81e09457953622e61065f0bb2c27407
Partially-Implements: blueprint neutron-trunk-ui
2017-05-24 02:34:33 +00:00
wei.ying
ba3ef0efb3 Use subnet id to allocate floating IP in Admin panel
In the admin allocate floating IP form, the pool select display
the subnet cidr info, which should be used subnet id when creating a
floating IP. This patch fix it.

Change-Id: I4f12027c90e580824d74b10010bf799515920702
Closes-Bug: #1689230
2017-05-18 09:51:28 +08:00
Akihiro Motoki
ced987815d Ensure log messages are not translated
Previously translated messages are included in log messages
and it was determined what language is chosen by users.
It makes difficult for operators to understand log messgaes.

This commit tries to use English messages for all log messages.
The following policies are applied based on the past discussions
in the bug 1406333 and related reviews.

- English messages are used for log messages.
- log messages include exception messages if possible
  to help operators identify what happens.
- Use ID rather than name for log messages
  as ID is much more unique compared to name.
- LOG.debug() in success code path are deleted.
  We don't log success messages in most places and API calls to
  back-end services can be logged from python bindings.

Change-Id: Ie554463908327435d886d0d0f1671fd327c0cd00
Closes-Bug: #1406333
2017-04-11 10:24:01 +00:00
Gábor Antal
34a3aa0ba8 Handle log message interpolation by the logger
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages
Change-Id: I51f50935f1eeffe4960562d6309dfdf05814e595
Closes-Bug: #1596829
2017-03-31 20:59:16 +09:00
Jenkins
e3cd250a81 Merge "hacking: noqa cleanup in openstack_dashboard" 2017-03-27 05:11:18 +00:00
Rob Cresswell
a8f17150bf Remove all remaining vendor specific code
There's some vendor specific code still lingering from several cycles
ago. This patch removes all usage of it, all related tests, and all
default settings.

Implements: blueprint horizon-vendor-split
Change-Id: Ic0bb84f547b07b130480e587bd365f6e7805dfb5
2017-03-22 20:23:12 +00:00
Akihiro Motoki
baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Lingxian Kong
c33b0840cb Only get detailed info for Nova servers when necessary
Horizon will get all servers from Nova in different several places,
but sometimes it only need ID and name instead of all the related
information of servers. novaclient already support 'detailed=False'
param for servers query.

Horizon page loading performance can also be improved with this patch.

Closes-Bug: #1661423
Change-Id: Ic4cc95cb4eaed0461a22ab1045fa83ba5a5e9ce4
2017-02-03 12:03:22 +13:00
Gábor Antal
41ee8c0677 Fix TypeError in api/neutron.py
In api/neutron.py [1], there is a logging, which throws a TypeError,
because the arguments of the format message is passed as a tuple,
which is not working when you pass the arguments to the logger,
instead of replacing in-place. In the current code, running the log
message leds to the following:

TypeError: not enough arguments for format string
Call stack:
  File "test.py", line 9, in <module>
    "router=%s", (router_id, router))
Message: 'router_static_route_list(): router_id=%s, router=%s'
Arguments: (('asd', 'asdf'),)

In this patchset, this bug is fixed.

[1]: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L1079

Change-Id: I233c435bb7ca89c6c8ecd49a66bccb5b59eedf41
Closes-Bug: #1659342
2017-01-25 17:14:56 +01:00
jiangpch
d85a5b4b5d remove to_dict method of Network in neutron.py
because network['subnets'] is a list of str.

Closes-Bug: #1650097
Change-Id: I55b0c81706051410d7368a067106ff3d821d7b47
2016-12-15 11:23:19 +08:00
Matt Borland
1b153ca982 Allow router panel to not break sidebar
This patch handles an exception that is raised when the network service
is not present.  When unhandled, this causes the sidebar to not exist.

Change-Id: Ic5a94b267158d17a145c64c75fd7bf88e98478fa
Closes-Bug: 1647766
2016-12-06 15:32:26 +00:00
Paul Karikh
97945b5f6a Wrap api calls with tracing decorators
Since Horizon is going to be the first (or, one of the first)
OpenStack component using the new MongoDB driver, it won't be able to
retrieve traces made by other components using MongoDB driver (which
it should use because Ceilometer driver was too slow) for a
while. This means that Horizon itself is responsible for tracing the
rendering of its pages down to the layer where the flow of control
leaves Horizon domain. So, a lot of api wrappers in
openstack_dashboard.api are augmented with tracing decorator to
achieve this goal.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Implements-blueprint: openstack-profiler-at-developer-dashboard
Change-Id: Ib36692f0e9e68ed7fa0cd47919ba6581c9c8ab57
2016-12-01 19:31:10 +00:00
liyingjun
1a3ab89f22 Disable router and fip quotas when router is disabled
Currently Horizon unable to change quotas if routers extension is
disabled, fix this by adding router and floatingip quotas to
disabled_quotas when router extension is disabled.

Change-Id: I14d8a6e2e439ab48b62ce64c88ebb4643d11e49f
Closes-bug: #1457598
2016-11-18 17:27:34 +00:00
Akihiro Motoki
7e64a1cef1 Drop LBaaS v1 dashboard
LBaaS v1 feature was removed from neutron-lbaas in Newton.
There is no reason we have LBaaS v1 dashboard in Ocata or later.

Change-Id: Ic7d4ceea1943c3721500ce4b7f769b9dba28a359
Closes-Bug: #1624655
2016-10-18 08:57:26 +09:00
Paulo Matias
2ac3d51014 Add the new device owner flag for HA router interface
Changeset I89b247bdac3aee1e47ee8a1c9f1cb2c385019a51 introduced a new
device owner flag for HA router interfaces which was still not included
in Horizon's ROUTER_INTERFACE_OWNERS.

Change-Id: I2db4218e7351e0017a7a74114be6ac7af803476c
Related-Bug: #1554519
Closes-Bug: #1617769
2016-08-28 12:33:34 -03:00
Jenkins
3bd7852746 Merge "Server-side filtering networks" 2016-08-25 04:23:03 +00:00
jlopezgu
1a0e284106 Server-side filtering networks
Implements server-side filtering networks in:
  - Admin->System->Networks
  - Project->Network->Networks

Implements blueprint: server-side-filtering

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ie05f58a77b62b12dbf087395fbaf4ff0dc1f8562
2016-08-24 03:15:33 +09:00
LIU Yulong
5c238e9117 Add floating IP panel to admin dashboard
Now system administrators have CRUD abilities to manage floating IP.
1.floating IP list table
2.allocate floating IP to specific tenant
3.release/delete floating IP

Partially implements blueprint: manage-ips
Partially implements blueprint: syspanel-floating-ip-list

Change-Id: Ie5ec59740887d3845b933b37e6e875dbf08a4918
2016-08-19 12:15:55 +08:00
Jenkins
7409b1baad Merge "Remove old style policy checks" 2016-08-04 20:55:58 +00:00
David Lyle
6868cb70e1 Remove old style policy checks
Since the main policy engine moved to django_openstack_auth, the
policy.py file handles the check for POLICY_CHECK_FUNCTION and just
returns True if it is not defined. This eliminates the need for all
the special casing that is being removed in this patch.

One special case (not test related) was left in place, that is in
admin/dashboard.py which has more complex behavior if the operator
is not using policy.

Change-Id: I5523632d3459b68693fcc781bd024aea1180c110
2016-07-29 13:45:57 -06:00
Luis Daniel Castellanos
989607e4fb Stop memoizing on request argument in neutron api
neutron api should memoize more persistanly on objects that do not
change when rendering each view, i.e. Supported extensions list

Implements blueprint: improve-horizon-caching

Change-Id: Iec38e865a704752309ba7035d19370dc0dbc31e0
2016-07-27 17:20:17 -05:00
yuyafei
24856811d7 Correct reraising of exception
When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I12c90ac8976f5d82291a685e6a94db07e509b35b
2016-07-07 10:38:21 +00:00
chen.qiaomin@99cloud.net
b60275a8cd Show name_or_id when router name is white space
Reproduce:
1 Open Project/Compute/Routers
2 Create a router with name "white space"
3 Then there will be a router with name "white space" display in the table.
  But this router could not be click into it's detail page.
So there should show route's name_or_id when it's name is "white space".

Change-Id: Ib1b8b36c2d5d6b7ca9c5b5c914667ae2e0b91613
Closes-Bug: #1596741
2016-06-28 01:49:05 +00:00
Ankur Gupta
0b807ac1d0 Add Network IP Availability Extension
Network IP Availability has been merged in Neutron,
and, as a result, a new extension is available [1]. There
is a patch in Neutron for adding this api extension [2]
and a patch for adding commands for its usage [3]. This
change basically implements the new api that can be used
to check network usage stats of all the networks or specific
networks created by Neutron.

This patch will add the API extensions to Horizon, and
specifically, add IP usage stats to the subnets network table.

Reference
---------
[1] https://review.openstack.org/#/c/180803/
[2] https://review.openstack.org/#/c/212955/
[3] https://review.openstack.org/#/c/269926/

Partially Implements Blueprint: ip-capacity
Change-Id: I4b88adedc8de975d4aca9aeeb5622ec3410686ec
Co-Authored-By: Dariusz Smigiel <dariusz.smigiel@intel.com>
2016-06-05 14:35:48 -05:00
eric
0ee88956cc Add router L3 agent info to info page
This change tries to lookup the L3 agent location for a router
to assist admins in locating where a router resides.

Change-Id: I62bedcc587791df3a101b9d81a03ba2540dfa033
Implements: blueprint admin-neutron-l3-agents
2016-05-31 12:31:30 +00:00
eric
25b1aa86fb Adding admin lookup of routers per l3 agent
This change allows admin users to find out which routers are
located on which neutron l3 agent.

Partially implements: blueprint admin-neutron-l3-agents

Change-Id: I078ba0a1e6545196c578c8e59d35720c499c301f
2016-05-13 02:14:37 +00:00
Wim De Clercq
c140149308 Add allowed address pair extension UI for neutron ports.
Changed the port detail view to a TabbedTableView where the extra tab is
enabled/disabled when the extension is active or not in neutron. Similar to
how extensions are handled for routers. If the extension is not active the
port detail screen should look the same as it does now.

The extra tab has a table of the allowed address pairs (columns: IP address,
MAC) with create and delete actions.

Change-Id: I07edb1afae5c2004761d1c118a724fb94aaebe3e
implements: blueprint port-allowed-address-pairs-extension
2016-05-04 19:58:17 +00:00