LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
30 yaml_tag =
u"!AccessCfg"
33 super().
__init__({
'storageCfg': storageCfg,
'cls': cls})
37 """Implements an butler framework interface for Transport, Storage, and Registry
41 Access is 'wet paint' and very likely to change. Use of it in production
42 code other than via the 'old butler' API is strongly discouraged.
47 def cfg(cls, storageCfg):
48 """Helper func to create a properly formatted Policy to configure an Access instance.
50 :param storageCfg: a cfg to instantiate a storage.
53 return AccessCfg(cls=cls, storageCfg=storageCfg)
58 :param cfg: a Policy that defines the configuration for this class. It is recommended that the cfg be
59 created by calling Access.cfg()
62 self.
storage = cfg[
'storageCfg.cls'](cfg[
'storageCfg'])
65 return 'Access(storage=%s)' % self.
storage
68 """Get the mapper class associated with a repository root.
70 :return: the mapper class
75 """Get the repository root as defined by the Storage class, this refers to the 'top' of a persisted
76 repository. The exact type of Root can vary based on Storage type.
78 :return: the root of the persisted repository.
84 """Given a location, get a fully qualified handle to location including storage root.
86 Note; at the time of this writing the only existing storage type is PosixStorage. This returns the
94 """Writes the repository configuration to Storage.
96 :param repoCfg: the Policy cfg to be written
102 """Reads the repository configuration from Storage.
104 :return: the Policy cfg
108 def write(self, butlerLocation, obj):
109 """Passes an object to Storage to be written into the repository.
111 :param butlerLocation: the location & formatting for the object to be written.
112 :param obj: the object to be written.
117 def read(self, butlerLocation):
118 """Reads an object from storage
120 :param butlerLocation: describes the location & how to load the object.
123 return self.
storage.
read(butlerLocation=butlerLocation)
126 """Query if a location exists.
128 As of this writing the only storage type is PosixStorage, and it works to say that 'location' is a
129 simple locaiton descriptor. In the case of PosixStorage that's a path. If this needs to become more
130 complex it could be changed to be a butlerLocation, or something else, as needed.
131 :param location: a simple location descriptor, type is dependent on Storage.
132 :return: True if location exists, else False.
137 """Perform a lookup in the registry.
139 Returns a list of dataId for each valid lookup (right? TODO VERIFY)"""
def setCfg(self, repoCfg)
def read(self, butlerLocation)
def exists(self, location)
def __init__(self, cls, storageCfg)
def locationWithRoot(self, location)
def lookup(self, *args, **kwargs)
def write(self, butlerLocation, obj)