Commit Graph

47 Commits

Author SHA1 Message Date
Akihiro Motoki e4444e6979 Address RemovedInDjango40Warning (4)
In Django 3.0, django.utils.http.urlquote(), urlquote_plus(),
urlunquote(), and urlunquote_plus() are deprecated in favor of
the functions that they’re aliases for: urllib.parse.quote(),
quote_plus(), unquote(), and unquote_plus().

https: //docs.djangoproject.com/en/4.0/releases/3.0/
Change-Id: I37fcd917cbf87b4d3141cfbdd2675aa38f33f2a4
2022-02-04 16:27:18 +09:00
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
Akihiro Motoki 672c43c43e Drop OPENSTACK_NOVA_EXTENSIONS_BLACKLIST finally
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (3/3)

Clean up nova extensions related code in the API layer.

Change-Id: I9730095365342cac1023f4112bae4b3a28cdeaf7
2020-10-27 20:02:05 +09:00
Akihiro Motoki 74df97f57c pylint: Fix unnecessary-comprehension warning
'unnecessary-comprehension' warning is emitted when
unnecessary use of a comprehension is found.

classes attribute in Action can be a tuple,
so we need list() to ensure it is a list before adding 'disabled'.
I think it is time to introduce a method in Action class or somewhere
but it should be handled separately.

Change-Id: I16a98d56b6d0bd0af234b00735c6ed576620df7e
2020-09-27 12:44:16 +09:00
Akihiro Motoki 692778f8cf pylint: Address no-else-return warning
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.

Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
2020-09-27 12:44:16 +09:00
Matt Riedemann b148c92075 Remove dependency on novaclient list_extensions API
The novaclient list_extensions API binding was removed in the
16.0.0 release [1]. The ability to enable/disable extensions
in nova has been deprecated since Liberty [2] and was removed
in Newton [3].

For horizon this only matters for the OPENSTACK_NOVA_EXTENSIONS_BLACKLIST
config setting and some javascript code used to compile panels based on
enabled extensions. In order to work with novaclient 16.0.0+, this
change removes the list_extensions usage since all extensions
are enabled in nova and thus for horizon a nova extension is only
not supported if it's in the configured blacklist. To continue supporting
the javascript code which uses the getExtensions function, the extension
names are hard-coded. Note that the method meant to test that code,
_test_extension_list, was wrong but never ran because of the underscore
prefix on the method name. That is fixed here.

[1] https://review.opendev.org/686516/
[2] https://review.opendev.org/214592/
[3] https://review.opendev.org/351362/

Change-Id: Iebb1e78c718b931d632445e4de6d7a29ccb92be2
Closes-Bug: #1847959
2019-10-24 15:24:39 -04:00
Daniel Vincze e332cef01c Add key_type selection on Keypairs form
Key type can be selected through both Django and Angular panels.
This change will allow X509 Public Certificates to be imported
or created through Horizon.

Also, the key type is being showed in the keypairs list.

Change-Id: I0a07b4805e6af96f06ec12d2e86708c94946e9c9
Closes-Bug: 1816041
2019-03-13 16:32:06 +02:00
Feilong Wang cf06d278af Get flavor list sorted when launching instance
Currently, the flavor list is random on the panel of booting
instance, which is not a good experience for end user. This
patch fixes it and adds test accordingly.

Closes-Bug: #1715042

Change-Id: Id5369ab75487d214a3395ba507b4394d4497903e
2018-05-30 22:54:31 +00:00
wei.ying 940ff111a1 Add angular server group details page
This patch adds angular server group details page to show details of
the given server group, also shows the server group members under the
current server group.

Change-Id: I5b903972dd4fc5c9f1b52f97bdd7e0852d7d00d3
Partial-Implements: blueprint ng-server-groups
2018-03-18 22:42:43 +08:00
wei.ying 37647dd318 Add angular delete server groups action
This patch adds delete actions for angular server groups panel.

Change-Id: I9cd887fb315a5523c44c48d284cdea3a6673b3b2
Partial-Implements: blueprint ng-server-groups
2018-03-18 22:20:03 +08:00
wei.ying df857f00b5 Add angular create server group action
This patch adds create server group action for angular server groups
panel.

Change-Id: Ia4354448dcb42bc5e53e2415084f0569a75a68a3
Partial-Implements: blueprint ng-server-groups
2018-03-16 23:51:41 +08:00
Akihiro Motoki 8373701bdf Avoid Unhashable warning in api.rest.nova
A list object is not hashable. We need to pass a tuple object
which is hashable.

Change-Id: Iaccd527da65218e46ff8cad8963fd336d0138c25
Closes-Bug: #1738537
2017-12-31 06:40:31 +00:00
Akihiro Motoki 4c8a294aee API micro-version support for multiple features
Previously horizon micro-version support only supports one feature,
but there is a case where we need to support more than one feature
using micro-versioning. For example, "instance_description" and
"auto_allocated_network" in the server create operation both require
micro-version. This case was not supported previously.

This commit changes get_microversion() function to take a feature list
and looks up a micro-version which supports all requested features.

A known limitation is that we need to re-call get_microversion() with
different feature(s) if no micro-version which satisfies all requested
features is found and we would like to look up a micro-version which
supports a subset of the requested features. Most features are expected
in recent API versions, so I believe this would be a minor limitation.

Change-Id: I46f1c7fa1ddcf1dfac93d921cffaf3aa5ac011a7
Related-Bug: #1690433
2017-12-03 07:59:32 +09:00
Zuul 865f793ff8 Merge "Add MKS console support" 2017-11-30 04:39:27 +00:00
yong sheng gong 1f41f29f0b Add MKS console support
Co-Authored-By: jinke <jin.ke@99cloud.net>
Co-Authored-By: yong sheng gong <gong.yongsheng@99cloud.net>

Change-Id: Id8ee4a28a09eb3d7f7598c507c0a4320a97cd01c
implements: bp support-mks-console-type
2017-11-29 21:06:38 -05:00
Shu Muto e7f22178b2 Add delete action for key pair
This patch adds delete actions for angularized key pair panel.

Change-Id: Iccb5014add0e19d6154bd6261d97a83b2ecdf32f
Partial-Implements: blueprint ng-keypairs
2017-11-01 14:53:04 +09:00
liyingjun 2161b91264 [Micro version] Support description for instance
In Nova Compute API microversion 2.19, you can specify a “description”
attribute when creating, rebuilding, or updating a server instance. This
description can be retrieved by getting server details, or list details
for servers, this patch adds support for this attribute for instance in
horizon.

Change-Id: Ic9217234021d236aee8295915f1a9c3c544396b0
Implement-blueprint: support-description-for-instance
2017-10-26 22:36:00 +08:00
Jenkins 631df03dfe Merge "Angularize Key Pair Details" 2017-10-07 04:47:13 +00:00
Shu Muto 194c881396 Angularize Key Pair Details
This patch adds Angularized details view for Key Pair.
Also, added new filter 'mediumDate' that format date as follow:
e.g) Feb 3, 2001 4:05:06 PM

Change-Id: I1eaead66a582c15442b28ae83fb1c573a46b0f43
Partial-Implements: blueprint ng-keypairs
2017-09-28 16:57:49 +09:00
Akihiro Motoki af3b7e4134 flake8-import-order: Ensure to place project imports last
To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checks only standard imports or not.

Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe
2017-09-20 01:19:38 +00:00
Jenkins f5b2561a09 Merge "Use POST not GET for keypair generation" 2017-06-16 09:00:05 +00:00
Akihiro Motoki b9d0243c33 Fix H405 (multi line docstring) warnings (openstack_dashboard)
H405: multi line docstring summary not separated with an empty line

Closes-Bug: #1696996

Change-Id: Id895695663b19522d9cdc22f8b012e49680d708b
2017-06-09 16:05:31 +00:00
Matt Borland d07fedc45f Use POST not GET for keypair generation
This patch fixes the Cross-Site Request Forgery (CSRF) attack against
the keypair generation pages:
- HORIZON_URL/project/key_pairs/PAIRNAME/generate/
- HORIZON_URL/project/key_pairs/PAIRNAME/download/
These pages exposed creating and/or overwriting a keypair with a given
name via a CSRF attack.

This patch closes these holes by using only POST-based keypair creation,
and exposing the keypair in the contents of a modal dialog instead of a
download, which ultimately requires a GET.  It uses the same client-side
features for both the Launch Instance keypair creation and Compute / Key
Pairs panel.

Closes-Bug: 1575913
Change-Id: Ie5ca28ff2bd806eb1481eba6f419b797b68856b6
2017-06-08 11:13:31 -07: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
Itxaka 4958805863 Merge "missing" quotas with nova quotas
There was an extra variable for the so called "missing"
quotas since 2013. This patch merges them with the
normal nova quotas, cleans up the tests, removes any
usage of that special var and as a side effect, adds
the missing keys to the project quota update page.

Change-Id: Icaac1ebb1749e13fdfc307e89dcc6bbd64bef922
Closes-Bug: 1655393
2017-03-01 15:30:33 +00:00
liyingjun 49a5e68a17 Add missing scheduler_hints to _optional_create
The scheduler_hints option is missing from server_create rest api.
This patch adds it.

Change-Id: Iab587abecbfd73fec8e966ca86cdde7242c80207
Closes-bug: #1655255
2017-01-12 06:29:59 +00:00
Cady_Chen 51fe944449 Replace six.iteritems(iter) with iter.items()
As mentioned in [1], we should avoid using six.iteritems(iter) to
achieve iterators. We can use iter.items() instead, as it will
return iterators in PY3 as well.

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ieadd5fa69b3f6058c0641a5b96ef3e8e1e3f6cc2
2016-12-14 11:13:20 +08:00
Akihiro Motoki 35d2becdd6 Fix docstring warnings
Partial-Bug: #1411719
Partial-Bug: #1486222

Change-Id: I2d649295e7425ab73f09f3a5d91076350bf7ed7a
2016-09-24 20:44:48 +09:00
Matt Borland 93b7edd694 Add more Nova API features for NG Instances
This patch adds more Nova API features for instances.  It establishes
several new proxy APIs and provides the various JavaScript libraries for
accessing those APIs as well.

Change-Id: I016be1d0598faf78b1fb02f4d0768efdaf6cb7bf
Partially-Implements: blueprint angularize-instances-table
2016-08-12 14:43:37 -06:00
Jenkins 7ae9c6317e Merge "Angular LI:Make sure we always get all limits" 2016-07-26 23:02:02 +00:00
Brad Pokorny cf91124d0c Choose a server group when booting a VM with NG launch instance
Allow users to choose a server group when booting a VM.  Adds
an optional workflow step to the launch instance workflow that
shows the available server groups and details about each group.
The ability to choose a server groups already exists for the
legacy launch instance workflow as a dropdown list, but having
it as a separate step in the angular workflow provides the added
capability of seeing group details.

To test this patch, create a server group via the nova CLI. Example:
  nova server-group-create group1 affinity

And use the angular launch instance workflow to select a server
group. To validate the new instance was added to the server group,
use the nova CLI:
  nova server-group-get [ID of server group]

Change-Id: I651817850ef8a5afec047a9a481843a5eddbf5a9
Implements: blueprint nova-server-groups
2016-07-19 09:25:52 -07:00
Itxaka 5c5f35afc2 Angular LI:Make sure we always get all limits
When checking with nova for the absolute limits
we were not taking into account the reserved
quotas (i.e. instance in rebuilding will take
cpu and ram) so this could lead to wrongly
thinking that the user could launch more instances
that its quota allowed. It also made the overview
page display wrong quotas as it didnt took into
account those reserved resources.

Change-Id: I42d0bc1521a9da26ee2d23a5900c67badeb2d04b
Closes-bug: 1561310
2016-07-01 09:50:25 +00:00
Paulo Ewerton Gomes Fragoso 3945b24062 Adding Identity NGProjects API
This patch adds some projects-related endpoints to the Nova,
Cinder and Neutron REST/Angular APIs.

These changes are needed for the angular Identity Projects
actions that handle mainly project quota updates.

Partially-Implements: blueprint angularize-identity-projects

Change-Id: I98b8eb9e5e7bfb0d49a77c00115fe62d412abe21
2016-06-21 13:12:43 +00:00
Rajat Vig df14d977c9 API for getting and updating quotas
Adding API for getting and updating default
quotas information from nova and cinder.

The patch for the panel is at
https://review.openstack.org/#/c/205296/

Co-Authored-By: Kyle Olivo <keolivo@thoughtworks.com>
Co-Authored-By: Kristine Brown<kbrown@thoughtworks.com>
Co-Authored-By: Dan Siwiec<dan.siwiec@thoughtworks.com>
Co-Authored-By: Paulo Ewerton <pauloewerton@lsd.ufcg.edu.br>

Change-Id: Ia8e26e10b816d0dba69542b8da4ad18cccf5173a
Partially-Implements: blueprint ng-defaults-panel
2016-06-06 11:58:14 +00:00
Justin Pomeroy 4254165250 Support scheduler hints when launching instance
This adds the Scheduler Hints step to the angular Launch Instance
workflow and allows specifying arbitrary hints when launching an
instance. It also displays available hints from the glance metadata
definitions catalog OS::Nova::Server namespace that use the
"scheduler_hints" properties target.

Implements: blueprint add-scheduler-hints
Change-Id: Ic33c31e645f45b7a4cbdf13e9a115c96399d5e32
2016-04-15 22:47:57 +00:00
Rajat Vig 0903fd20ff API Services for Flavors Panel
Adding the api services needed by the flavor panel
for the sub flows

To test set DISABLED = False in _2081_admin_flavors_panel.py

Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>
Co-Authored-By: Errol Pais <epais@thoughtworks.com>
Co-Authored-By: Kristine Brown <kbrown@thoughtworks.com>
Co-Authored-By: Kyle Olivo <keolivo@thoughtworks.com>
Co-Authored-By: Yakira Dixon <ydixon@thoughtworks.com>
Co-Authored-By: Dan Siwiec <dsiwiec@thoughtworks.com>

Change-Id: Iad97739203a05cce3c971cc8458cd2eb67e117d3
Partially-Implements: blueprint ng-flavors
2016-02-10 08:23:17 -08:00
Errol Pais 4365f02759 Launch Instance - Nova API for Download Key Pair
Adding endpoints to the Nova API to:
* Create a keypair, associate it to the instance
and return the private key to be downloaded.
* Recreate a keypair for the instance
and return the private key to be downloaded.

Partially Implements: blueprint launch-instance-download-keypair-redesign
Change-Id: Ie808c43287fc3ebd65af066cb86d0aa423733f6e
2016-01-19 10:12:42 -08:00
Jenkins 634b525537 Merge "Add getServers function to nova rest API" 2016-01-08 04:43:53 +00:00
Justin Pomeroy 79971c627b Add action for editing instance metadata
This adds the Update Metadata action to the instances table to allow
managing the metadata on an instance. This is very similar to the
Update Metadata actions for images, flavors, etc.

Implements: blueprint edit-server-metadata
Change-Id: Ia09a05f5cd93898ec9d64ac7af1e6baf07e71757
2016-01-04 08:46:28 -06:00
hgangwx 5e855ddba8 Wrong usage of "an"
Wrong usage of "an" in the mesages:
"Width an height of the chart will be taken from chart wrapper"
"an flavor. By default this will return the flavors"
"allocate an floating IP"
"Each item is an namespace"

Should be:
"Width and height of the chart will be taken from chart wrapper"
"a flavor. By default this will return the flavors"
"allocate a floating IP"
"Each item is a namespace"

Totally 5 occasions in Horizon base code.

Change-Id: I154257da9c93b33fc7353e2e642e9e406978162b
2015-12-30 13:53:53 +08:00
Rajat Vig 436e0fb868 Add API services for system information
Adding API services that are necessary for displaying System Information.
This patch will contain all of the APIs necessary to populate those tabs.
HTTP code 501 is introduced, to communicate to the UI that an API extension
is not available. This simplifies the UI implementation by avoiding making
an additional 'check' call from the UI

Co-Authored-By: Kristine Brown <kbrown@thoughtworks.com>
Co-Authored-By: Kyle Olivo <kyle@kyleolivo.com>
Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>
Co-Authored-By: Dan Siwiec <dan.siwiec@thoughtworks.com>

Change-Id: I64167d8f5f8e914667f4b6582edc00463f9e0d4a
Partially-Implements: blueprint ng-system-information
2015-12-16 23:22:20 +00:00
Justin Pomeroy 1515caaba8 Add getServers function to nova rest API
This adds the getServers function to the nova rest API module so
that new angular code can use it.

Partially-Implements: blueprint angularize-instances-table
Change-Id: I2be7e37f0065bda66fbacbb1f9898551819f45c8
2015-12-10 14:18:05 -06:00
Timur Sufiev 5398de264d Enable Launch Instance NG for the case when Nova quotas are disabled
Do this by representing every float('inf') python numeric as a 1e+999
JSON token - this way Javascript JSON.parse() correctly transforms it
to the Javascript Infinity object. The infinity value corresponds to
disabled limits.

The logic of representing infinity values as 1e+999 tokens is
implemented by means of custom `NaNJSONEncoder` which overrides
`iterencode` method of its `json.JSONEncoder` ancestor. Due to the
fact that the ancestor method could take an advantage of
`c_make_encoder` function (which is implemented in C) - and thus could
be much faster, I'm using the custom encoder only where it's really
needed, to not hamper Horizon performance.

Rewrite pie-chart directive rendering according to
https://invis.io/A4445BDSF

Change-Id: If498d9ccd5f0144c9e78ae58583ede2c1cf83f0b
Closes-Bug: #1482705
2015-09-18 17:55:59 +03:00
Szymon Wroblewski f030262521 Angular metadata update modal
This patch adds metadata update modal dialog widet written in js
and some required REST API methods.

To see it in action checkout following patch
https://review.openstack.org/#/c/184275/
which replaces old metadata modals with new ones written in angular.

Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>

Partially-Implements: blueprint angularize-metadata-update-modals
Change-Id: I36bfb91f8b6bbba49fed6bb01cd1dd266261cfdb
2015-08-25 15:20:47 +02:00
lin-hua-cheng 4475225cbe Replace usage of urllib in nova rest api
urllib is incompatible for python 3.

Change-Id: I3d70cd3f77a946afd4e873823edfdc5bd0e07a16
2015-03-16 09:56:34 -07:00
Travis Tripp b915760a56 Nova Flavor Server Extensions Rest APIs - Angular
This provide flavor APIs for launch instance work.
This provides extension APIs for launch instance work.
This provides single server get for instance details work.
This provide single flavor get for instance details work.

Partially Implements: blueprint launch-instance-redesign
Partially Implements: blueprint instance-details-redesign

Change-Id: Ia1fd36ec31de21c60801f4d47716ef69aad7525f
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
2015-02-26 16:05:54 +11:00
Cindy Lu d227402f56 Nova REST API for angular front end
This the nova service REST API needed to support the create instance
wizard work.

This patch now follows the new verb usage patterns.

Partially Implements: blueprint launch-instance-redesign
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Change-Id: I0096665aed325addafdcc985d7460ac8b21cb902
2015-02-19 14:09:56 +11:00