sams.storage.destinations – Storage Destinations¶
-
class
Destination(config_str: str)¶ A Destination instance
- Variables
-
provider_instance() → sams.storage.providers.base.SamsBaseStorageProvider¶ Retrieve the Storage instance for this destination
- Returns
An Storage Provider instance
- Return type
-
class
Destinations¶ A mechanism to register storage destinations with the system
This is used when bootstrapping the application to register storage destinations from strings in the config.
Usage:
from sams.storage.destinations import destinations destinations.register(...) destinations.get(...) destinations.exists(...) destinations.all(...) destinations.clear(...)
-
register(config_string: str)¶ Register a storage destination with the system
- Parameters
config_string (str) – A string from any
STORAGE_DESTINATIONconfig attribute
-
get(name: str) → sams.storage.destinations.Destination¶ Retrieve a registered storage destination by it’s name
- Parameters
name (str) – The name of the storage destination
- Returns
Returns the Destination instance
- Return type
- Raises
sams_client.errors.SamsStorageDestinationErrors.NotFound – if the destination is not found
-
exists(name: str) → bool¶ Check if a storage destination with
nameexists- Parameters
name (str) – The name of the storage destination
- Returns
Trueif the destination exists,Falseif not
-
all() → Dict[str, sams.storage.destinations.Destination]¶ Returns all the registered storage destinations
-
clear()¶ Clears all of the registered storage destinations
-