FreeDiskSpaceCommand The Command gets the free space that is left in a Storage Element

Note: there are, still, many references to “space tokens”, for example ResourceManagementClient().selectSpaceTokenOccupancyCache(token=elementName) This is for historical reasons, and shoud be fixed one day. For the moment, when you see “token” or “space token” here, just read “StorageElement”.

class DIRAC.ResourceStatusSystem.Command.FreeDiskSpaceCommand.FreeDiskSpaceCommand(args=None, clients=None)

Bases: DIRAC.ResourceStatusSystem.Command.Command.Command

Uses diskSpace method to get the free space

__init__(args=None, clients=None)

x.__init__(…) initializes x; see help(type(x)) for signature


This is a method that gets the element’s details from the spaceTokenOccupancyCache DB table. It will return a dictionary with th results, converted to “correct” unit.


Real commands don’t need to extende/replace this method, which is called by clients.

What is done here is the following: if self.masterMode is set to True, then the “doMaster()” method is called. if not, then the doCache() method is called, and if this returns an object this is returned, and otherwise the “doNew” method is called.


This method calls the doNew method for each storage element that exists in the CS.


Gets the parameters to run, either from the master method or from its own arguments.

Gets the total and the free disk space of a storage element and inserts the results in the SpaceTokenOccupancyCache table of ResourceManagementDB database.

The result is also returned to the caller, not only inserted. What is inserted in the DB will normally be in MB, what is returned will be in the specified unit.


Overwrites S_ERROR message with command name, much easier to debug


Overwrites S_ERROR message with command name, much easier to debug