Bases: object
Indexable for file-like objs iterators
Wrapper that allows an iterator or filelike be treated as an indexable data structure. This is required in the case where the return value from Store.get() is passed to Store.add() when adding a Copy-From image to a Store where the client library relies on eventlet GreenSockets, in which case the data to be written is indexed over.
Implemented by subclasses to return the next element.
Return entire string value... used in testing
Registers all store modules and all schemes from the given config. Duplicates are not re-registered.
Removes chunks of data from backend specified by uri.
Yields chunks of data from backend specified by uri.
Returns list of known schemes.
Retrieves image size from backend specified by uri.
Given a location (assumed to be a URL), attempt to determine the store from the location. We use here a simple guess that the scheme of the parsed URL is the store...
Parameters: | uri – Location to check for the store |
---|
Given a scheme, return the appropriate store object for handling that scheme.
Given a URI, return the store object that would handle operations on the URI.
Parameters: | uri – URI to analyze |
---|
A wrapper around a call to each stores add() method. This gives glance a common place to check the output
Parameters: |
|
---|---|
Returns: | The url location of the file, the size amount of data, the checksum of the data the storage systems metadata dictionary for the location |
Glance Store capability
Bases: enum.IntEnum
Bases: object
Check if requested capability(s) are supported by current driver instance.
Parameters: | capabilities – required capability(s). |
---|
Set dynamic storage capabilities based on current driver configuration and backend status.
Parameters: | dynamic_capabilites – dynamic storage capability(s). |
---|
Unset dynamic storage capabilities.
Parameters: | dynamic_capabilites – dynamic storage capability(s). |
---|
Update dynamic storage capabilities based on current driver configuration and backend status when needed.
As a hook, the function will be triggered in two cases: calling once after store driver get configured, it was used to update dynamic storage capabilities based on current driver configuration, or calling when the capabilities checking of an operation failed every time, this was used to refresh dynamic storage capabilities based on backend status then.
This function shouldn’t raise any exception out.
Base class for all storage backends
Bases: glance_store.capabilities.StoreCapability
Configure the store to use the stored configuration options and initialize capabilities based on current configuration.
Any store that needs special configuration should implement this method.
This is like configure except that it’s specifically for configuring the store to accept objects.
If the store was not able to successfully configure itself, it should raise exceptions.BadStoreConfiguration.
Returns a tuple of schemes which this store can handle.
Takes a glance_store.location.Location object that indicates where to find the image file, and returns the size
Parameters: | location – glance_store.location.Location object, supplied from glance_store.location.get_location_from_uri() |
---|---|
Raises: | glance_store.exceptions.NotFound if image does not exist |
Returns the store location class that is used by this store.
Sets the read and write access control list for an image in the backend store.
Parameters: |
|
---|
Glance Store exception subclasses
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: exceptions.Exception
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: exceptions.Exception
Base Glance Store Exception
To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: exceptions.Exception
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.GlanceStoreException
Bases: glance_store.exceptions.StoreGetNotSupported
Bases: glance_store.exceptions.GlanceStoreException
A class that describes the location of an image in Glance.
In Glance, an image can either be stored in Glance, or it can be registered in Glance but actually be stored somewhere else.
We needed a class that could support the various ways that Glance describes where exactly an image is stored.
An image in Glance has two location properties: the image URI and the image storage URI.
The image URI is essentially the permalink identifier for the image. It is displayed in the output of various Glance API calls and, while read-only, is entirely user-facing. It shall not contain any security credential information at all. The Glance image URI shall be the host:port of that Glance API server along with /images/<IMAGE_ID>.
The Glance storage URI is an internal URI structure that Glance uses to maintain critical information about how to access the images that it stores in its storage backends. It may contain security credentials and is not user-facing.
Bases: object
Class describing the location of an image that Glance knows about
Returns the Glance image URI, which is the host:port of the API server along with /images/<IMAGE_ID>
Bases: object
Base class that must be implemented by each store
Subclasses should implement a method that returns an internal URI that, when supplied to the StoreLocation instance, can be interpreted by the StoreLocation’s parse_uri() method. The URI returned from this method shall never be public and only used internally within Glance, so it is fine to encode credentials in this URI.
Subclasses should implement a method that accepts a string URI and sets appropriate internal fields such that a call to get_uri() will return a proper internal URI
Subclasses should implement any processing of the self.specs collection such as storing credentials and possibly establishing connections.
Given a URI, return a Location object that has had an appropriate store parse the URI.
Parameters: |
|
---|
Given a mapping of ‘scheme’ to store_name, adds the mapping to the known list of schemes.
This function overrides existing stores.