Glance uses http-proxy-to-wsgi middleware from oslo.middleware in
its pipeline in order to efficiently forward request headers in case
of load balancer style deployments. Hence, the configuration option
``secure_proxy_ssl_header`` was marked as deprecated.
This patch removes the option and the support for it within Glance
to entirely rely on oslo middleware. This will ensure that the related
headers set by oslo.middleware:HTTPProxyToWSGI is never modified in
Glance.
Change-Id: I11d41bb736bbfd90030d88245c11642823e4c400
Closes-Bug: 1673908
This API version increment is due to change I6a875a38bef5, which
corrected the response code for the admin-only API call:
PUT /v2/cache/{image_id}
The call now returns 202 upon success (it had been returning 200).
The intent of this version bump is to get the attention of operators
to take note of this change; from now on, the call always returns 202
upon success regardless of what API version you request.
Additionally, cleaned up some version tests that had gotten out of
date and were not thoroughly testing version negotiation.
Also, corrected the version negotiation code around the v2.13 API.
The versions response had been modified by change I6882fd2381e6 to
only include v2.13 when the 'enabled_backends' config option had a
value, but the versions negotiation code was not updated to reflect
that.
Change-Id: I0cf35ed7e21497826cd581e59aa58774f030b9f6
Related-bug: #1971521
This patch adds a new API to glance ``GET /v2/info/stores/detail``
to expose the stores specific details about the store like store
type and other specific store properties.This operation
will be admin only and validated by the new policy rule
``stores_info_detail`` which defaults to admin only
Implements: blueprint expose-store-specific-info
Change-Id: I6882fd2381e6ae245fd8c61bf9f4d52df2b216f5
This adds a /v2/info/usage API endpoint which exposes to the user
their current limits and usage.
The discovery API does not (appear to) have existing tests, so this
adds a module for that, although only usage tests are added currently.
Implements: blueprint quota-api
Change-Id: I50c98bac50f815bdb9baae024e77afd388f74554
This is a rather beefy change due to the number of usages of this
import. The changes are trivial though.
Change-Id: I7badeeaca438b0291f4ed86670e7f217e6372c61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This handles the possible vhost in Glance API path correctly
(like https://cloud.example.com/image) contrary to host_url.
Change-Id: If86d805ddc46944e3aa2785aa5d775fe15b8468c
Closes-Bug: #1823703
This change removes experimental status from Api versions
>2.7 setting 2.8 (multi-store support) to SUPPORTED and
2.9 (caching) to CURRENT.
NOTE: 2.8 will show up in list only if the glance-api service
is configured with multi-store. The API versions list can be
used to determine if the multi-store functionality is availabe
in the endpoint.
Change-Id: I37350fc46191074d42edc73c2451eae73261957d
This change contains minor version bump to Images API to
indicate latest changes to the API.
Also has config file sync for for M3 release.
These two are combined for saving some gating time due to
busy infra at Train milestone 3 deadline.
Change-Id: I13133c32734751d43cc3afed9b68d015cebd5b6b
This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command
This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.
Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
Whether or not the v2.6 EXPERIMENTAL API is exposed at a site
depends on the enable_image_import config value. If it's False
(the default), then the API a client sees is the CURRENT v2.5
API, and any of the v2.6 calls made against 2.5 return a 404
(same as if you were running Ocata). This patch adjusts the
'versions' response so that when enable_image_import=False,
the EXPERIMENTAL v2.6 does not appear in the response.
Change-Id: Ibe164f02c99d10f5a5edd0de96c665413a12f700
Closes-bug: #1711829
The MVP of image import functionality will be introduced as an
EXPERIMENTAL 2.6 version of the Images API. The current version
will remain at 2.5.
This patch:
* Updates the version response
* Updates version negotiation code
* Updates unit and functional tests
* Updates the api-ref
* Adds a releasenote
Change-Id: Ied573897157e05f7b0438baeb1553326fb06613a
Change-Id I94bc7708b291ce37319539e27b3e88c9a17e1a9f (Community
Images) entails a minor version bump in the v2 API.
Change-Id: I2b7cd5ec9b974ebc738feb89ef22c428fbe3be06
Depends-On: I94bc7708b291ce37319539e27b3e88c9a17e1a9f
There are several places in the source code where
HTTP response codes are used as numeric values.
These values are used from six.moves and the
numeric values are replaced by constants.
All of the used status codes were replaced with symbolic constants
from six.moves.http_client.
More about six.moves.http_client can be found at [2],
under the table "Supported renames:".
Also, this change improves code readibility.
This patchset does not extract numeric values from
the code itself, but it can be found at [1].
[1]: Ib9e26dcea927e96e65c626c18421621d3a29a64d
[2]: https://pythonhosted.org/six/#module-six.moves
Change-Id: Idfc7b043552f428f01ac3e47b270ee0639a8f5bc
Closes-Bug: #1520159
This is the minor version bump for Newton after some of the API
impacting changes occur.
APIImpact
UpgradeImpact
DocImpact
Depends-On: Ie463e2f30db94cde7716c83a94ec2fb0c0658c91
Change-Id: I5d1c4380682efa4c15ff0f294f269c800fe6762a
This patch deprecates the Images (Glance) v1 API and sets up a warning
message for the operators if they have enabled it. It also indicates
that we intend to remove the v1 API on or after the Pike release and
operators are encouraged to deploy only the v2 API. The message also
states that after removal of the v1 API, the only option to deploy and
use will be the Images v2 API.
The commit includes:
* Deprecation warning of the v1 API if it's enabled
* Deprecation warning for the following configuration options and
release they have been deprecated since:
* enable_v1_api
* enable_v2_api
* enable_v1_registry
* Reason why the v1 API has still been kept enabled by default via
the corresponding configuration option
* Reason for deprecating the configuration option enable_v2_api, even
though we are only deprecating the v1 API
* Necessary test changes to ensure the deprecated API is checked
accordingly
* Release notes for this change
DocImpact
UpgradeImpact
Co-Authored-By: Mike Fedosin <mfedosin@mirantis.com>
Co-Authored-By: Nikhil Komawar <nik.komawar@gmail.com>
Implements blueprint deprecate-glance-v1-api
Change-Id: Iab0c4abaea247044fee545342ac450e3415432f7
The current versions tests contain a class to test the versions
response, and a class to test version negotiation, but this put us
in a situation where the 'versions' response was correctly updated
for v2.3, but the negotiation to map v2.3 -> v2 was not, thereby
making calls to /v2.3/whatever fail even though all tests in both
classes passed.
This patch adds a new test class that inherits from both of the
current test classes. It contains tests to verify that all the
versions mentioned in the versions response are mapped correctly
so this kind of partial update situation won't happen again.
Partial-Bug: #1609571
Change-Id: I9e93b0f075eb6129c912dfca0a5d005f71bbc253
Co-Authored-By: Nikhil Komawar <nik.komawar@gmail.com>
Co-Authored-By: Brian Rosmaita <brian.rosmaita@rackspace.com>
Glance API is at v2.3 listed to be CURRENT version but the version
negotiation middleware lists only v2, v2.0, v2.1, v2.2.
Version negotiation middleware and related tests must include v2.3
Change-Id: I4018af408fa45f3ac0ad6e9c8229428a9f87089f
Closes-Bug: 1609571
Return correct scheme in version URLs if service
behind an SSL termination proxy.
This is done by adding a new configuration option,
secure_proxy_ssl_header, which, when defined, makes
the wsgi application take the host_url scheme from
that header. By default, when this option is not
specified, there is no difference in behavior.
The intention is to configure any ssl-decrypting
proxy to set that header, so that glance-api knows
which protocol to use in the URLs in response.
This patch is largely based on the equivalent
nova patch: https://review.openstack.org/#/c/206479.
Partial-bug: 1558683
Change-Id: I9a9c0e42a6ad3c18d197f10095958b48d5cb879a
EXPERIMENTAL Glance v3 API has been removed in favor of standalone API
(EXPERIMENTAL Artifacts API of v0.1).
This patch introduces a new process entry point to run on a different
port (9494 by default), with its own configuration file and a paste
config.
A controller stub for old /v3 api remains in the glnace.api package for
the compatibility with existing paste configuration which may reference
it. This stub returns a 301 redirects to glare endpoint if it is present
or 410 errors otherwise.
To reuse the existing version_negotiation middleware some refactoring
has been made.
Implements blueprint: move-v3-to-glare
Change-Id: I5b7bd4cdcc5f2a40fc4a5f74bcc422fd700c4fb0
Since v3 is still unstable and has experimental status it's
better to disable it by default for security reasons. This
commit does it by setting 'enable_v3_api=False'.
Also all required documentation was added to related sections.
DocImpact
Change-Id: I412d0645d667400333532123008a24966aa23880
Adds REST API layer for Artifact Repository, binds all other changes
together.
Artifact Repository is run as a part of Glance api.
Requests are routed to /v3/artifacts endpoint on the api port.
API version in version selector is marked as experimental.
Registers artifacts service and a sample Artifact Type in Glance entry
points config.
Implements-blueprint: artifact-repository
FastTrack
Co-Authored-By: Inessa Vasilevskaya <ivasilevskaya@mirantis.com>
Co-Authored-By: Mike Fedosin <mfedosin@mirantis.com>
Co-Authored-By: Alexander Tivelkov <ativelkov@mirantis.com>
Change-Id: Ib6a0d2482208a37aa343a747dfe5f63f9080dd04
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: Ifa8baab33cdb3e606cf175a8c29c3a4ef6c44480
Some changes have landed in Glance's tree during Kilo that require a
minor bump to the API. The following change is probably the one that had
the biggest impact on the current v2.2 API.
- Allow null fields to be returned: Ieaddd8a686cf7361f18cb1ee83b7887cdca22bd6
ApiImpact
DocImpact
Change-Id: I214ae6466ac85876cc9589069913258e80db29b5
The versions url returns the wrong data when glance api is behind
a proxy. This adds a new config option so it can be set properly.
DocImpact
Change-Id: I5ab53d608a6667435a4b03b0c832870716baaeb8
Closes-Bug: #1384379
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B)
provided by testtools.
Change-Id: Ia8d38f73c159c7ef943a8f6cfe72b945cc493947
Closes-bug: #1268480
Every call to json.loads/json.dumps have been changed to
jsonutils.loads/jsonutils.dumps respectively. Import json has been removed
also replaced by import glance.openstack.common.jsonutils
654d80b416dc5f413cb791aa838ec8688bf7da44 Create openstack.common.jsonutils
Change-Id: I8ef580e5eb91526dfaef37050ce1f5c6d88d56b5
Closes-bug: #1257922
Throughout the Havana development cycle, we have added several
features to the v2 api, without breaking backwards compatibility.
So this change bumps up our minor version number.
Change-Id: If0e5ffe117200fbfb967c8c95a63608f12dbba58
Patchset addresses reviewer's comments, rebase against master,
and follows new guidance from Foundation:
http://wiki.openstack.org/Documentation/Copyright
Change-Id: I94367461505778973528eb8835d991f4fb796dab
The v2.0 API is stable, so we need to communicate this fact to the
consumers of Glance. This updates the status of the v2.0 version
entity in responses from / and those that result in a 300 Multiple
Choices status code from 'EXPERIMENTAL' to 'CURRENT.'
Change-Id: I9e4514025904d7be2e947c6d14ccb90b6b066f8c
* Report v2.0 API compatibility, not v2
* Allow users to specify '/v2' or '/v2.0' in their request URI
Related to bp api-2
Change-Id: Ia8d41902a2171aad8f06d3ac329a3e3c097cdc90
The url matching code in the image cache middleware should only look at
the unconsumed path, not the full path. Webob denotes this by using
'path_info' instead of 'path.'
This also adds some tests for the version negotiation middleware to ensure
it is returning a sane path for the image cache middleware to match.
Fixes bug 1026222
Change-Id: I522e2210e2b7272f9bb47602510a2910fa193415
Implements blueprint cfg-global-object
This iteration fixes up the remaining places where we're passing a
conf object around.
Change-Id: I3b627d093a6b7afeee129ab66b377a3b0af5439b
Implements blueprint cfg-global-object
Begin adopting cfg's global CONF object pattern rather than passing
a conf object around everywhere.
This iterations does just enough to have each of the glance programs
initialize CONF and get the unit tests working.
Change-Id: Ia34959b3ba52cbe933d5d347f31319271b2e14f9