RucioFileCatalogClient¶
The RucioFileCatalogClient is a class that allows to interface Dirac with Rucio
- class DIRAC.Resources.Catalog.RucioFileCatalogClient.RucioFileCatalogClient(**options)¶
Bases:
FileCatalogClientBase
- ADMIN_METHODS = ['getUserDirectory', 'createUserDirectory', 'createUserMapping', 'removeUserDirectory']¶
- NO_LFN_METHODS = ['getUserDirectory', 'createUserDirectory', 'createUserMapping', 'removeUserDirectory']¶
- READ_METHODS = ['hasAccess', 'exists', 'getPathPermissions', 'isLink', 'readLink', 'isFile', 'getFileMetadata', 'getReplicas', 'getReplicaStatus', 'getFileSize', 'isDirectory', 'getDirectoryReplicas', 'listDirectory', 'getDirectoryMetadata', 'getDirectorySize', 'getDirectoryContents', 'resolveDataset', 'getLFNForPFN', 'getUserDirectory']¶
- WRITE_METHODS = ['createLink', 'removeLink', 'addFile', 'addReplica', 'removeReplica', 'removeFile', 'setReplicaStatus', 'setReplicaHost', 'createDirectory', 'removeDirectory', 'removeDataset', 'removeFileFromDataset', 'createDataset', 'changePathOwner', 'changePathMode']¶
- __init__(**options)¶
Constructor
- addFile(lfns)¶
Register supplied files
- addReplica(lfns)¶
This adds a replica to the catalogue.
- property call¶
To be removed once we’re sure self.call has been removed
- Type
Deprecated
- property client¶
Check if the session to the server is still active and return an instance of RucioClient
- executeRPC(*parms, **kws)¶
This method extracts some parameters from kwargs that are used as parameter of the constructor or RPCClient. Unfortunately, only a few of all the available parameters of BaseClient are exposed.
- Parameters
rpc – if an RPC client is passed, use that one
timeout – we can change the timeout on a per call bases. Default is self.timeout
url – We can specify which url to use
- exists(lfns)¶
Check if the path exists
- getClientKWArgs()¶
Returns a copy of the connection arguments
- getCompatibleMetadata(queryDict, path, credDict)¶
Get distinct metadata values compatible with the given already defined metadata
- getDirectorySize(lfns, longOutput=False, rawFiles=False)¶
Get the directory size
- getFileMetadata(lfns, ownership=False)¶
Returns the file metadata associated to a supplied LFN
- getFileSize(lfns)¶
Get the size of a supplied file
- classmethod getInterfaceMethods()¶
Get the methods implemented by the File Catalog client
- Return tuple
( read_methods_list, write_methods_list, nolfn_methods_list )
- getPathPermissions(lfns)¶
Default method: returns Read & Write permission for all the paths
- Parameters
paths (lfn) – has to be formatted this way : { lfn : { se1 : pfn1, se2 : pfn2, …}, …}
- Returns
{ successful : { lfn : [ ses ] } : failed : { lfn : { se : msg } } }
- getReplicas(lfns, allStatus=False)¶
Returns replicas for an LFN or list of LFNs
- getServer()¶
Getter for the server url. Useful ?
- hasAccess(paths, _opType)¶
Default method: returns True for all paths and all actions
- Parameters
paths (lfn) – has to be formatted this way : { lfn : { se1 : pfn1, se2 : pfn2, …}, …}
_opType (str) – dummy string
- Returns
{ successful : { lfn : [ ses ] } : failed : { lfn : { se : msg } } }
- classmethod hasCatalogMethod(methodName)¶
Check of a method with the given name is implemented
- Parameters
methodName (str) – the name of the method to check
- Returns
boolean Flag True if the method is implemented
- httpsClient¶
alias of
TornadoClient
- isDirectory(lfns)¶
Determine whether the path is a directory
- isFile(lfns)¶
Determine whether the path is a file
- isOK(timeout=120)¶
Check that the service is OK
- listDirectory(lfns, verbose=False)¶
Returns the result of __getDirectoryContents for multiple supplied paths
- removeDirectory(lfns)¶
Remove the supplied directory
- removeFile(lfns)¶
Remove the supplied path
- removeReplica(lfns)¶
Remove the supplied replicas
- setServer(url)¶
Set the server URL used by default
- Parameters
url – url of the service
- DIRAC.Resources.Catalog.RucioFileCatalogClient.get_scope(lfn, scopes=None)¶
Helper function that extract the scope from the LFN