Glance doesn not accept editing specific readonly metadata
properties, so we need to remove them from update request.
Change-Id: Ia9d8381f4add5cf6d82f2568b483d1c0b8d1a8b7
The edit and create image pages could only set public or private
visibility for an image. With Glance v2, we have 'shared' and
'community' available to us. This commit adds buttons for those
pages selectively when the policy allows it.
It also only displays 'public' visibility if policy allows.
Closes-Bug: #1792411
Depends-On: https://review.openstack.org/#/c/614688/
Change-Id: I193bc0580e4bf9351ad7f17b148a5062e95313ab
Uppon failure, the createImage function returned a raw xhr error
that was incompatible with the wizard modal, making it display
the [Object object] error.
This change makes it so a generic error message is thrown directly
if it's not an handled glance error, so it could be shown on top of
the wizard modal.
Change-Id: I637bf1002630fe21f5ad20a7a047ec65ebc052dc
Closes-bug: #1703708
When there is an error from createImage, it still invokes
onCreateImage function which should be invoked only when
successful service call. Fixed onError function to throw
the error and the error will show up in the modal toast
message.
Change-Id: I20725f894835714d8245ec8b192937110cf11ab5
Closes-bug: #1630833
Create Image service uses $scope captured in a closure var `scope` to
pass the upload progress of the local image file to Glance service
into modal form controller.
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I98711e6a5e59c91ef71a726a6ff094767d421ef7
First, now there are 2 '/api/glance/images/ API wrapper endpoints for
creating a new image - POST and PUT. The POST endpoint which existed
before now resides at PUT. This was done to support legacy
(i.e. proxied by web-server) file uploads in Angular Create Image,
because Django (which we need to use in that case) doesn't correctly
process PUT request. So, if local file binary payload is added to the
form contents, we send it using POST request.
Second, speaking of '/api/glance/images' PUT request previously known
as POST... Where before the POST call to Horizon REST API wrappers
returned the final image object that Glance just created, now there
are two possibilities for what happens after PUT is sent.
* When Create Image form Source Type is set to URL, then everything is
going as before.
* When Source Type is set to File, then just a file name instead of an
actual Blob is sent to '/api/glance/images', then the Glance Image
is queued for creation and Horizon web-server responds with an Image
object which dict() representation has 2 additional keys:
'upload_url' and 'token_id'. The 'upload_url' tells the location for
the subsequent CORS request, while 'token_id' is passed as a header
in that request, so Keystone would let it in. CORS upload is started
immediately as Image is queued for creation (first promise is
resolved) and returns the second promise, which is resolved once the
upload finishes. The modal form hangs until second promise resolves
to indicate that upload is in progress. Upload progress notification
is added in a follow-up patch.
DEPLOY NOTES
The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard).
Related-Bug: #1467890
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I5d842d614c16d3250380ea1dc1c6e0289d206fb5
bumps the eslint version to 1.10.3 which fixes a lot of
issues, especially rules not working as expected
or being ignored and brings the js code up to date to
comply with those rules.
Change-Id: I1234e7991f98d4ceb0c5333dc036c6a30206ff64
There are many eslint warnings in this directory. This patch cleans
them up, about 100 warnings removed.
Change-Id: I639dccd7b511190552f05ae0e52234532412e54c
Partial-Bug: 1554824
The Angular API library for Glance has a function getImage(). This
function currently calls to an API like:
/api/glance/images/abasdfasdfas
However, that returns a 301 and redirects to:
/api/glance/images/abasdfasdfas/ <-- trailing slash
This causes latency and unnecessary overhead.
To test this fix, first verify the 301 problem before applying:
Run Horizon in debug (watch the server responses)
Enable the NG Images panel (enable _1051_ng_image...).
Go to the NG Images panel, then as you click on a Details view,
withess the 301 call with no trailing slash, followed by a
successful call with a 200 and trailing slash.
Then apply the patch.
Then do the same, but notice how there is only one 200 call, with
the trailing slash.
Change-Id: I0f119e2568d41c4aa63176a8bf8f2fabfbed1b47
Closes-Bug: 1559279
Horizon currently uses the OS::Nova::Instance resource type when
querying for instance metadata, but it should use OS::Nova::Server
to align with Heat and Searchlight.
See also:
https://review.openstack.org/272271
Closes-Bug: #1537903
Change-Id: I1deab8ed74515d08301e68bd2c75604d35592c50
This allows specifying a properties target when fetching metadata
definitions namespaces from glance, and updates the instance
metadata widget to show only "metadata" properties (as opposed to
"scheduler_hints") when creating an instance or updating the
metadata.
Closes-Bug: #1537842
Change-Id: I64dd279139eca2cbd0c0a6e808ade4cbcba8df95
Adding REST API calls for use in the new angularized
panels for Metadata definitions.
Set DISABLED = False in
openstack_dashboard/enabled/_2131_admin_metadata_defs_panel.py
Change-Id: I08c9c05a7b0870160ede7eb7645fc9daa83e2dd5
Partially-Implements: blueprint ng-metadata-defs-panel
Adds the ability to delete multiple images
from the images panel.
Adding row action to delete single image to angular images panel
Work needs to be done on the actionss directive per the feedback
To test set DISABLED = False in _1051_project_ng_images_panel.py
Co-Authored-By: Kristine Brown<kbrown@thoughtworks.com>
Co-Authored-By: Errol Pais<epais@thoughtworks.com>
Co-Authored-By: Kyle Olivo<keolivo@thoughtworks.com>
Change-Id: I59d13e0b2225f2b3a05f93b2356029561dbd28bc
Partially-Implements: blueprint angularize-images-table
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
This is needed to check if Image Metadata can be
updated.
Change-Id: I23f8b84f5f72a6423b0c453413faef25f2e139d2
Partially-Implements: blueprint angularize-images-table
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
Use the Service style as documented in
https://github.com/johnpapa/angular-styleguide#style-y052
Fix a eslint error on security-group.service.spec.js
Changes API Services from Angular service to factory.
Change-Id: I76ef729e51878d67c355d1edc774d936038d7f62
Partially-Implements: blueprint john-papa-style-guide
Partially-Implements: blueprint jscs-cleanup
This patch relocates the 'openstack-service-api' directory because
they are application specific, but needed by multiple dashboards.
Co-Authored-By: Tyr Johanson <tyr@hp.com>
Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Change-Id: Ie5455f3ca4cfaacb99cbccd66c95fb3ad31da272
Partial-Bug: #1478717