ReqClient

mod:ReqClient
class DIRAC.RequestManagementSystem.Client.ReqClient.ReqClient(url=None, **kwargs)

Bases: DIRAC.Core.Base.Client.Client

ReqClient is a class manipulating and operation on Requests.

Parameters:
  • requestManager (RPCClient) – RPC client to RequestManager
  • requestProxiesDict (dict) – RPC client to ReqestProxy
  • requestValidator (RequestValidator) – RequestValidator instance
__init__(url=None, **kwargs)

c’tor

Parameters:
  • self – self reference
  • url – url of the ReqManager
  • kwargs – forwarded to the Base Client class
deleteRequest(requestID)

delete request given it’s ID

Parameters:
  • self – self reference
  • requestID (str) – request ID
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 120 s
  • url – We can specify which url to use
finalizeRequest(requestID, jobID, useCertificates=True)
check request status and perform finalization if necessary
update the request status and the corresponding job parameter
Parameters:
  • self – self reference
  • requestID (str) – request id
  • jobID (int) – job id
getBulkRequests(numberOfRequest=10, assigned=True)

get bulk requests from RequestDB

Parameters:
  • self – self reference
  • numberOfRequest (str) – size of the bulk (default 10)
Returns:

S_OK( Successful : { requestID, RequestInstance }, Failed : message ) or S_ERROR

getDBSummary()

Get the summary of requests in the RequestDBs.

getDigest(requestID)

Get the request digest given a request ID.

Parameters:
  • self – self reference
  • requestID (str) – request id
getRequest(requestID=0)

Get request from RequestDB

Parameters:
  • self – self reference
  • requestID (int) – ID of the request. If 0, choice is made for you
Returns:

S_OK( Request instance ) or S_OK() or S_ERROR

getRequestFileStatus(requestID, lfns)

Get file status for request given a request id.

Parameters:
  • self – self reference
  • requestID (int) – request id
  • lfns (list) – list of LFNs
getRequestIDsForJobs(jobIDs)

get the request ids for the supplied jobIDs.

Parameters:
  • self – self reference
  • jobIDs (list) – list of job IDs (integers)
Returns:

S_ERROR or S_OK( “Successful”: { jobID1: reqID1, jobID2: requID2, … }, “Failed” : { jobIDn: errMsg, jobIDm: errMsg, …} )

getRequestIDsList(statusList=None, limit=None, since=None, until=None, getJobID=False)

get at most :limit: request ids with statuses in :statusList:

getRequestInfo(requestID)

The the request info given a request id.

Parameters:
  • self – self reference
  • requestID (int) – request nid
getRequestStatus(requestID)

Get the request status given a request id.

Parameters:
  • self – self reference
  • requestID (int) – id of the request
getScheduledRequest(operationID)

get scheduled request given its scheduled OperationID

getServer()

Getter for the server url. Useful ?

peekRequest(requestID)

peek request

putRequest(request, useFailoverProxy=True, retryMainService=0)

Put request to RequestManager

Parameters:
  • self – self reference
  • request (Request) – Request instance
  • useFailoverProxy (bool) – if False, will not attempt to forward the request to ReqProxies
  • retryMainService (int) – Amount of time we retry on the main ReqHandler in case of failures
Returns:

S_OK/S_ERROR

readRequestsForJobs(jobIDs)

read requests for jobs

Parameters:jobIDs (list) – list with jobIDs
Returns:S_OK( { “Successful” : { jobID1 : Request, … }, “Failed” : { jobIDn : “Fail reason” } } )
requestProxies(timeout=120)

get request proxies dict

requestValidator()

get request validator

resetFailedRequest(requestID, allR=False)

Reset a failed request to “Waiting” status

setServer(url)

Set the server URL used by default

Parameters:url – url of the service
setTimeout(timeout)

Specify the timeout of the call. Forwarded to RPCClient

Parameters:timeout – guess…
DIRAC.RequestManagementSystem.Client.ReqClient.prettyPrint(mainItem, key='', offset=0)
DIRAC.RequestManagementSystem.Client.ReqClient.printFile(indexFile)
DIRAC.RequestManagementSystem.Client.ReqClient.printOperation(indexOperation, verbose=True, onlyFailed=False)
DIRAC.RequestManagementSystem.Client.ReqClient.printRequest(request, status=None, full=False, verbose=True, terse=False)
DIRAC.RequestManagementSystem.Client.ReqClient.recoverableRequest(request)