FileCatalogClientBase
FileCatalogClientBase is a base class for the clients of file catalog-like services built within the DIRAC framework.
The class contains variables defining lists of implemented catalog methods READ_METHODS WRITE_METHODS NO_LFN_METHODS ADMIN_METHODS
Those lists must be complemented in the derived classes to include specific implemented methods.
- class DIRAC.Resources.Catalog.FileCatalogClientBase.FileCatalogClientBase(url=None, **kwargs)
Bases:
Client
Client code to the DIRAC File Catalogue
- ADMIN_METHODS = []
- NO_LFN_METHODS = []
- READ_METHODS = ['hasAccess', 'exists', 'getPathPermissions']
- WRITE_METHODS = []
- __init__(url=None, **kwargs)
Constructor function.
- property call
To be removed once we’re sure self.call has been removed
- Type
Deprecated
- 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)
Default method: returns False for all paths
- Parameters
paths (lfn) – has to be formatted this way : { lfn : { se1 : pfn1, se2 : pfn2, …}, …}
- Returns
{ successful : { lfn : [ ses ] } : failed : { lfn : { se : msg } } }
- getClientKWArgs()
Returns a copy of the connection arguments
- 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 } } }
- 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
- isOK(timeout=120)
Check that the service is OK
- setServer(url)
Set the server URL used by default
- Parameters
url – url of the service