StorageManagerClient

Class that contains client access to the StorageManagerDB handler.

class DIRAC.StorageManagementSystem.Client.StorageManagerClient.StorageManagerClient(**kwargs)

Bases: DIRAC.Core.Base.Client.Client

This is the client to the StorageManager service, so even if it is not seen, it exposes all its RPC calls

__init__(**kwargs)

C’tor.

Parameters

kwargs – just stored as an attribute and passed when creating the RPCClient

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

getAssociatedReplicas(cls, replicaIDs, **kwargs)

Retrieve the list of Replicas that belong to the same Tasks as the provided list

Automatically created for the service function export_getAssociatedReplicas()

Parameters

replicaIDs – replicaIDs

getCacheReplicas(cls, condDict, older, newer, timeStamp, orderAttribute, limit, **kwargs)

Get the replcias known to the DB.

Automatically created for the service function export_getCacheReplicas()

Parameters
  • condDict – condDict

  • older – older

  • newer – newer

  • timeStamp – timeStamp

  • orderAttribute – orderAttribute

  • limit – limit

getCacheReplicasSummary(cls, **kwargs)

Reports breakdown of file number/size in different staging states across storage elements

Automatically created for the service function export_getCacheReplicasSummary()

getOfflineReplicas(cls, **kwargs)

This method obtains the replicas for which all replicas in the task are Offline

Automatically created for the service function export_getOfflineReplicas()

getReplicasWithStatus(cls, status, **kwargs)

This method allows to retrieve replicas with the supplied status

Automatically created for the service function export_getReplicasWithStatus()

Parameters

status – status

getServer()

Getter for the server url. Useful ?

getStageRequests(cls, condDict, older, newer, timeStamp, orderAttribute, limit, **kwargs)

Get the replcias known to the DB.

Automatically created for the service function export_getStageRequests()

Parameters
  • condDict – condDict

  • older – older

  • newer – newer

  • timeStamp – timeStamp

  • orderAttribute – orderAttribute

  • limit – limit

getStageSubmittedReplicas(cls, **kwargs)

This method obtains the replica metadata and the stage requestID for the replicas in StageSubmitted status

Automatically created for the service function export_getStageSubmittedReplicas()

getStagedReplicas(cls, **kwargs)

This method obtains the replicas for which all replicas in the task are Staged/StageSubmitted

Automatically created for the service function export_getStagedReplicas()

getSubmittedStagePins(cls, **kwargs)

This method obtains the number of files and size of the requests submitted for each storage element

Automatically created for the service function export_getSubmittedStagePins()

getTaskInfo(cls, taskID, **kwargs)

Obtain the metadata of the stage task from the DB.

Automatically created for the service function export_getTaskInfo()

Parameters

taskID – taskID

getTaskStatus(cls, taskID, **kwargs)

Obtain the status of the stage task from the DB.

Automatically created for the service function export_getTaskStatus()

Parameters

taskID – taskID

getTaskSummary(cls, taskID, **kwargs)

Obtain the summary of the stage task from the DB.

Automatically created for the service function export_getTaskSummary()

Parameters

taskID – taskID

getTasks(cls, condDict, older, newer, timeStamp, orderAttribute, limit, **kwargs)

Get the replicas known to the DB.

Automatically created for the service function export_getTasks()

Parameters
  • condDict – condDict

  • older – older

  • newer – newer

  • timeStamp – timeStamp

  • orderAttribute – orderAttribute

  • limit – limit

getTasksWithStatus(cls, status, **kwargs)

This method allows to retrieve Tasks with the supplied status

Automatically created for the service function export_getTasksWithStatus()

Parameters

status – status

getWaitingReplicas(cls, **kwargs)

This method obtains the replicas for which all replicas in the task are Waiting

Automatically created for the service function export_getWaitingReplicas()

httpsClient

alias of DIRAC.Core.Tornado.Client.TornadoClient.TornadoClient

insertStageRequest(cls, requestReplicas, pinLifetime, **kwargs)

This method inserts the stage request ID assocaited to supplied replicaIDs

Automatically created for the service function export_insertStageRequest()

Parameters
  • requestReplicas – requestReplicas

  • pinLifetime – pinLifetime

killTasksBySourceTaskID(cls, sourceTaskIDs, **kwargs)

Given SourceTaskIDs (jobIDs), this will cancel further staging of files for the corresponding tasks

Automatically created for the service function export_killTasksBySourceTaskID()

Parameters

sourceTaskIDs – sourceTaskIDs

removeStageRequests(cls, replicaIDs, **kwargs)

Automatically created for the service function export_removeStageRequests()

Parameters

replicaIDs – replicaIDs

removeTasks(cls, taskIDs, **kwargs)

This method removes the entries from TaskReplicas and Tasks with the supplied task IDs

Automatically created for the service function export_removeTasks()

Parameters

taskIDs – taskIDs

removeUnlinkedReplicas(cls, **kwargs)

This method removes Replicas which have no associated Tasks

Automatically created for the service function export_removeUnlinkedReplicas()

setOldTasksAsFailed(cls, daysOld, **kwargs)

Set Tasks older than “daysOld” number of days to Failed These tasks have already been retried every day for staging

Automatically created for the service function export_setOldTasksAsFailed()

Parameters

daysOld – daysOld

setRequest(cls, lfnDict, source, callbackMethod, taskID, **kwargs)

This method allows stage requests to be set into the StagerDB

Automatically created for the service function export_setRequest()

Parameters
  • lfnDict – lfnDict

  • source – source

  • callbackMethod – callbackMethod

  • taskID – taskID

setServer(url)

Set the server URL used by default

Parameters

url – url of the service

setStageComplete(cls, replicaIDs, **kwargs)

This method updates the status of the stage request for the supplied replica IDs

Automatically created for the service function export_setStageComplete()

Parameters

replicaIDs – replicaIDs

setTasksDone(cls, taskIDs, **kwargs)

This method sets the status in the Tasks table to Done for the list of supplied task IDs

Automatically created for the service function export_setTasksDone()

Parameters

taskIDs – taskIDs

updateReplicaFailure(cls, replicaFailures, **kwargs)

This method sets the status of the replica to failed with the supplied reason

Automatically created for the service function export_updateReplicaFailure()

Parameters

replicaFailures – replicaFailures

updateReplicaInformation(cls, replicaTuples, **kwargs)

This method sets the pfn and size for the supplied replicas

Automatically created for the service function export_updateReplicaInformation()

Parameters

replicaTuples – replicaTuples

updateReplicaStatus(cls, replicaIDs, newReplicaStatus, **kwargs)

This allows to update the status of replicas

Automatically created for the service function export_updateReplicaStatus()

Parameters
  • replicaIDs – replicaIDs

  • newReplicaStatus – newReplicaStatus

updateTaskStatus(cls, sourceID, status, successful, failed, **kwargs)

An example to show the usage of the callbacks.

Automatically created for the service function export_updateTaskStatus()

Parameters
  • sourceID – sourceID

  • status – status

  • successful – successful

  • failed – failed

wakeupOldRequests(cls, oldRequests, retryInterval, **kwargs)

get only StageRequests with StageRequestSubmitTime older than 1 day AND are still not staged delete these requests reset Replicas with corresponding ReplicaIDs to Status=’New’

Automatically created for the service function export_wakeupOldRequests()

Parameters
  • oldRequests – oldRequests

  • retryInterval – retryInterval

DIRAC.StorageManagementSystem.Client.StorageManagerClient.getFilesToStage(lfnList, jobState=None, checkOnlyTapeSEs=None, jobLog=None)

Utility that returns out of a list of LFNs those files that are offline, and those for which at least one copy is online