TSCatalogClient

TSCatalogClient class represents the Transformation Manager service as a DIRAC Catalog service

class DIRAC.Resources.Catalog.TSCatalogClient.TSCatalogClient(url=None, **kwargs)

Bases: FileCatalogClientBase

Exposes the catalog functionality available in the DIRAC/TransformationHandler

ADMIN_METHODS = []
NO_LFN_METHODS = ['setMetadata']
READ_METHODS = ['hasAccess', 'exists', 'getPathPermissions']
WRITE_METHODS = ['addFile', 'removeFile', 'setMetadata']
__init__(url=None, **kwargs)

Constructor function.

addFile(lfns, force=False)
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

removeFile(lfns)
setMetadata(path, metadatadict)

Set metadata parameter for the given path

Returns

Successful/Failed dict.

setServer(url)

Set the server URL used by default

Parameters

url – url of the service