FTS3Job

class DIRAC.DataManagementSystem.Client.FTS3Job.FTS3Job

Bases: DIRAC.DataManagementSystem.private.FTS3Utilities.FTS3Serializable

Abstract class to represent a job to be executed by FTS. It belongs to an FTS3Operation

ALL_STATES = ['Submitted', 'Ready', 'Active', 'Finished', 'Canceled', 'Failed', 'Finisheddirty', 'Staging']
FINAL_STATES = ['Canceled', 'Failed', 'Finished', 'Finisheddirty']
INIT_STATE = 'Submitted'
__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

static generateContext(ftsServer, ucert)

This method generates an fts3 context

Parameters:
  • ftsServer – address of the fts3 server
  • ucert – the path to the certificate to be used
Returns:

an fts3 context

monitor(context=None, ftsServer=None, ucert=None)

Queries the fts server to monitor the job

This method assumes that the attribute self.ftsGUID is set

Parameters:
  • context – fts3 context. If not given, it is created (see ftsServer & ucert param)
  • ftsServer – the address of the fts server to submit to. Used only if context is not given. if not given either, use the ftsServer object attribute
  • ucert – path to the user certificate/proxy. Might be infered by the fts cli (see its doc)
Returns {FileID:
 

{ status, error } }

submit(context=None, ftsServer=None, ucert=None, pinTime=36000)

submit the job to the FTS server

Some attributes are expected to be defined for the submission to work:
  • type (set by FTS3Operation)
  • sourceSE (only for Transfer jobs)
  • targetSE
  • activity (optional)
  • priority (optional)
  • username
  • userGroup
  • filesToSubmit
  • operationID (optional, used as metadata for the job)

We also expect the FTSFiles have an ID defined, as it is given as transfer metadata

Parameters:
  • pinTime – Time the file should be pinned on disk (used for transfers and staging) Used only if he source SE is a tape storage
  • context – fts3 context. If not given, it is created (see ftsServer & ucert param)
  • ftsServer – the address of the fts server to submit to. Used only if context is not given. if not given either, use the ftsServer object attribute
  • ucert – path to the user certificate/proxy. Might be inferred by the fts cli (see its doc)

:returns S_OK([FTSFiles ids of files submitted])

toJSON(forPrint=False)

Returns the JSON formated string

Parameters:forPrint – if set to True, we don’t include the ‘magic’ arguments used for rebuilding the object