SystemAdministratorHandler

SystemAdministrator service is a tool to control and monitor the DIRAC services and agents

class DIRAC.FrameworkSystem.Service.SystemAdministratorHandler.SystemAdministratorHandler(handlerInitDict, trid)

Bases: DIRAC.Core.DISET.RequestHandler.RequestHandler

__init__(handlerInitDict, trid)

Constructor

Parameters
  • handlerInitDict (dictionary) – Information vars for the service

  • trid (object) – Transport to use

auth_ping = ['all']
auth_refreshConfiguration = ['CSAdministrator']
auth_whoami = ['all']
export_addDatabaseOptionsToCS(system, database, overwrite=False)

Add the section with the database options to the CS

export_addDefaultOptionsToCS(componentType, system, component, overwrite=False)

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

export_addDefaultOptionsToComponentCfg(componentType, system, component)

Add default component options local component cfg

export_addOptionToDiracCfg(option, value)

Set option in the local configuration file

export_checkComponentLog(component)

Check component log for errors

static export_echo(data)

This method is used for testing performance of the service

Parameters

data (str) – data to be sent back to the caller

Returns

S_OK, Value is the input data

export_executeCommand(command)

Execute a command locally and return its output

export_getAvailableDatabases()

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

export_getComponentDocumentation(cType, system, module)
export_getDatabases(mysqlPassword=None)

Get the list of installed databases

export_getHostInfo()

Retrieve host parameters

export_getInfo()

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

export_getInstalledComponents()

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

export_getLogTail(system, component, length=100)

Get the tail of the component log file

export_getMySQLStatus()

Get the status of the MySQL database installation

export_getOverallStatus()

Get the complete status information of all components.

export_getProject()
export_getSetupComponents()

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

export_getSoftwareComponents()

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

export_getStartupComponentStatus(componentTupleList)

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

export_getUsedPorts()

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

export_installComponent(componentType, system, component, componentModule='')

Install runit directory for the specified component

export_installDatabase(dbName, mysqlPassword=None)

Install a DIRAC database named dbName

export_ping()
static export_refreshConfiguration(fromMaster)

Force refreshing the configuration data

Parameters

fromMaster (bool) – flag to refresh from the master configuration service

export_restartComponent(system, component)

Restart the specified component, running with the runsv daemon

export_revertSoftware()

Revert the last installed version of software to the previous one

export_setProject(projectName)
export_setupComponent(componentType, system, component, componentModule='')

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

export_startComponent(system, component)

Start the specified component, running with the runsv daemon

export_stopComponent(system, component)

Stop the specified component, running with the runsv daemon

export_uninstallComponent(system, component, removeLogs)

Remove runit directory for the specified component It implies unsetupComponent

export_uninstallDatabase(dbName, mysqlPassword=None)

Uninstall a DIRAC database named dbName

export_unsetupComponent(system, component)

Removed the specified component from running with the runsvdir daemon

export_updateSoftware(version, rootPath='', diracOSVersion='')
export_whoami()

A simple whoami, returns all credential dictionary, except certificate chain object.

classmethod getCSOption(optionName, defaultValue=False)

Get an option from the CS section of the services

Returns

Value for serviceSection/optionName in the CS being defaultValue the default

getRemoteAddress()

Get the address of the remote peer.

Returns

Address of remote peer.

getRemoteCredentials()

Get the credentials of the remote peer.

Returns

Credentials dictionary of remote peer.

initialize()

Initialize this instance of the handler (to be overwritten)

classmethod initializeHandler(serviceInfo)

Handler class initialization

srv_disconnect(trid=None)
classmethod srv_disconnectClient(trid)
srv_getActionTuple()
classmethod srv_getCSOption(optionName, defaultValue=False)

Get an option from the CS section of the services

Returns

Value for serviceSection/optionName in the CS being defaultValue the default

srv_getClientSetup()
srv_getClientVO()
srv_getClientVersion()
srv_getFormattedRemoteCredentials()
classmethod srv_getMonitor()
srv_getRemoteAddress()

Get the address of the remote peer.

Returns

Address of remote peer.

srv_getRemoteCredentials()

Get the credentials of the remote peer.

Returns

Credentials dictionary of remote peer.

classmethod srv_getServiceName()
srv_getTransportID()
classmethod srv_getURL()
classmethod srv_msgCreate(msgName)
srv_msgReply(msgObj)
classmethod srv_msgSend(trid, msgObj)
transfer_bulkFromClient(bulkId, token, bulkSize, fileHelper)
transfer_bulkToClient(bulkId, token, fileHelper)
transfer_fromClient(fileId, token, fileSize, fileHelper)
transfer_listBulk(bulkId, token, fileHelper)
transfer_toClient(fileId, token, fileHelper)
types_addDatabaseOptionsToCS = [(<class 'str'>,), (<class 'str'>,)]
types_addDefaultOptionsToCS = [(<class 'str'>,), (<class 'str'>,), (<class 'str'>,)]
types_addDefaultOptionsToComponentCfg = [(<class 'str'>,), (<class 'str'>,)]
types_addOptionToDiracCfg = [(<class 'str'>,), (<class 'str'>,)]
types_checkComponentLog = [[(<class 'str'>,), <class 'list'>]]
types_echo = [(<class 'str'>,)]
types_executeCommand = [(<class 'str'>,)]
types_getAvailableDatabases = []
types_getComponentDocumentation = [(<class 'str'>,), (<class 'str'>,), (<class 'str'>,)]
types_getDatabases = []
types_getHostInfo = []
types_getInfo = []
types_getInstalledComponents = []
types_getLogTail = [(<class 'str'>,), (<class 'str'>,)]
types_getMySQLStatus = []
types_getOverallStatus = []
types_getProject = []
types_getSetupComponents = []
types_getSoftwareComponents = []
types_getStartupComponentStatus = [<class 'list'>]
types_getUsedPorts = []
types_installComponent = [(<class 'str'>,), (<class 'str'>,), (<class 'str'>,)]
types_installDatabase = [(<class 'str'>,)]
types_ping = []
types_refreshConfiguration = [<class 'bool'>]
types_restartComponent = [(<class 'str'>,), (<class 'str'>,)]
types_revertSoftware = []
types_setProject = [(<class 'str'>,)]
types_setupComponent = [(<class 'str'>,), (<class 'str'>,), (<class 'str'>,)]
types_startComponent = [(<class 'str'>,), (<class 'str'>,)]
types_stopComponent = [(<class 'str'>,), (<class 'str'>,)]
types_uninstallComponent = [(<class 'str'>,), (<class 'str'>,), <class 'bool'>]
types_uninstallDatabase = [(<class 'str'>,)]
types_unsetupComponent = [(<class 'str'>,), (<class 'str'>,)]
types_updateSoftware = [(<class 'str'>,)]
types_whoami = []
DIRAC.FrameworkSystem.Service.SystemAdministratorHandler.loadDIRACCFG()