TransformationClient

Class that contains client access to the transformation DB handler.

class DIRAC.TransformationSystem.Client.TransformationClient.TransformationClient(**kwargs)

Bases: DIRAC.Core.Base.Client.Client

Exposes the functionality available in the DIRAC/TransformationHandler

This inherits the DIRAC base Client for direct execution of server functionality. The following methods are available (although not visible here).

Transformation (table) manipulation

deleteTransformation(transName) getTransformationParameters(transName,paramNames) getTransformationWithStatus(status) setTransformationParameter(transName,paramName,paramValue) deleteTransformationParameter(transName,paramName)

TransformationFiles table manipulation

addFilesToTransformation(transName,lfns) addTaskForTransformation(transName,lfns=[],se=’Unknown’) getTransformationStats(transName)

TransformationTasks table manipulation

setTaskStatus(transName, taskID, status) setTaskStatusAndWmsID(transName, taskID, status, taskWmsID) getTransformationTaskStats(transName) deleteTasks(transName, taskMin, taskMax) extendTransformation( transName, nTasks) getTasksToSubmit(transName,numTasks,site=’‘)

TransformationLogging table manipulation

getTransformationLogging(transName)

File/directory manipulation methods (the remainder of the interface can be found below)

getFileSummary(lfns) exists(lfns)

Web monitoring tools

getDistinctAttributeValues(attribute, selectDict) getTransformationStatusCounters() getTransformationSummary() getTransformationSummaryWeb(selectDict, sortList, startItem, maxItems)
addDirectory(path, force=False)
addTransformation(transName, description, longDescription, transType, plugin, agentType, fileMask, transformationGroup='General', groupSize=1, inheritedFrom=0, body='', maxTasks=0, eventsPerTask=0, addFiles=True, timeout=1800)

add a new transformation

cleanTransformation(transID)

Clean the transformation, and set the status parameter (doing it here, for easier extensibility)

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
getCounters(table, attrList, condDict, older=None, newer=None, timeStamp=None)
getServer()

Getter for the server url. Useful ?

getTransformation(transName, extraParams=False)
getTransformationFiles(condDict=None, older=None, newer=None, timeStamp=None, orderAttribute=None, limit=None, timeout=1800, offset=0, maxfiles=None)

gets all the transformation files for a transformation, incrementally. “limit” here is just used to determine the offset.

getTransformationTasks(condDict=None, older=None, newer=None, timeStamp=None, orderAttribute=None, limit=10000, inputVector=False)

gets all the transformation tasks for a transformation, incrementally. “limit” here is just used to determine the offset.

getTransformations(condDict=None, older=None, newer=None, timeStamp=None, orderAttribute=None, limit=100, extraParams=False)

gets all the transformations in the system, incrementally. “limit” here is just used to determine the offset.

isOK()
moveFilesToDerivedTransformation(transDict, resetUnused=True)

move files input to a transformation, to the derived one

setFileStatusForTransformation(transName, newLFNsStatus=None, lfns=None, force=False)

Sets the file status for LFNs of a transformation

For backward compatibility purposes, the status and LFNs can be passed in 2 ways:

  • newLFNsStatus is a dictionary with the form: {‘/this/is/an/lfn1.txt’: ‘StatusA’, ‘/this/is/an/lfn2.txt’: ‘StatusB’, … } and at this point lfns is not considered
  • newLFNStatus is a string, that applies to all the LFNs in lfns
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…
setTransformationParameter(transID, paramName, paramValue, force=False)

Sets a transformation parameter. There’s a special case when coming to setting the status of a transformation.