LcgFileCatalogClient

Class for the LCG File Catalog Client

class DIRAC.Resources.Catalog.LcgFileCatalogClient.LcgFileCatalogClient(**options)

Bases: DIRAC.Resources.Catalog.FileCatalogClientBase.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 function.

addFile(**kwargs)
addReplica(**kwargs)
changePathMode(**kwargs)
changePathOwner(**kwargs)
createDataset(**kwargs)
createDirectory(**kwargs)
createUserDirectory(usernames)

Creates the user directory

createUserMapping(userDNs)

Create a user with the supplied DN and return the userID

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 120 s
  • url – We can specify which url to use
exists(**kwargs)
getDirectoryMetadata(**kwargs)
getDirectoryReplicas(**kwargs)
getDirectorySize(**kwargs)
getFileMetadata(**kwargs)
getFileSize(**kwargs)
classmethod getInterfaceMethods()

Get the methods implemented by the File Catalog client

Return tuple:( read_methods_list, write_methods_list, nolfn_methods_list )
getLFNForGUID(**kwargs)
getLFNForPFN(**kwargs)
getName()
getPathPermissions(**kwargs)
getReplicaStatus(**kwargs)
getReplicas(**kwargs)
getServer()

Getter for the server url. Useful ?

getUserDirectory(usernames)

Takes a list of users and determines whether their directories already exist

hasAccess(**kwargs)
classmethod hasCatalogMethod(methodName)

Check of a method with the given name is implemented :param str methodName: the name of the method to check :return: boolean Flag True if the method is implemented

isDirectory(**kwargs)
isFile(**kwargs)
isOK()

Check that the service is OK

listDirectory(**kwargs)
removeDataset(**kwargs)
removeDirectory(**kwargs)
removeFile(**kwargs)
removeFileFromDataset(**kwargs)
removeReplica(**kwargs)
removeUserDirectory(username)

Remove the user directory and remove the user mapping

resolveDataset(**kwargs)
setAuthorizationId(dn)

Set authorization id for the proxy-less LFC communication

setReplicaHost(**kwargs)
setReplicaProblematic(**kwargs)
setReplicaStatus(**kwargs)
setServer(url)

Set the server URL used by default

Parameters:url – url of the service
setTimeout(timeout)

Specify the timeout of the call. Forwarded to RPCClient

Parameters:timeout – guess…
DIRAC.Resources.Catalog.LcgFileCatalogClient.addReplica(guid, pfn, se, master)
DIRAC.Resources.Catalog.LcgFileCatalogClient.addUserDN(userID, dn)
DIRAC.Resources.Catalog.LcgFileCatalogClient.closeDirectory(oDirectory)
DIRAC.Resources.Catalog.LcgFileCatalogClient.existsGuid(guid)

Check if the guid exists

DIRAC.Resources.Catalog.LcgFileCatalogClient.getClientCertInfo()
DIRAC.Resources.Catalog.LcgFileCatalogClient.getDNFromUID(userID)
DIRAC.Resources.Catalog.LcgFileCatalogClient.getDNUserID(dn)
DIRAC.Resources.Catalog.LcgFileCatalogClient.getRoleFromGID(groupID, path=None)
DIRAC.Resources.Catalog.LcgFileCatalogClient.modReplica(pfn, newse)
DIRAC.Resources.Catalog.LcgFileCatalogClient.removeReplica(pfn)
DIRAC.Resources.Catalog.LcgFileCatalogClient.returnCode(error, value='', errMsg='')
DIRAC.Resources.Catalog.LcgFileCatalogClient.setLfnReplicas(lfn, replicas, successful, failed)
DIRAC.Resources.Catalog.LcgFileCatalogClient.setReplicaStatus(pfn, status)