PathFinder

Collection of utilities for finding paths in the CS

DIRAC.ConfigurationSystem.Client.PathFinder.checkComponentURL(componentURL, system=None, component=None, pathMandatory=False)

Check component URL port and path. Set default ports for http scheme and raise if no port can be found. Set path if its mandatory or raise if its empty in this case.

Parameters:
  • componentURL (str) – full URL, e.g.: dips://some-domain:3424/Framework/Service

  • system (str) – system name

  • component (str) – component name

  • pathMandatory (bool) – raise error if the path could not be generated

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.divideFullName(entityName, componentName=None)

Convert component full name to tuple

Parameters:
  • entityName (str) – component full name, e.g.: ‘Framework/ProxyManager’

  • componentName (str) – component name

Returns:

tuple – contain system and component name

DIRAC.ConfigurationSystem.Client.PathFinder.getAPISection(system, endpointName=False, setup=False)

Get API section in a system

Parameters:
  • system (str) – system name

  • endpointName (str) – endpoint name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getAgentSection(system, agentName=False, setup=False)

Get agent section in a system

Parameters:
  • system (str) – system name

  • agentName (str) – agent name

  • setup (str) – setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getComponentSection(system, component=False, setup=False, componentCategory='Services')

Function returns the path to the component.

Parameters:
  • system (str) – system name or component name prefixed by the system in which it is placed. e.g. ‘WorkloadManagement/SandboxStoreHandler’

  • component (str) – component name, e.g. ‘SandboxStoreHandler’

  • setup (str) – Name of the setup.

  • componentCategory (str) – Category of the component, it can be: ‘Agents’, ‘Services’, ‘Executors’ or ‘Databases’.

Returns:

Complete path to the component

Return type:

str

Raises:

RuntimeException – If in the system - the system part does not correspond to any known system in DIRAC.

Examples

getComponentSection(‘WorkloadManagement/SandboxStoreHandler’, setup=’Production’, componentCategory=’Services’) getComponentSection(‘WorkloadManagement’, ‘SandboxStoreHandler’, ‘Production’)

DIRAC.ConfigurationSystem.Client.PathFinder.getDIRACSetup()

Get DIRAC default setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getDatabaseSection(system, dbName=False, setup=False)

Get DB section in a system

Parameters:
  • system (str) – system name

  • dbName (str) – DB name

  • setup (str) – setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getExecutorSection(system, executorName=None, component=False, setup=False)

Get executor section in a system

Parameters:
  • system (str) – system name

  • executorName (str) – executor name

  • setup (str) – setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getGatewayURLs(system='', service=None)

Get gateway URLs for service

Parameters:
  • system (str) – system name or full name, like ‘Framework/Service’.

  • service (str) – service name, like ‘ProxyManager’.

Returns:

list or False

DIRAC.ConfigurationSystem.Client.PathFinder.getServiceFailoverURL(system, service=None, setup=False)

Get failover URLs for service

Parameters:
  • system (str) – system name or full name, like ‘Framework/Service’.

  • service (str) – service name, like ‘ProxyManager’.

  • setup (str) – DIRAC setup name, can be defined in dirac.cfg

Returns:

str – complete list of urls

DIRAC.ConfigurationSystem.Client.PathFinder.getServiceSection(system, serviceName=False, setup=False)

Get service section in a system

Parameters:
  • system (str) – system name

  • serviceName (str) – service name

  • setup (str) – setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getServiceURL(system, service=None, setup=False)

Generate url.

Parameters:
  • system (str) – system name or full name e.g.: Framework/ProxyManager

  • service (str) – service name, like ‘ProxyManager’.

  • setup (str) – DIRAC setup name, can be defined in dirac.cfg

Returns:

str – complete list of urls. e.g. dips://some-domain:3424/Framework/Service, dips://..

DIRAC.ConfigurationSystem.Client.PathFinder.getServiceURLs(system, service=None, setup=False, failover=False)

Generate url.

Parameters:
  • system (str) – system name or full name e.g.: Framework/ProxyManager

  • service (str) – service name, like ‘ProxyManager’.

  • setup (str) – DIRAC setup name, can be defined in dirac.cfg

  • failover (bool) – to add failover URLs to end of result list

Returns:

list – complete urls. e.g. [dips://some-domain:3424/Framework/Service]

DIRAC.ConfigurationSystem.Client.PathFinder.getSystemInstance(system, setup=False)

Find system instance name.

Parameters:
  • system (str) – system name

  • setup (str) – setup name

Returns:

str: instance name. If the system option is present in the /DIRAC/Setups/<setup> section but is not given a value, an empty string is returned

DIRAC.ConfigurationSystem.Client.PathFinder.getSystemSection(system, instance=False, setup=False)

Get system section

Parameters:
  • system (str) – system name

  • instance (str) – instance name

  • setup (str) – setup name

Returns:

str – system section path

DIRAC.ConfigurationSystem.Client.PathFinder.getSystemURLSection(system, setup=False)

Get URLs section in a system

Parameters:
  • system (str) – system name

  • setup (str) – setup name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getSystemURLs(system, setup=False, failover=False)

Generate url.

Parameters:
  • system (str) – system name or full name e.g.: Framework/ProxyManager

  • setup (str) – DIRAC setup name, can be defined in dirac.cfg

  • failover (bool) – to add failover URLs to end of result list

Returns:

dict – complete urls. e.g. [dips://some-domain:3424/Framework/Service]