Request

mod:

Request

request implementation

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

Bases: object

Parameters:
  • RequestID (int) – requestID

  • Name (str) – request’ name

  • Owner (str) – request’s owner

  • OwnerGroup (str) – request owner group

  • SourceComponent (str) – whatever

  • JobID (int) – jobID

  • CreationTime (datetime.datetime) – UTC datetime

  • SubmissionTime (datetime.datetime) – UTC datetime

  • LastUpdate (datetime.datetime) – UTC datetime

  • NotBefore (datetime.datetime) – UTC datetime

  • Status (str) – request’s status

  • operations (TypedList.TypedList) – list of operations

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')
property CreationTime

creation time getter

Error
FINAL_STATES = ('Done', 'Failed', 'Canceled')
JobID
property LastUpdate

last update getter

property NotBefore

Getter for NotBefore time

property Order

ro execution order getter

Owner
OwnerDN
OwnerGroup
RequestID
RequestName
property SourceComponent
property Status

status getter

property SubmitTime

request’s submission time getter

__init__(fromDict=None)

c’tor

Parameters:
  • self – self reference

  • fromDict – if false, new request. Can be json string that represents the object, or the dictionary directly

addOperation(operation)

add :operation: to list of Operations

Parameters:
delayNextExecution(deltaTime)

This helper sets the NotBefore attribute in deltaTime minutes in the future

Parameters:

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