Utilities

Utilities for managing DIRAC configuration:

DIRAC.ConfigurationSystem.Client.Utilities.getDBParameters(fullname)

Retrieve Database parameters from CS

Parameters

fullname (str) – should be of the form <System>/<DBname> defaultHost is the host to return if the option is not found in the CS. Not used as the method will fail if it cannot be found defaultPort is the port to return if the option is not found in the CS defaultUser is the user to return if the option is not found in the CS. Not usePassword is the password to return if the option is not found in the CS. Not used as the method will fail if it cannot be found defaultDB is the db to return if the option is not found in the CS. Not used as the method will fail if it cannot be found defaultQueueSize is the QueueSize to return if the option is not found in the CS

Returns

S_OK(dict)/S_ERROR() - dictionary with the keys: ‘host’, ‘port’, ‘user’, ‘password’, ‘db’ and ‘queueSize’

DIRAC.ConfigurationSystem.Client.Utilities.getDIRACGOCDictionary()

Create a dictionary containing DIRAC site names and GOCDB site names using a configuration provided by CS.

Returns

A dictionary of DIRAC site names (key) and GOCDB site names (value).

DIRAC.ConfigurationSystem.Client.Utilities.getDIRACSesForHostName(hostName)

returns the DIRAC SEs that share the same hostName

param str hostName

host name, e.g. ‘storm-fe-lhcb.cr.cnaf.infn.it’

return

S_OK with list of DIRAC SE names, or S_ERROR

Deprecated: Used nowhere

DIRAC.ConfigurationSystem.Client.Utilities.getElasticDBParameters(fullname)

Retrieve Database parameters from CS

Parameters

fullname (str) – should be of the form <System>/<DBname>

Returns

S_OK(dict)/S_ERROR()

DIRAC.ConfigurationSystem.Client.Utilities.getGridCEs(vo, bdiiInfo=None, ceBlackList=None, hostURL=None, glue2=False)

Get all the CEs available for a given VO and having queues in Production state

Parameters
  • vo (str) – VO name

  • bddiInfo (dict) – information from BDII

  • ceBlackList (list) – CEs from black list

  • hostURL (str) – host URL

  • glue2 (bool) – use glue2

Returns

Dictionary with keys: OK, Value, BdiiInfo, UnknownCEs

DIRAC.ConfigurationSystem.Client.Utilities.getGridVOs()

Get all the VOMS VO names served by this DIRAC service

Returns

S_OK(list)/S_ERROR()

DIRAC.ConfigurationSystem.Client.Utilities.getOAuthAPI(instance='Production')

Get OAuth API url

Parameters

instance (str) – instance

Returns

str

DIRAC.ConfigurationSystem.Client.Utilities.getSEsFromCS(protocol='srm')

Get all the SEs defined in the CS

param str protocol

storage protocol

return

S_OK(dict)/S_ERROR()

Deprecated: Will disappear (see https://github.com/DIRACGrid/DIRAC/issues/3908)

DIRAC.ConfigurationSystem.Client.Utilities.getSiteUpdates(vo, bdiiInfo=None, log=None, glue2=True, onecore=False)

Get all the necessary updates for the already defined sites and CEs

Parameters
  • vo (str) – VO name

  • bdiiInfo (dict) – information from DBII

  • log (object) – logger

  • onecore (bool) – whether to add single core copies of multicore queues, see the documentation about Computing Elements and the Bdii2CSAgent configuration for details

Result

S_OK(set)/S_ERROR()