cinderlib.persistence package¶
Submodules¶
cinderlib.persistence.base module¶
-
class
cinderlib.persistence.base.
DB
(persistence_driver)[source]¶ Bases:
object
Replacement for DB access methods.
This will serve as replacement for methods used by:
- Drivers
- OVOs’ get_by_id and save methods
- DB implementation
Data will be retrieved using the persistence driver we setup.
-
class
cinderlib.persistence.base.
PersistenceDriverBase
(**kwargs)[source]¶ Bases:
object
Provide Metadata Persistency for our resources.
This class will be used to store new resources as they are created, updated, and removed, as well as provide a mechanism for users to retrieve volumes, snapshots, and connections.
-
db
¶
-
cinderlib.persistence.dbms module¶
-
class
cinderlib.persistence.dbms.
DBPersistence
(connection, sqlite_synchronous=True, soft_deletes=False)[source]¶ Bases:
cinderlib.persistence.base.PersistenceDriverBase
-
db
¶
-
cinderlib.persistence.memory module¶
Module contents¶
-
class
cinderlib.persistence.
MyDict
[source]¶ Bases:
dict
Custom non clearable dictionary.
Required to overcome the nature of oslo.config where configuration comes from files and command line input.
Using this dictionary we can load from memory everything and it won’t clear things when we dynamically load a driver and the driver has new configuration options.
-
cinderlib.persistence.
setup
(config)[source]¶ Setup persistence to be used in cinderlib.
By default memory persistance will be used, but there are other mechanisms available and other ways to use custom mechanisms:
- Persistence plugins: Plugin mechanism uses Python entrypoints under namespace cinderlib.persistence.storage, and cinderlib comes with 3 different mechanisms, “memory”, “dbms”, and “memory_dbms”. To use any of these one must pass the string name in the storage parameter and any other configuration as keyword arguments.
- Passing a class that inherits from PersistenceDriverBase as storage parameter and initialization parameters as keyword arguments.
- Passing an instance that inherits from PersistenceDriverBase as storage parameter.