GatewayService

The gateway service is used for forwarding service calls to the appropriate services.

For this to be used, the following CS option is required:

DIRAC {

Gateways {

my.site.org = dips://thisIsAn.url.org:9159/Framework/Gateway

}

}

At the same time, this same gateway service should be run with option /LocalInstallation/Site which is different from “my.site.org” or whatever is set in the option above, to avoid initialization loops.

class DIRAC.Core.DISET.private.GatewayService.GatewayService

Bases: DIRAC.Core.DISET.private.Service.Service

Inherits from Service so it can (and should) be run as a DIRAC service, but replaces several of the internal methods

GATEWAY_NAME = 'Framework/Gateway'
SVC_SECLOG_CLIENT = <DIRAC.FrameworkSystem.Client.SecurityLogClient.SecurityLogClient instance>
SVC_VALID_ACTIONS = {'Connection': 'Message', 'FileTransfer': 'transfer', 'Message': 'msg', 'RPC': 'export'}
getConfig()
handleConnection(clientTransport)
initialize()

This replaces the standard initialize from Service

setCloneProcessId(cloneId)
class DIRAC.Core.DISET.private.GatewayService.MessageForwarder(msgBroker)

Bases: object

addClient(cliTrid, destination, clientInitParams, connectParams)
cliDisconnect(cliTrid)
msgFromClient(cliTrid, msgObj)
msgFromSrv(srvEndCli, msgObj)
class DIRAC.Core.DISET.private.GatewayService.TransferRelay(serviceName, **kwargs)

Bases: DIRAC.Core.DISET.TransferClient.TransferClient

KW_DELEGATED_DN = 'delegatedDN'
KW_DELEGATED_GROUP = 'delegatedGroup'
KW_EXTRA_CREDENTIALS = 'extraCredentials'
KW_IGNORE_GATEWAYS = 'ignoreGateways'
KW_KEEP_ALIVE_LAPSE = 'keepAliveLapse'
KW_PROXY_CHAIN = 'proxyChain'
KW_PROXY_LOCATION = 'proxyLocation'
KW_PROXY_STRING = 'proxyString'
KW_SETUP = 'setup'
KW_SKIP_CA_CHECK = 'skipCACheck'
KW_TIMEOUT = 'timeout'
KW_USE_CERTIFICATES = 'useCertificates'
KW_VO = 'VO'
VAL_EXTRA_CREDENTIALS_HOST = 'hosts'
errMsg(msg, dynMsg='')
forwardBulkFromClient(clientFileHelper, params)
forwardBulkToClient(clientFileHelper, params)
forwardFromClient(clientFileHelper, params)
forwardListBulk(clientFileHelper, params)
forwardToClient(clientFileHelper, params)
getDataFromClient(clientFileHelper)
getDataFromService(srvMethod, params)
getDestinationService()
getServiceName()
infoMsg(msg, dynMsg='')
listBulk(bulkId, token='', compress=True)

List the contents of a bulk

:type bulkId : any :param bulkId : Identification of the bulk to list :type token : string :param token : Token for the bulk :type compress : boolean :param compress : Enable compression for the bulk. By default its True :return : S_OK/S_ERROR

receiveBulk(destDir, bulkId, token='', compress=True)

Receive a bulk of files from server

:type destDir : list of ( string / file descriptor / file object ) :param destDir : Files to receive from server :type bulkId : any :param bulkId : Identification of the files being received :type token : string :param token : Token for the bulk :type compress : boolean :param compress : Enable compression for the bulk. By default its True :return : S_OK/S_ERROR

receiveFile(filename, fileId, token='')

Receive a file from the server

:type filename : string / file descriptor / file object :param filename : File to receive from server :type fileId : any :param fileId : Identification of the file being received :type token : string :param token : Optional token for the file :return : S_OK/S_ERROR

sendBulk(fileList, bulkId, token='', compress=True, bulkSize=-1, onthefly=True)

Send a bulk of files to server

:type fileList : list of ( string / file descriptor / file object ) :param fileList : Files to send to server :type bulkId : any :param bulkId : Identification of the files being sent :type token : string :param token : Token for the bulk :type compress : boolean :param compress : Enable compression for the bulk. By default its True :type bulkSize : integer :param bulkSize : Optional size of the bulk :return : S_OK/S_ERROR

sendDataToClient(clientFileHelper, dataToSend)
sendDataToService(srvMethod, params, data)
sendFile(filename, fileId, token='')

Send a file to server

:type filename : string / file descriptor / file object :param filename : File to send to server :type fileId : any :param fileId : Identification of the file being sent :type token : string :param token : Optional token for the file :return : S_OK/S_ERROR

setTransferLimit(trLimit)