SystemAdministratorClient

The SystemAdministratorClient is a class representing the client of the DIRAC SystemAdministrator service. It has also methods to update the Configuration Service with the DIRAC components options

class DIRAC.FrameworkSystem.Client.SystemAdministratorClient.SystemAdministratorClient(host, port=None, **kwargs)

Bases: DIRAC.Core.Base.Client.Client

__init__(host, port=None, **kwargs)

Constructor function. Takes a mandatory host parameter

addDatabaseOptionsToCS(self, system, database, overwrite, **kwargs)

Add the section with the database options to the CS

Automatically created for the service function export_addDatabaseOptionsToCS()

Parameters
  • system – system

  • database – database

  • overwrite – overwrite

addDefaultOptionsToCS(self, componentType, system, component, overwrite, **kwargs)

Add default component options to the global CS or to the local options

Automatically created for the service function export_addDefaultOptionsToCS()

Parameters
  • componentType – componentType

  • system – system

  • component – component

  • overwrite – overwrite

addDefaultOptionsToComponentCfg(self, componentType, system, component, **kwargs)

Add default component options local component cfg

Automatically created for the service function export_addDefaultOptionsToComponentCfg()

Parameters
  • componentType – componentType

  • system – system

  • component – component

addOptionToDiracCfg(self, option, value, **kwargs)

Set option in the local configuration file

Automatically created for the service function export_addOptionToDiracCfg()

Parameters
  • option – option

  • value – value

property call

To be removed once we’re sure self.call has been removed

Type

Deprecated

checkComponentLog(self, component, **kwargs)

Check component log for errors

Automatically created for the service function export_checkComponentLog()

Parameters

component – component

executeCommand(self, command, **kwargs)

Execute a command locally and return its output

Automatically created for the service function export_executeCommand()

Parameters

command – command

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

getAvailableDatabases(self, **kwargs)

Get the list of databases which software is installed in the system

Automatically created for the service function export_getAvailableDatabases()

getClientKWArgs()

Returns a copy of the connection arguments

getComponentDocumentation(self, cType, system, module, **kwargs)

Automatically created for the service function export_getComponentDocumentation()

Parameters
  • cType – cType

  • system – system

  • module – module

getDatabases(self, mysqlPassword, **kwargs)

Get the list of installed databases

Automatically created for the service function export_getDatabases()

Parameters

mysqlPassword – mysqlPassword

getHostInfo(self, **kwargs)

Retrieve host parameters

Automatically created for the service function export_getHostInfo()

getInfo(self, **kwargs)

Get versions of the installed DIRAC software and extensions, setup of the local installation

Automatically created for the service function export_getInfo()

getInstalledComponents(self, **kwargs)

Get the list of all the components ( services and agents ) installed on the system in the runit directory

Automatically created for the service function export_getInstalledComponents()

getLogTail(self, system, component, length, **kwargs)

Get the tail of the component log file

Automatically created for the service function export_getLogTail()

Parameters
  • system – system

  • component – component

  • length – length

getMySQLStatus(self, **kwargs)

Get the status of the MySQL database installation

Automatically created for the service function export_getMySQLStatus()

getOverallStatus(self, **kwargs)

Get the complete status information of all components.

Automatically created for the service function export_getOverallStatus()

getProject(self, **kwargs)

Automatically created for the service function export_getProject()

getServer()

Getter for the server url. Useful ?

getSetupComponents(self, **kwargs)

Get the list of all the components ( services and agents ) set up for running with runsvdir in /opt/dirac/startup directory

Automatically created for the service function export_getSetupComponents()

getSoftwareComponents(self, **kwargs)

Get the list of all the components ( services and agents ) for which the software is installed on the system

Automatically created for the service function export_getSoftwareComponents()

getStartupComponentStatus(self, componentTupleList, **kwargs)

Get the list of all the components ( services and agents ) set up for running with runsvdir in startup directory

Automatically created for the service function export_getStartupComponentStatus()

Parameters

componentTupleList – componentTupleList

getUsedPorts(self, **kwargs)

Retrieve the ports in use by services on this host

Returns

Returns a dictionary containing, for each system, which port is being used by which service

Automatically created for the service function export_getUsedPorts()

httpsClient

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

installComponent(self, componentType, system, component, componentModule, **kwargs)

Install runit directory for the specified component

Automatically created for the service function export_installComponent()

Parameters
  • componentType – componentType

  • system – system

  • component – component

  • componentModule – componentModule

installDatabase(self, dbName, mysqlPassword, **kwargs)

Install a DIRAC database named dbName

Automatically created for the service function export_installDatabase()

Parameters
  • dbName – dbName

  • mysqlPassword – mysqlPassword

restartComponent(self, system, component, **kwargs)

Restart the specified component, running with the runsv daemon

Automatically created for the service function export_restartComponent()

Parameters
  • system – system

  • component – component

revertSoftware(self, **kwargs)

Revert the last installed version of software to the previous one

Automatically created for the service function export_revertSoftware()

setProject(self, projectName, **kwargs)

Automatically created for the service function export_setProject()

Parameters

projectName – projectName

setServer(url)

Set the server URL used by default

Parameters

url – url of the service

setupComponent(self, componentType, system, component, componentModule, **kwargs)

Setup the specified component for running with the runsvdir daemon It implies installComponent

Automatically created for the service function export_setupComponent()

Parameters
  • componentType – componentType

  • system – system

  • component – component

  • componentModule – componentModule

startComponent(self, system, component, **kwargs)

Start the specified component, running with the runsv daemon

Automatically created for the service function export_startComponent()

Parameters
  • system – system

  • component – component

stopComponent(self, system, component, **kwargs)

Stop the specified component, running with the runsv daemon

Automatically created for the service function export_stopComponent()

Parameters
  • system – system

  • component – component

uninstallComponent(self, system, component, removeLogs, **kwargs)

Remove runit directory for the specified component It implies unsetupComponent

Automatically created for the service function export_uninstallComponent()

Parameters
  • system – system

  • component – component

  • removeLogs – removeLogs

uninstallDatabase(self, dbName, mysqlPassword, **kwargs)

Uninstall a DIRAC database named dbName

Automatically created for the service function export_uninstallDatabase()

Parameters
  • dbName – dbName

  • mysqlPassword – mysqlPassword

unsetupComponent(self, system, component, **kwargs)

Removed the specified component from running with the runsvdir daemon

Automatically created for the service function export_unsetupComponent()

Parameters
  • system – system

  • component – component

updateSoftware(self, version, rootPath, diracOSVersion, **kwargs)

Automatically created for the service function export_updateSoftware()

Parameters
  • version – version

  • rootPath – rootPath

  • diracOSVersion – diracOSVersion