Request

mod:Request

request implementation

class DIRAC.RequestManagementSystem.Client.Request.Request(fromDict=None)

Bases: object

Parameters:

It is managed by SQLAlchemy, so the RequestID should never be set by hand (except when constructed from JSON of course…)

ALL_STATES = ('Waiting', 'Failed', 'Done', 'Scheduled', 'Assigned', 'Canceled')
CreationTime

creation time getter

FINAL_STATES = ('Done', 'Failed', 'Canceled')
LastUpdate

last update getter

NotBefore

Getter for NotBefore time

Order

ro execution order getter

Status

status getter

SubmitTime

request’s submission time getter

addOperation(operation)

add :operation: to list of Operations

Parameters:
delayNextExecution(deltaTime)

This helper sets the NotBefore attribute in deltaTime minutes in the future :param deltaTime : time in minutes before next execution

getDigest()

return digest for request

getWaiting()

get waiting operation if any

indexOf(subReq)

return index of subReq (execution order)

insertAfter(newOperation, existingOperation)

insert :newOperation: just after :existingOperation:

Parameters:
insertBefore(newOperation, existingOperation)

insert :newOperation: just before :existingOperation:

Parameters:
isEmpty()

Evaluate if the request is empty

optimize()

Merges together the operations that can be merged. They need to have the following arguments equal: * Type * Arguments * SourceSE * TargetSE * Catalog It also makes sure that the maximum number of Files in an Operation is never overcome.

CAUTION: this method is meant to be called before inserting into the DB.
So if the RequestID is not 0, we don’t touch
Returns:S_ERROR if the Request should not be optimized (because already in the DB) S_OK(True) if a optimization was carried out S_OK(False) if no optimization were carried out
subStatusList()

list of statuses for all operations

toJSON()

Returns the JSON formated string that describes the request