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.findURLPriority(preferredURLPatterns: list[Pattern[str]], url: str) int

Find which preferred URL pattern the URL matches.

Parameters:
  • preferredURLPatterns (str) – patterns to check in ranked order

  • url (str) – URL to check

Returns:

int – index of the pattern that matched, smallest is the most preferred

DIRAC.ConfigurationSystem.Client.PathFinder.getAPISection(system, endpointName=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)

Get agent section in a system

Parameters:
  • system (str) – system name

  • agentName (str) – agent name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getComponentSection(system, component=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’

  • 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’, componentCategory=’Services’) getComponentSection(‘WorkloadManagement’, ‘SandboxStoreHandler’)

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

Get DB section in a system

Parameters:
  • system (str) – system name

  • dbName (str) – DB name

Returns:

str

DIRAC.ConfigurationSystem.Client.PathFinder.getDisabledDiracxVOs() list[str]

Get the list of VOs for which DiracX is enabled

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

Get executor section in a system

Parameters:
  • system (str) – system name

  • executorName (str) – executor 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)

Get failover URLs for service

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

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

Returns:

str – complete list of urls

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

Get service section in a system

Parameters:
  • system (str) – system name

  • serviceName (str) – service name

Returns:

str

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

Generate url.

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

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

Returns:

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

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

Generate url.

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

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

  • 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.getSystemURLSection(system)

Get URLs section in a system

Parameters:

system (str) – system name

Returns:

str

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

Generate url.

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

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

Returns:

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

DIRAC.ConfigurationSystem.Client.PathFinder.groupURLsByPriority(urls: Iterable[str]) list[set[str]]

Group URLs by priority.

Parameters:
  • preferredURLPatterns (Iterable[str]) – patterns to check in ranked order

  • urls (set[str]) – URLs to check

Returns:

list[set[str]] – list of URL groups, ordered by priority

DIRAC.ConfigurationSystem.Client.PathFinder.useLegacyAdapter(system, service=None) bool

Should DiracX be used for this service via the legacy adapter mechanism

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

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

Returns:

bool – True if DiracX should be used