The Glance API will return immediately with a response. We need this
response to give a errror message back to the user in case of invalid
URL.
Any download operation will be executed in the background by the
Glance API server and there is no need for executing this step in a
separate thread.
Keep current logic for updating image with posted data in a background thread
One can argue that this too is uneccessary, but I can see that it may save
time for large images or when bandwidth between Horizon and Glance is limited.
Change-Id: I2ec9f714f9cfd6ca2271750133d6fcac29b94f35
Partial-Bug: 1438975
Fixed two errors when upload an image from a file.
One is the file name doesn't exist error.
Another is file got closed in a new thread since Django 1.7.
Change-Id: Ia64c385d89e0d938b14182f2744251f76b892eac
Closes-Bug: #1451429
Adds support for resource_type, so retrieved namespaces will have
properties with proper prefixes.
Closes-Bug: 1439312
Change-Id: I4c2b450db8189c99624290a1d678fcaf509e1de6
Allow images to be created using glance's --location option
instead of always requiring --copy-from
Change-Id: I2aae47570f09a695adb032c210d7dc770f8cb746
Closes-Bug: #1433819
This is the glance direct / non-abstracted rest API
for the angular front end.
This initial patch will only implement the APIs needed to
support the launch instance work.
This was refactored out of change: 141273
All v1 / v2 work is being done separately in change: 150084
Based on the work done for Keystone here:
https://review.openstack.org/#/c/150636
Partially Implements: blueprint launch-instance-redesign
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Change-Id: I28735e242d610235695b1070a15f739e0d50b696
Provide a base admin UI for viewing, importing, and associating the
metadata definitions that can be used with various resource types
such as flavors, images, and host aggregates.
In Juno, Glance provided a metadata definitions catalog[1][2] where
users can register the available metadata definitions that can be used
on different types of resources (images, artifacts, volumes, flavors,
aggregates, etc). This includes key / value pairs such as
properties, extra specs, etc. Horizon landed several patches that
read these properties. You can view the functionality in the
"update metadata" action on Flavors, Images, and Host Aggregates.
This specific patch is to bring in the Admin UI for the basic coarse
grained actions on the definitions in the catalog. This includes creating
(importing) a namespace, viewing the overview details about
it, deleting the namespace, and associating the namespace for use with
specific resource types.
Future blueprints will be registered for:
- CRUD on individual metadata definitions within the namespace
For example, editing the default value of an individual property.
[1] Approved Glance Juno Spec:
https://github.com/openstack/glance-specs/blob/master/specs/juno/metadata-schema-catalog.rst
[2] Glance PTL Juno Feature Overview:
https://www.youtube.com/watch?v=3ptriiw1wK8&t=14m27s
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Santiago Baldassin<santiago.b.baldassin@intel.com>
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
DocImpact: Concept awareness
Change-Id: Ie34007f73af7e0941631a52f03841068e509a72c
Implements: blueprint glance-metadata-definitions-base-admin-ui
After image upload(successful or fails) from horizon, image
cleaned up from the /tmp
Closes-Bug: #1398766
Change-Id: I2c40e67234a8d0c8bdef9838b863ade9f5434083
Previously token values are logged as DEBUG level when a new client
object is instantiated. In other project and clients, token values
are now not logged and is output as *REDACTED* instead.
In Horizon these log lines do not have much meaning and
we can simply remove them.
Change-Id: I67617ac6424907574d79ec2a57b513a548e220d2
Closes-Bug: #1380642
E127 continuation line over-indented for visual indent
Also fixes E127 introduces by other reviews
after other E127 fixes were merged.
Closes-Bug: #1375931
Change-Id: I0a09f1c2f74c707fc8a347f0ea5975bf2679976e
Previously API client object like novaclient are created
every time methods in openstack_dashboard/api.
It leads to regeneration of API HTTP connections.
This commit caches API client object for a WSGI request
to reduce the number of HTTP connection to backends.
As WSGI request object is recreated, a cached API client
object will live in a single request to Horizon.
Change-Id: I66620b3b0a2737c7232d91006e65d0fabbd3090b
Closes-Bug: #1352144
In Juno, Glance is providing a metadata definitions catalog[1][2] where
users can register the available metadata definitions that can be used
on different types of resources (images, artifacts, volumes, flavors,
aggregates, etc). This includes both simple tags and key / value pairs
(properties, specs, etc).
This widget will get the metadata definitions from Glance
and will let the user add the metadata to the resource being edited.
It provides value validation as well as description information
about the metadata.
An implementation for Images is included in this patch. Additional
patches will be made for other resource types.
This patch also removes Edit Image Custom Properties screen as new
widget provides the same functionality. To avoid regressions owner
property is added to Image Detail screen.
********************** TESTING **************************
You can test this code with Glance patches by following
the instructions at the bottom of this etherpad:
Go to: https://etherpad.openstack.org/p/j3-glance-patches
*********************************************************
[1] Approved Glance Juno Spec:
https://github.com/openstack/glance-specs/blob/master/specs/juno/metadata-schema-catalog.rst
[2] Glance PTL Juno Feature Overview:
https://www.youtube.com/watch?v=3ptriiw1wK8&t=14m27s
Implements: blueprint tagging
DocImpact
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Pawel Skowron <pawel.skowron@intel.com>
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Szymon Wroblewski <szymon.wroblewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Heather Whisenhunt <heather.whisenhunt@hp.com>
Change-Id: I335d4708f5ce8afe58fb88dbe9efd79e2c04fc9e
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.
Closes-bug: #1349820
Partial-bug: #1347472
Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
This adds a new action on the admin images table for viewing the
image custom properties. From this new panel an admin can create,
delete, or update the custom properties. The new setting
IMAGE_RESERVED_CUSTOM_PROPERTIES can be used to specify any custom
properties that should not show up on this panel.
Change-Id: I10a6049e8cc6a06f31497e17a66d7031cd049c68
Implements: blueprint manage-image-custom-properties
The Glance API supports a sort direction which we can use to paginate back
The Prev href tag contains a marker id of the first item in the table.
When clicked, a GET API call is made, passing in this marker and the sort_dir='asc'
This will return the previous page's data. Then we have to re-sort the data because
it is ordered backwards. We use the default sort_key='created_by' for this.
Once the patch #1252649 is restored, we can add the same behavior to Project > Images.
If we are able to get the consistency across the APIs to include the sort_dir, then we can
bring Prev to the other project tables as well. There are some blueprints to enhance
API capabilities in this area.
Change-Id: I3e7c6a2db595838dbdff595dc8f0fdda288b6bcf
Partial-Bug: #1263142
Partial-Bug: #1282987
Partially-implements: blueprint pagination-add-prev-link
Sufficiently large image uploads into Glance from Horizon can cause
timeout errors, since the image upload needs to complete before the
view can render, and such activities can cause browser timeouts.
Since the webserver already has the file, and close-to-open semantics
should prevent cleanups from losing any data, just send it in a
background thread, the same way as if you told Horizon to fetch it
from a remote location.
Change-Id: Ia056367032e0d08edf6f36a8e9f900fddba85fdf
Closes-Bug: 1322399
Set purge_props=False to ensure we do not delete properties that
we have set on the image.
Change-Id: I4d8a9b8b20ef946e86389c59e79e874f078e1db3
Closes-Bug: #1325787
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Horizon should treat the glance API endpoint URL the way it treats
other API endpoint URLs.
Horizon should trust that the retrieved URL is correct, and let the
python-glanceclient use the URL.
Change-Id: Ie6230b1e4b90f686c8a7ab7368944b6c3412b284
Closes-Bug: 1188182
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.
Partial-Bug: #1279611
Change-Id: Ie49589651ed80d8fc3196fb0750cbb04661c19cd
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
After creating an image with empty name (only space characters in the name),
and attempting to view it, the view crashes.
Glance is not returning the name X-Meta-Header on the response if the
name is not set or empty.
Change-Id: I0c55e302d22552e932bdd32e10d00a103d252429
Closes-Bug: 1261367
Centralizing duplicate code around the default page size.
Additionally, we now read the 'horizon_pagesize' cookie set for
the user in the settings panel to reuse the value across sessions.
Closes-bug: #1251456
Change-Id: I78b6c978926f53a598f89745c517b8083270e5ba
In an effort to help horizon more friendly to OpenStack hacking
guidelines, we now gate on H40* violations.
Change-Id: Id07294543660368d2f7f5ac363710176ab23b874
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
The various OpenStack client libaries support specifying a SSL
certificate that should be used to verify the SSL-connection, but
this option was not exposed in the horizon options. This patch
implements that. Note that although some clients do implement a
cacert-parameter, they do not necessarily actually verify the
certificate (Swift).
Change-Id: I9dfbd48a0d96103421da7d884e839d591a90cab1
Implements: blueprint ssl-cacert
This makes the API calls that are claiming to do pagination work
the same as Nova, which has had it the longest. Namely, there's a
user setting to control how many rows get returned. Make them heed
it.
Fixes Bug: 1217608
Change-Id: I19b4d7c77d595b898abb81462f6343bbc1b93eb6
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
Don't filter snapshots from images data, display image_type column in images table,
don't translate image string in get_image_type method, don't show LaunchImage button when
image is in different state than active, remove snapshots table from the UI, update tests
Fixes: bug #1140760
Change-Id: Ie6cc5bc98fa97de00b55540fe9f60e90d20acab3
For project images, disable pagination entirely as it's not compatible
with client-side filtering (at least without moving to asynch table
loading). This can be revisited when we move to glance v2, which
apparently supports filtering by owner.
For snapshots and admin images, fix pagination by making sure the
iterator returned by glanceclient isn't exhausted completely when
returning a page of images. Do this by slicing just the number of
images we require (+ 1 to check if there will be another page after
this one).
Fixes bug #1083034.
Change-Id: I692f57dec6dca16cf8909f5b234aadb002702fc8
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.
Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b