ReqManagerHandler

Implementation of the RequestDB service in the DISET framework

ReqManager options
ReqManager
{
  Port = 9140
  # If > 0, delay retry for this many minutes
  ConstantRequestDelay = 0
  Authorization
  {
    Default = authenticated
  }
}
class DIRAC.RequestManagementSystem.Service.ReqManagerHandler.ReqManagerHandler(handlerInitDict, trid)

Bases: ReqManagerHandlerMixin, 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']
classmethod export_cancelRequest(requestID)

Cancel a request

classmethod export_deleteRequest(requestID)

Delete the request with the supplied ID

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

classmethod export_getBulkRequestStatus(requestIDs)

get requests statuses given their ids

classmethod export_getBulkRequests(numberOfRequest, assigned)

Get a request of given type from the database

Warning:

the dictionary may contain string keys instead of int (json serialization) Do not forget to cast it back

Parameters:

numberOfRequest – size of the bulk (default 10)

Returns:

S_OK( {Failed : message, Successful : list of Request.toJSON()} )

classmethod export_getDBSummary()

Get the summary of requests in the Request DB

classmethod export_getDigest(requestID)

get digest for a request given its id

Parameters:

requestID (str) – request’s id

Returns:

S_OK( json_str )

classmethod export_getDistinctValuesWeb(attribute)

Get distinct values for a given request attribute. ‘Type’ is interpreted as the operation type

classmethod export_getRequest(requestID=0)

Get a request of given type from the database

classmethod export_getRequestCountersWeb(groupingAttribute, selectDict)

For the web portal. Returns a dictionary {value : counts} for a given key. The key can be any field from the RequestTable. or “Type”, which will be interpreted as ‘Operation.Type’

Parameters:
  • groupingAttribute – attribute used for grouping

  • selectDict – selection criteria

classmethod export_getRequestFileStatus(requestID, lfnList)

get request file status for a given LFNs list and requestID

classmethod export_getRequestIDForName(requestName)

get requestID for given :requestName:

classmethod export_getRequestIDsForJobs(jobIDs)

Select the request IDs for supplied jobIDs

Warning:

the dictionary may contain string keys instead of int (json serialization) Do not forget to cast it back

classmethod export_getRequestIDsList(statusList=None, limit=None, since=None, until=None, getJobID=False)

get requests’ IDs with status in :statusList:

classmethod export_getRequestInfo(requestID)

get request info for a given requestID

classmethod export_getRequestStatus(requestID)

get request status given its id

classmethod export_getRequestSummaryWeb(selectDict, sortList, startItem, maxItems)

Returns a list of Request for the web portal

Parameters:
  • selectDict (dict) – parameter on which to restrain the query {key : Value} key can be any of the Request columns, ‘Type’ (interpreted as Operation.Type) and ‘FromData’ and ‘ToData’ are matched against the LastUpdate field

  • sortList (list) – [sorting column, ASC/DESC]

  • startItem (int) – start item (for pagination)

  • maxItems (int) – max items (for pagination)

classmethod export_getScheduledRequest(operationID)

read scheduled request given operationID

classmethod export_peekRequest(requestID=0)

peek request given its id

export_ping()
export_putRequest(requestJSON)

put a new request into RequestDB

Parameters:
  • cls – class ref

  • requestJSON (str) – request serialized to JSON format

classmethod export_readRequestsForJobs(jobIDs)

read requests for jobs given list of jobIDs

static export_refreshConfiguration(fromMaster)

Force refreshing the configuration data

Parameters:

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

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(serviceInfoDict)

initialize handler

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_cancelRequest = [<class 'int'>]
types_deleteRequest = [<class 'int'>]
types_echo = [<class 'str'>]
types_getBulkRequestStatus = [<class 'list'>]
types_getBulkRequests = [<class 'int'>, <class 'bool'>]
types_getDBSummary = []
types_getDigest = [<class 'int'>]
types_getDistinctValuesWeb = [<class 'str'>]
types_getRequest = [<class 'int'>]
types_getRequestCountersWeb = [<class 'str'>, <class 'dict'>]
types_getRequestFileStatus = [<class 'int'>, [<class 'str'>, <class 'list'>]]
types_getRequestIDForName = [<class 'str'>]
types_getRequestIDsForJobs = [<class 'list'>]
types_getRequestIDsList = [<class 'list'>, <class 'int'>, <class 'str'>]
types_getRequestInfo = [<class 'int'>]
types_getRequestStatus = [<class 'int'>]
types_getRequestSummaryWeb = [<class 'dict'>, <class 'list'>, <class 'int'>, <class 'int'>]
types_getScheduledRequest = [<class 'int'>]
types_peekRequest = [<class 'int'>]
types_ping = []
types_putRequest = [<class 'str'>]
types_readRequestsForJobs = [<class 'list'>]
types_refreshConfiguration = [<class 'bool'>]
types_whoami = []
classmethod validate(request)

request validation

class DIRAC.RequestManagementSystem.Service.ReqManagerHandler.ReqManagerHandlerMixin

Bases: object

class ReqManagerHandler

RequestDB interface in the DISET framework.

classmethod export_cancelRequest(requestID)

Cancel a request

classmethod export_deleteRequest(requestID)

Delete the request with the supplied ID

classmethod export_getBulkRequestStatus(requestIDs)

get requests statuses given their ids

classmethod export_getBulkRequests(numberOfRequest, assigned)

Get a request of given type from the database

Warning:

the dictionary may contain string keys instead of int (json serialization) Do not forget to cast it back

Parameters:

numberOfRequest – size of the bulk (default 10)

Returns:

S_OK( {Failed : message, Successful : list of Request.toJSON()} )

classmethod export_getDBSummary()

Get the summary of requests in the Request DB

classmethod export_getDigest(requestID)

get digest for a request given its id

Parameters:

requestID (str) – request’s id

Returns:

S_OK( json_str )

classmethod export_getDistinctValuesWeb(attribute)

Get distinct values for a given request attribute. ‘Type’ is interpreted as the operation type

classmethod export_getRequest(requestID=0)

Get a request of given type from the database

classmethod export_getRequestCountersWeb(groupingAttribute, selectDict)

For the web portal. Returns a dictionary {value : counts} for a given key. The key can be any field from the RequestTable. or “Type”, which will be interpreted as ‘Operation.Type’

Parameters:
  • groupingAttribute – attribute used for grouping

  • selectDict – selection criteria

classmethod export_getRequestFileStatus(requestID, lfnList)

get request file status for a given LFNs list and requestID

classmethod export_getRequestIDForName(requestName)

get requestID for given :requestName:

classmethod export_getRequestIDsForJobs(jobIDs)

Select the request IDs for supplied jobIDs

Warning:

the dictionary may contain string keys instead of int (json serialization) Do not forget to cast it back

classmethod export_getRequestIDsList(statusList=None, limit=None, since=None, until=None, getJobID=False)

get requests’ IDs with status in :statusList:

classmethod export_getRequestInfo(requestID)

get request info for a given requestID

classmethod export_getRequestStatus(requestID)

get request status given its id

classmethod export_getRequestSummaryWeb(selectDict, sortList, startItem, maxItems)

Returns a list of Request for the web portal

Parameters:
  • selectDict (dict) – parameter on which to restrain the query {key : Value} key can be any of the Request columns, ‘Type’ (interpreted as Operation.Type) and ‘FromData’ and ‘ToData’ are matched against the LastUpdate field

  • sortList (list) – [sorting column, ASC/DESC]

  • startItem (int) – start item (for pagination)

  • maxItems (int) – max items (for pagination)

classmethod export_getScheduledRequest(operationID)

read scheduled request given operationID

classmethod export_peekRequest(requestID=0)

peek request given its id

export_putRequest(requestJSON)

put a new request into RequestDB

Parameters:
  • cls – class ref

  • requestJSON (str) – request serialized to JSON format

classmethod export_readRequestsForJobs(jobIDs)

read requests for jobs given list of jobIDs

classmethod initializeHandler(serviceInfoDict)

initialize handler

types_cancelRequest = [<class 'int'>]
types_deleteRequest = [<class 'int'>]
types_getBulkRequestStatus = [<class 'list'>]
types_getBulkRequests = [<class 'int'>, <class 'bool'>]
types_getDBSummary = []
types_getDigest = [<class 'int'>]
types_getDistinctValuesWeb = [<class 'str'>]
types_getRequest = [<class 'int'>]
types_getRequestCountersWeb = [<class 'str'>, <class 'dict'>]
types_getRequestFileStatus = [<class 'int'>, [<class 'str'>, <class 'list'>]]
types_getRequestIDForName = [<class 'str'>]
types_getRequestIDsForJobs = [<class 'list'>]
types_getRequestIDsList = [<class 'list'>, <class 'int'>, <class 'str'>]
types_getRequestInfo = [<class 'int'>]
types_getRequestStatus = [<class 'int'>]
types_getRequestSummaryWeb = [<class 'dict'>, <class 'list'>, <class 'int'>, <class 'int'>]
types_getScheduledRequest = [<class 'int'>]
types_peekRequest = [<class 'int'>]
types_putRequest = [<class 'str'>]
types_readRequestsForJobs = [<class 'list'>]
classmethod validate(request)

request validation