Defines interface for DB access.
The underlying driver is loaded as a LazyPluggable.
Functions in this module are imported into the cinder.db namespace. Call these functions from cinder.db namespace, not the cinder.db.api namespace.
All functions in this module return objects that implement a dictionary-like interface. Currently, many of these objects are sqlalchemy objects that implement a dictionary interface. However, a future goal is to have all of these objects be simple dictionaries.
Related Flags
backend: | string to lookup in the list of LazyPluggable backends. sqlalchemy is the only supported backend right now. |
---|---|
connection: | string specifying the sqlalchemy connection to use, like: sqlite:///var/lib/cinder/cinder.sqlite. |
enable_new_services: | |
when adding a new service to the database, is it in the pool of available hardware (Default: True) |
Bases: cinder.exception.CinderException
No more available targets
Create a backup from the values dictionary.
Destroy the backup or raise if it does not exist.
Get a backup or raise if it does not exist.
Get all backups.
Get all backups belonging to a host.
Get all backups belonging to a project.
Set the given properties on a backup and update it.
Raises NotFound if backup does not exist.
Perform database updates upon completion of volume migration.
Return count of export devices.
Create an iscsi_target from the values dictionary.
The device is not returned. If the create violates the unique constraints because the iscsi_target and host already exist, no exception is raised.
Associate qos_specs from volume type.
Get all associated volume types for a given qos_specs.
Create a qos_specs.
Delete the qos_specs.
Disassociate qos_specs from volume type.
Disassociate qos_specs from all entities.
Get all specification for a given qos_specs.
Get all qos_specs.
Get all specification for a given qos_specs.
Delete specified key in the qos_specs.
Update qos specs.
This adds or modifies the key/value pairs specified in the specs dict argument for a given qos_specs.
Create a quota class for the given name and resource.
Destroy the quota class or raise if it does not exist.
Destroy all quotas associated with a given quota class.
Retrieve a quota class or raise if it does not exist.
Retrieve all quotas associated with a given quota class.
Retrieve all default quotas.
Update a quota class or raise if it does not exist.
Create a quota for the given project and resource.
Destroy the quota or raise if it does not exist.
Destroy all quotas associated with a given project.
Retrieve a quota or raise if it does not exist.
Retrieve all quotas associated with a given project.
Check quotas and create appropriate reservations.
Update a quota or raise if it does not exist.
Create a quota usage for the given project and resource.
Retrieve a quota usage or raise if it does not exist.
Retrieve all usage associated with a given resource.
Commit quota reservations.
Create a reservation for the given project and resource.
Destroy the reservation or raise if it does not exist.
Roll back any expired reservations.
Retrieve a reservation or raise if it does not exist.
Retrieve all reservations associated with a given project.
Roll back quota reservations.
Create a service from the values dictionary.
Destroy the service or raise if it does not exist.
Get a service or raise if it does not exist.
Get all services.
Get all services for a given host.
Get all services for a given topic.
Get all volume services sorted by volume count.
Returns: | a list of (Service, volume_count) tuples. |
---|
Get the state of an service by node name and binary.
Get a service by host it’s on and topic it listens to.
Set the given properties on an service and update it.
Raises NotFound if service does not exist.
Create a snapshot from the values dictionary.
Get count and gigabytes used for snapshots for specified project.
Destroy the snapshot or raise if it does not exist.
Get a snapshot or raise if it does not exist.
Get all the snapshots inside the window.
Specifying a project_id will filter for a certain project.
Get all snapshots.
Get all snapshots belonging to a project.
Get all snapshots for a volume.
Delete the given metadata item.
Get all metadata for a snapshot.
Update metadata if it exists, otherwise create it.
Set the given properties on an snapshot and update it.
Raises NotFound if snapshot does not exist.
Accept a volume transfer.
Create an entry in the transfers table.
Destroy a record in the volume transfer table.
Get a volume transfer record or raise if it does not exist.
Get all volume transfer records.
Get all volume transfer records for specified project.
Delete the given metadata item.
Get all administration metadata for a volume.
Update metadata if it exists, otherwise create it.
Atomically allocate a free iscsi_target from the pool.
Ensure that a volume is set as attached.
Create a volume from the values dictionary.
Get (volume_count, gigabytes) for project.
Get (volume_count, gigabytes) for project.
Destroy the volume or raise if it does not exist.
Ensure that a volume is set as detached.
Get a volume or raise if it does not exist.
Get all the volumes inside the window.
Specifying a project_id will filter for a certain project.
Get all volumes.
Get all volumes belonging to a host.
Get all volumes belonging to a instance.
Get all volumes belonging to a project.
Get the target num (tid) allocated to the volume.
Update the Glance metadata for a volume by copying all of the key:value pairs from the originating volume. This is so that a volume created from the volume (clone) will retain the original metadata.
Update the Glance metadata for a snapshot by copying all of the key:value pairs from the originating volume. This is so that a volume created from the snapshot will retain the original metadata.
Update the Glance metadata from a volume (created from a snapshot) by copying all of the key:value pairs from the originating snapshot. This is so that the Glance metadata from the original volume is retained.
Update the Glance metadata for the specified volume.
Delete the glance metadata for a snapshot.
Delete the glance metadata for a volume.
Return the glance metadata for a volume.
Delete the given metadata item.
Get all metadata for a volume.
Update metadata if it exists, otherwise create it.
Return the Glance metadata for the specified snapshot.
Create a new volume type.
Delete a volume type.
Delete the given extra specs item.
Get all extra specs for a volume type.
Create or update volume type extra specs. This adds or modifies the key/value pairs specified in the extra specs dict argument
Get volume type by id.
Get all volume types.
Get volume type by name.
Associate a volume type with specific qos specs.
Get volume types that are associated with specific qos specs.
Disassociate a volume type from specific qos specs.
Disassociate all volume types from specific qos specs.
Get all qos specs for given volume type.
Set the given properties on an volume and update it.
Raises NotFound if volume does not exist.