glance_store(1)

GLANCE_STORE(1) glance_store GLANCE_STORE(1)

NAME

glance_store - glance_store 4.3.1

The glance_store library supports the creation, deletion and gather of data assets from/to a set of several, different, storage technologies.

WARNING:

This library has been extracted from the Glance source code for the specific use of the Glance and Glare projects.

The API it exposes is not stable, has some shortcomings, and is not a general purpose interface. We would eventually like to change this, but for now using this library outside of Glance or Glare will not be supported by the core team.



GLANCE-STORE USER DOCUMENTATION

Glance Store Drivers

Glance store supports several different drivers. These drivers live within the library's code base and they are maintained by either members of the Glance community or OpenStack in general. Please, find below the table of supported drivers and maintainers:

Driver Status Maintainer Email IRC Nick
File System Supported Glance Team openstack-discuss@lists.openstack.org openstack-glance
HTTP Supported Glance Team openstack-discuss@lists.openstack.org openstack-glance
RBD Supported Fei Long Wang flwang@catalyst.net.nz flwang
Cinder Supported Tomoki Sekiyama tomoki.sekiyama@gmail.com
Swift Supported Matthew Oliver matt@oliver.net.au mattoliverau
VMware Supported Sabari Murugesan smurugesan@vmware.com sabari
S3 Supported Naohiro Sameshima naohiro.sameshima@global.ntt nao-shark

GLANCE-STORE REFERENCE GUIDE

glance_store

glance_store package

Subpackages

glance_store.common package

Submodules

glance_store.common.attachment_state_manager module

class glance_store.common.attachment_state_manager.AttachmentStateManagerMeta
Bases: type

glance_store.common.attachment_state_manager.attach(client, volume_id, host, mode=None)
A convenience wrapper around _AttachmentState.attach()

glance_store.common.attachment_state_manager.detach(client, attachment_id, volume_id, host, conn, connection_info, device)
A convenience wrapper around _AttachmentState.detach()

glance_store.common.cinder_utils module

glance_store.common.fs_mount module

glance_store.common.utils module

System-level utilities and helper functions.

class glance_store.common.utils.CooperativeReader(fd)
Bases: object

An eventlet thread friendly class for reading in image data.

When accessing data either through the iterator or the read method we perform a sleep to allow a co-operative yield. When there is more than one image being uploaded/downloaded this prevents eventlet thread starvation, ie allows all threads to be scheduled periodically rather than having the same thread be continuously active.

read(length=None)
Return the next chunk of the underlying iterator.

This is replaced with cooperative_read in __init__ if the underlying fd already supports read().



glance_store.common.utils.chunkiter(fp, chunk_size=65536)
Return an iterator to a file-like obj which yields fixed size chunks
Parameters
  • fp -- a file-like object
  • chunk_size -- maximum size of chunk



glance_store.common.utils.chunkreadable(iter, chunk_size=65536)
Wrap a readable iterator with a reader yielding chunks of a preferred size, otherwise leave iterator unchanged.
Parameters
  • iter -- an iter which may also be readable
  • chunk_size -- maximum size of chunk



glance_store.common.utils.cooperative_iter(iter)
Return an iterator which schedules after each iteration. This can prevent eventlet thread starvation.
Parameters
iter -- an iterator to wrap


glance_store.common.utils.cooperative_read(fd)
Wrap a file descriptor's read with a partial function which schedules after each read. This can prevent eventlet thread starvation.
Parameters
fd -- a file descriptor to wrap


glance_store.common.utils.get_hasher(hash_algo, usedforsecurity=True)
Returns the required hasher, given the hashing algorithm. This is primarily to ensure that the hash algorithm is correctly chosen when executed on a FIPS enabled system
Parameters
  • hash_algo -- hash algorithm requested
  • usedforsecurity -- whether the hashes are used in a security context



glance_store.common.utils.is_uuid_like(val)
Returns validation of a value as a UUID.

For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa


Module contents

Submodules

glance_store.backend module

class glance_store.backend.Indexable(wrapped, size)
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.

another()
Implemented by subclasses to return the next element.

getvalue()
Return entire string value... used in testing


glance_store.backend.add_to_backend(conf, image_id, data, size, scheme=None, context=None, verifier=None)

glance_store.backend.add_to_backend_with_multihash(conf, image_id, data, size, hashing_algo, scheme=None, context=None, verifier=None)

glance_store.backend.check_location_metadata(val, key='')

glance_store.backend.create_stores(conf=<oslo_config.cfg.ConfigOpts object>)
Registers all store modules and all schemes from the given config. Duplicates are not re-registered.

glance_store.backend.delete_from_backend(uri, context=None)
Removes chunks of data from backend specified by uri.

glance_store.backend.get_from_backend(uri, offset=0, chunk_size=None, context=None)
Yields chunks of data from backend specified by uri.

glance_store.backend.get_known_schemes()
Returns list of known schemes.

glance_store.backend.get_size_from_backend(uri, context=None)
Retrieves image size from backend specified by uri.

glance_store.backend.get_store_from_location(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


glance_store.backend.get_store_from_scheme(scheme)
Given a scheme, return the appropriate store object for handling that scheme.

glance_store.backend.get_store_from_uri(uri)
Given a URI, return the store object that would handle operations on the URI.
Parameters
uri -- URI to analyze


glance_store.backend.register_opts(conf)

glance_store.backend.set_acls(location_uri, public=False, read_tenants=[], write_tenants=None, context=None)

glance_store.backend.store_add_to_backend(image_id, data, size, store, context=None, verifier=None)
A wrapper around a call to each stores add() method. This gives glance a common place to check the output
Parameters
  • image_id -- The image add to which data is added
  • data -- The data to be stored
  • size -- The length of the data in bytes
  • store -- The store to which the data is being added
  • context -- The request context
  • verifier -- An object used to verify signatures for images

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.backend.store_add_to_backend_with_multihash(image_id, data, size, hashing_algo, store, context=None, verifier=None)
A wrapper around a call to each store's add() method that requires a hashing_algo identifier and returns a 5-tuple including the "multihash" computed using the specified hashing_algo. (This is an enhanced version of store_add_to_backend(), which is left as-is for backward compatibility.)
Parameters
  • image_id -- The image add to which data is added
  • data -- The data to be stored
  • size -- The length of the data in bytes
  • store -- The store to which the data is being added
  • hashing_algo -- A hashlib algorithm identifier (string)
  • context -- The request context
  • verifier -- An object used to verify signatures for images

Returns
The url location of the file, the size amount of data, the checksum of the data, the multihash of the data, the storage system's metadata dictionary for the location
Raises
glance_store.exceptions.BackendException glance_store.exceptions.UnknownHashingAlgo


glance_store.backend.verify_default_store()

glance_store.capabilities module

Glance Store capability

class glance_store.capabilities.BitMasks(value)
Bases: enum.IntEnum

An enumeration.

ALL = 255

DRIVER_REUSABLE = 64

NONE = 0

READ_ACCESS = 1

READ_CHUNK = 5

READ_OFFSET = 3

READ_RANDOM = 7

RW_ACCESS = 9

RW_CHUNK = 45

RW_OFFSET = 27

RW_RANDOM = 63

WRITE_ACCESS = 8

WRITE_CHUNK = 40

WRITE_OFFSET = 24

WRITE_RANDOM = 56


class glance_store.capabilities.StoreCapability
Bases: object
property capabilities

static contains(x, y)

is_capable(*capabilities)
Check if requested capability(s) are supported by current driver instance.
Parameters
capabilities -- required capability(s).


set_capabilities(*dynamic_capabilites)
Set dynamic storage capabilities based on current driver configuration and backend status.
Parameters
dynamic_capabilites -- dynamic storage capability(s).


unset_capabilities(*dynamic_capabilites)
Unset dynamic storage capabilities.
Parameters
dynamic_capabilites -- dynamic storage capability(s).


update_capabilities()
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.



glance_store.capabilities.check(store_op_fun)

glance_store.driver module

Base class for all storage backends

class glance_store.driver.Store(conf, backend=None)
Bases: glance_store.capabilities.StoreCapability
MULTI_BACKEND_OPTIONS = [<oslo_config.cfg.StrOpt object>]

OPTIONS = None

READ_CHUNKSIZE = 4194304

WRITE_CHUNKSIZE = 4194304

add(*args, **kwargs)

configure(re_raise_bsc=False)
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.


configure_add()
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.


delete(*args, **kwargs)

get(*args, **kwargs)

get_schemes()
Returns a tuple of schemes which this store can handle.

get_size(location, context=None)
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


get_store_location_class()
Returns the store location class that is used by this store.

set_acls(location, public=False, read_tenants=None, write_tenants=None, context=None)
Sets the read and write access control list for an image in the backend store.
Parameters
  • location -- glance_store.location.Location object, supplied from glance_store.location.get_location_from_uri()
  • public -- A boolean indicating whether the image should be public.
  • read_tenants -- A list of tenant strings which should be granted read access for an image.
  • write_tenants -- A list of tenant strings which should be granted write access for an image.



property url_prefix


glance_store.driver.back_compat_add(store_add_fun)
Provides backward compatibility for the 0.26.0+ Store.add() function. In 0.26.0, the 'hashing_algo' parameter is introduced and Store.add() returns a 5-tuple containing a computed 'multihash' value.

This wrapper behaves as follows:

If no hashing_algo identifier is supplied as an argument, the response is the pre-0.26.0 4-tuple of:

(backend_url, bytes_written, checksum, metadata_dict)


If a hashing_algo is supplied, the response is a 5-tuple:

(backend_url, bytes_written, checksum, multihash, metadata_dict)


The wrapper detects the presence of a 'hashing_algo' argument both by examining named arguments and positionally.


glance_store.exceptions module

Glance Store exception subclasses

exception glance_store.exceptions.AuthBadRequest(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Connect error/bad request to Auth service at URL %(url)s.'


exception glance_store.exceptions.AuthUrlNotFound(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Auth service at URL %(url)s not found.'


exception glance_store.exceptions.AuthorizationFailure(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Authorization failed.'


exception glance_store.exceptions.AuthorizationRedirect(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Redirecting to %(uri)s for authorization.'


exception glance_store.exceptions.BackendException
Bases: Exception

exception glance_store.exceptions.BadAuthStrategy(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Incorrect auth strategy, expected %(expected)s but received %(received)s '


exception glance_store.exceptions.BadStoreConfiguration(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Store %(store_name)s could not be configured correctly. Reason: %(reason)s'


exception glance_store.exceptions.BadStoreUri(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'The Store URI was malformed: %(uri)s'


exception glance_store.exceptions.DriverLoadFailure(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Driver %(driver_name)s could not be loaded.'


exception glance_store.exceptions.Duplicate(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Image %(image)s already exists'


exception glance_store.exceptions.Forbidden(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'You are not authorized to complete this action.'


exception glance_store.exceptions.GlanceStoreException(message=None, **kwargs)
Bases: 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.

message = 'An unknown exception occurred'


exception glance_store.exceptions.HasSnapshot(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'The image cannot be deleted because it has snapshot(s).'


exception glance_store.exceptions.HostNotInitialized(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = The glance cinder store host %(host)s which will used to perform nfs mount/umount operations isn't initialized.


exception glance_store.exceptions.InUseByStore(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'The image cannot be deleted because it is in use through the backend store outside of Glance.'


exception glance_store.exceptions.Invalid(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Data supplied was not valid.'


exception glance_store.exceptions.MaxRedirectsExceeded(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Maximum redirects (%(redirects)s) was exceeded.'


exception glance_store.exceptions.MissingCredentialError(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Missing required credential: %(required)s'


exception glance_store.exceptions.NoServiceEndpoint(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Response from Keystone does not contain a Glance endpoint.'


exception glance_store.exceptions.NotAuthenticated(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'You are not authenticated.'


exception glance_store.exceptions.NotFound(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Image %(image)s not found'


exception glance_store.exceptions.RedirectException(url)
Bases: Exception

exception glance_store.exceptions.RegionAmbiguity(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = Multiple 'image' service matches for region %(region)s. This generally means that a region is required and you have not supplied one.


exception glance_store.exceptions.RemoteServiceUnavailable(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Remote server where the image is present is unavailable.'


exception glance_store.exceptions.StorageFull(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'There is not enough disk space on the image storage media.'


exception glance_store.exceptions.StorageWriteDenied(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Permission to write image storage media denied.'


exception glance_store.exceptions.StoreAddDisabled(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Configuration for store failed. Adding images to this store is disabled.'


exception glance_store.exceptions.StoreDeleteNotSupported(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Deleting images from this store is not supported.'


exception glance_store.exceptions.StoreGetNotSupported(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Getting images from this store is not supported.'


exception glance_store.exceptions.StoreRandomGetNotSupported(message=None, **kwargs)
Bases: glance_store.exceptions.StoreGetNotSupported
message = 'Getting images randomly from this store is not supported. Offset: %(offset)s, length: %(chunk_size)s'


exception glance_store.exceptions.UnknownHashingAlgo(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = 'Unknown hashing algorithm identifier: %(algo)s'


exception glance_store.exceptions.UnknownScheme(message=None, **kwargs)
Bases: glance_store.exceptions.GlanceStoreException
message = Unknown scheme '%(scheme)s' found in URI


exception glance_store.exceptions.UnsupportedBackend
Bases: glance_store.exceptions.BackendException

glance_store.i18n module

glance_store.location module

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.

class glance_store.location.Location(store_name, store_location_class, conf, uri=None, image_id=None, store_specs=None, backend=None)
Bases: object

Class describing the location of an image that Glance knows about

get_store_uri()
Returns the Glance image URI, which is the host:port of the API server along with /images/<IMAGE_ID>

get_uri()


class glance_store.location.StoreLocation(store_specs, conf, backend_group=None)
Bases: object

Base class that must be implemented by each store

get_uri()
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.

parse_uri(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

process_specs()
Subclasses should implement any processing of the self.specs collection such as storing credentials and possibly establishing connections.

static validate_schemas(uri, valid_schemas)
check if uri scheme is one of valid_schemas generate exception otherwise


glance_store.location.get_location_from_uri(uri, conf=<oslo_config.cfg.ConfigOpts object>)
Given a URI, return a Location object that has had an appropriate store parse the URI.
Parameters
  • uri -- A URI that could come from the end-user in the Location attribute/header.
  • conf -- The global configuration.


Example URIs:
https://user:pass@example.com:80/images/some-id http://example.com/123456 swift://example.com/container/obj-id swift://user:account:pass@authurl.com/container/obj-id swift+http://user:account:pass@authurl.com/container/obj-id file:///var/lib/glance/images/1 cinder://volume-id s3://accesskey:secretkey@s3.amazonaws.com/bucket/key-id s3+https://accesskey:secretkey@s3.amazonaws.com/bucket/key-id


glance_store.location.get_location_from_uri_and_backend(uri, backend, conf=<oslo_config.cfg.ConfigOpts object>)
Extract backend location from a URI.

Given a URI, return a Location object that has had an appropriate store parse the URI.

Parameters
  • uri -- A URI that could come from the end-user in the Location attribute/header.
  • backend -- A backend name for the store.
  • conf -- The global configuration.


Example URIs:
https://user:pass@example.com:80/images/some-id http://example.com/123456 swift://example.com/container/obj-id swift://user:account:pass@authurl.com/container/obj-id swift+http://user:account:pass@authurl.com/container/obj-id file:///var/lib/glance/images/1 cinder://volume-id s3://accesskey:secretkey@s3.amazonaws.com/bucket/key-id s3+https://accesskey:secretkey@s3.amazonaws.com/bucket/key-id


glance_store.location.register_scheme_backend_map(scheme_map)
Registers a mapping between a scheme and a backend.

Given a mapping of 'scheme' to store_name, adds the mapping to the known list of schemes.

This function overrides existing stores.


glance_store.location.register_scheme_map(scheme_map)
Given a mapping of 'scheme' to store_name, adds the mapping to the known list of schemes.

This function overrides existing stores.


glance_store.multi_backend module

glance_store.multi_backend.add(conf, image_id, data, size, backend, context=None, verifier=None)

glance_store.multi_backend.add_with_multihash(conf, image_id, data, size, backend, hashing_algo, scheme=None, context=None, verifier=None)

glance_store.multi_backend.check_location_metadata(val, key='')

glance_store.multi_backend.create_multi_stores(conf=<oslo_config.cfg.ConfigOpts object>, reserved_stores=None)
Registers all store modules and all schemes from the given configuration object.
Parameters
  • conf -- A oslo_config (or compatible) object
  • reserved_stores -- A list of stores for the consuming service's internal use. The list must be the same format as the enabled_backends configuration setting. The default value is None

Returns
The number of stores configured
Raises
glance_store.exceptions.BackendException

Configuring Multiple Backends

The backends to be configured are expected to be found in the enabled_backends configuration variable in the DEFAULT group of the object. The format for the variable is a dictionary of key:value pairs where the key is an arbitrary store identifier and the value is the store type identifier for the store.

The type identifiers must be defined in the [entry points] section of the glance_store setup.cfg file as values for the glance_store.drivers configuration. (See the default setup.cfg file for an example.) The store type identifiers for the currently supported drivers are already defined in the file.

Thus an example value for enabled_backends is:

{'store_one': 'http', 'store_two': 'file', 'store_three': 'rbd'}


The reserved_stores parameter, if included, must have the same format. There is no difference between the enabled_backends and reserved_stores from the glance_store point of view: the reserved stores are a convenience for the consuming service, which may wish to handle the two sets of stores differently.

The Default Store

If you wish to set a default store, its store identifier should be defined as the value of the default_backend configuration option in the glance_store group of the conf parameter. The store identifier, or course, should be specified as one of the keys in the enabled_backends dict. It is recommended that a default store be set.

Configuring Individual Backends

To configure each store mentioned in the enabled_backends configuration option, you must define an option group with the same name as the store identifier. The options defined for that backend will depend upon the store type; consult the documentation for the appropriate backend driver to determine what these are.

For example, given the enabled_backends example above, you would put the following in the configuration file that loads the conf object:

[DEFAULT]
enabled_backends = store_one:rbd,store_two:file,store_three:http
[store_one]
store_description = "A human-readable string aimed at end users"
rbd_store_chunk_size = 8
rbd_store_pool = images
rbd_store_user = admin
rbd_store_ceph_conf = /etc/ceph/ceph.conf
[store_two]
store_description = "Human-readable description of this store"
filesystem_store_datadir = /opt/stack/data/glance/store_two
[store_three]
store_description = "A read-only store"
https_ca_certificates_file = /opt/stack/certs/gs.cert
[glance_store]
default_backend = store_two


The store_description options may be used by a consuming service. As recommended above, this file also defines a default backend.


glance_store.multi_backend.delete(uri, backend, context=None)
Removes chunks of data from backend specified by uri.

glance_store.multi_backend.get(uri, backend, offset=0, chunk_size=None, context=None)
Yields chunks of data from backend specified by uri.

glance_store.multi_backend.get_known_schemes_for_multi_store()
Returns list of known schemes.

glance_store.multi_backend.get_size_from_uri_and_backend(uri, backend, context=None)
Retrieves image size from backend specified by uri.

glance_store.multi_backend.get_store_from_store_identifier(store_identifier)
Determine backing store from identifier.

Given a store identifier, return the appropriate store object for handling that scheme.


glance_store.multi_backend.register_store_opts(conf, reserved_stores=None)

glance_store.multi_backend.set_acls_for_multi_store(location_uri, backend, public=False, read_tenants=[], write_tenants=None, context=None)

glance_store.multi_backend.store_add_to_backend(image_id, data, size, store, context=None, verifier=None)
A wrapper around a call to each stores add() method.

This gives glance a common place to check the output.

Parameters
  • image_id -- The image add to which data is added
  • data -- The data to be stored
  • size -- The length of the data in bytes
  • store -- The store to which the data is being added
  • context -- The request context
  • verifier -- An object used to verify signatures for images
  • backend -- Name of the backend to store the image

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.multi_backend.store_add_to_backend_with_multihash(image_id, data, size, hashing_algo, store, context=None, verifier=None)
A wrapper around a call to each store's add() method that requires a hashing_algo identifier and returns a 5-tuple including the "multihash" computed using the specified hashing_algo. (This is an enhanced version of store_add_to_backend(), which is left as-is for backward compatibility.)
Parameters
  • image_id -- The image add to which data is added
  • data -- The data to be stored
  • size -- The length of the data in bytes
  • store -- The store to which the data is being added
  • hashing_algo -- A hashlib algorithm identifier (string)
  • context -- The request context
  • verifier -- An object used to verify signatures for images

Returns
The url location of the file, the size amount of data, the checksum of the data, the multihash of the data, the storage system's metadata dictionary for the location
Raises
glance_store.exceptions.BackendException glance_store.exceptions.UnknownHashingAlgo


glance_store.multi_backend.verify_store()

Module contents

Indices and tables

  • genindex
  • modindex
  • search

AUTHOR

unknown

COPYRIGHT

2023, OpenStack Foundation

December 10, 2023 4.3.1