Glance Metadata Definitions Catalog - Seed

Implements: blueprint metadata-schema-catalog

A common API hosted by the Glance service for vendors, admins,
services, and users to meaningfully define available key / value
pair and tag metadata. The intent is to enable better metadata
collaboration across artifacts, services, and projects for
OpenStack users.

This is about the definition of the available metadata that can
be used on different types of resources (images, artifacts,
volumes, flavors, aggregates, etc). A definition includes the
properties type, its key, it's description, and it's constraints.
This catalogue will not store the values for specific instance
properties.

Change-Id: Ib1c1abf80879fb6dcd5ee30c7d2bc65b0ba720d5
DocImpact
Co-Authored-By: Lakshmi N Sampath <lakshmi.sampath@hp.com>
Co-Authored-By: Wayne Okuma <wayne.okuma@hp.com>
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Jastrzebski <michal.jastrzebski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
Introduces eventlet executor for Glance Tasks

A sample import script to successfully import image from http or https
location is introduced. This should work on a devstack installtion.

Also, the following changes are introduced:-
1. An interface for implementing any other type of executor.
2. Provides namespace for keeping Tasks scripts.
3. A config for choosing deployer specific executor.
4. An interface for writing Tasks scripts.
5. A module for common script related methods.
6. Logic for limiting number of simultaneous tasks execution on the
Glance API server.

partially implements bp async-glance-workers
DocImpact

Change-Id: I382472fffd0fdad43573e72b2e78a9a6ed1e1f1a
warn against sorting requirements

Change-Id: I64ae9191863564e278a35d42ec9cd743a233028e
Closes-Bug: 1365061
Adds missing db registry api tests for Tasks

The db registry api supports calls to Glance tasks. This patch
adds test coverage to that part of the code.

Fixes bug 1364570

Change-Id: Id7a74239a54d9001c7ac4ab4c8e2b67ac0686125
Merge "Glance Metadata Definitions Catalog - Seed"
Merge "warn against sorting requirements"
Adopt glance.store library in Glance

This commits removes the old `store` package from glance and adopts the
usage of the new glance.store library. The library was designed to
preserve backwards compatibility as much as possible. In fact, most of
the changes in this patch are related to function args ordering and not
function renames or workflow changes.

Some changes that are worth mentioning:

1. Glance store doesn't rely on a global config object. All config
options must be explicitly registered.

2. All store operations now accepted an optional context. This is a
fallout from the context not being required in the `Store` constructor
anymore.

3. Store drivers are behind a private package called `_drivers` and
they're not suppose to be accessed directly. Instead, functions like
`get_store_from_scheme` should be used.

4. Stores are disabled by default

5. All the store specific options are under the `glance_store` group.

DocImpact:
The old store related configuration options have been moved under the
`glance_store` section. However, the old options will go through a
deprecation path. That is, they'll still be read from the `DEFAULT`
section to give deployers enough time to update their config files.

In k-2, the deprecated options will be completely obsolete.

Closes-bug: #1291848
Implements-blueprint: create-store-package

Change-Id: Iaacc70993ad5da292b93de42bbecda73d53b19fd
API support for random access to images

This patch adds support for random access to images to the API v2. It's
possible to partially access the image data by passing the offset where
the image should be fetched from and the size of the chunk expected.

Note that not all stores support random access to image data. In such
cases, the API will return an error mentioning the selected store
doesn't support such a feature.

DocImpact:
Content-Range header is now parsed to support random access to image
data.

Implements blueprint: restartable-image-download

Change-Id: Iade692a8197a9a1d9532711a5c572c505e5e7d20
Glance API V2 can't recognize parameter 'id'

Based on current implement, API V2 is using **id** in image schema,
but using **image_id** for most of the internal functions as key
word arguments. So user will got a key error if using:

glance --os-image-api-version 2 image-create --id <id>

This patch will map 'id' to 'image_id' in RequestDeserializer and
add an unit test case fo the change.

Closes-Bug: 1366515

Change-Id: I4c72881a7ada728307e806776426b42cf4cf0993
Merge "Adopt glance.store library in Glance"
Merge "API support for random access to images"
Duplicated image id return 409 instead of 500 in API v2

Based on current code, in API v2 duplicated image id will
return HTTP 500 error instead of 409. This patch fix this
issue and add an unit test case for that.

Closes-Bug: 1366503

Change-Id: Ia6c27f9edffd63619d63013e456072d811daf127
Imported Translations from Transifex

Change-Id: Ib7dc9c505b027eb97afb0fbd966515f926f96a0e
Fix VMware Namespace capitalization & description

The namespace had incorrect capitalization. Also,
added additional text in description to make people
aware that the properties only apply to the VMware
compute driver.

Change-Id: Ic1c3c333a1c70782a0780ace0323b2f6728bdd09
Closes-bug: 1367548
Fix CommonImageProperties missing ":"

The namespace had inconsistent naming when compared to
other namespaces.

OS::Glance:CommonImageProperties
 should be
OS::Glance::CommonImageProperties

Change-Id: Iea9860be66eb06250f8a53b8c44ab787e9c8082a
Closes-Bug: 1367545
Change open(file) to with block

Currently script which loads metadata definitions to database
uses open(file) to stream files. This isn't the best practice
because in case of any errors this code may not be safe.
To solve this problem this patch changes open(file) to
'with open(file) as...:' block. It allows us to ensure that every
resource is cleaned up when the code finishes running.

Change-Id: I4a85700061ed5050f4356f1b39ea128931626c83
Closes-Bug: #1367172
Sync glance docs with metadefs api changes

 - Rename resource_type to resource_type_
   associations in namespace API input/output
 - Add created_at/updated_at in resource_
   type_associations block of namespace API
   input/output.
 - Fix minor nits

Closes-bug: 1367908

Change-Id: Ie74bfb36a7023abb346852f5b863f19d0d7bc4ff
Improve OS::Compute::HostCapabilities description

The OS::Compute::HostCapabilities namespace should include more
information about how the properties are used by Nova.
Let admin's know that the ComputeCapabilitiesFilter needs to
be enabled.

Change-Id: Ib3232e560969462d3973606e138a96d1a5beb7de
Closes-bug: 1367860
Merge "Fix VMware Namespace capitalization & description"
Block sqlalchemy-migrate 0.9.2

Breaks unit tests.

Change-Id: I347a20fd35ae20f1de5db7f2608090b08af6c0ff
Closes-Bug: #1368391