wcraas_storage package¶
Submodules¶
wcraas_storage.cli module¶
Console script for wcraas_storage.
wcraas_storage.config module¶
-
class
wcraas_storage.config.
Config
[source]¶ Bases:
wcraas_storage.config.Config
-
classmethod
fromenv
()[source]¶ Create a wcraas_storage.Config from Environment Variables.
>>> conf = Config.fromenv() >>> type(conf) <class 'config.Config'> >>> conf._fields ('amqp', 'mongo', 'mapping', 'loglevel') >>> conf.amqp AMQPConfig(host='localhost', port=5672, user='guest', password='guest') >>> conf.mongo mongo = MongoConfig(host='localhost', port=27017, db='wcraas', user=None, password=None) >>> conf.mapping {} >>> conf.loglevel 20
-
classmethod
wcraas_storage.wcraas_storage module¶
The WCraaS Storage module is responsible for providing storage services for the platform.
-
class
wcraas_storage.wcraas_storage.
StorageWorker
(amqp: wcraas_common.config.AMQPConfig, mongo: wcraas_storage.config.MongoConfig, mapping: Dict[str, str], loglevel: int, *args, **kwargs)[source]¶ Bases:
wcraas_common.wcraas_common.WcraasWorker
-
get_queue_by_collection
(collection: str) → str[source]¶ Return the queue that corresponds to the given collection.
Parameters: collection (string) – The collection with which to determine the queue.
-
list_collections
() → Dict[str, List[Dict[str, str]]][source]¶ AMQP function that lists available collections in selected MongoDB.
-
run
() → None[source]¶ Helper function implementing the synchronous boilerplate for initilization and teardown.
-
Module contents¶
Top-level package for storage.