本文整理汇总了Python中DIRAC.Interfaces.API.Dirac.Dirac.monitorRepository方法的典型用法代码示例。如果您正苦于以下问题:Python Dirac.monitorRepository方法的具体用法?Python Dirac.monitorRepository怎么用?Python Dirac.monitorRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.Dirac.Dirac
的用法示例。
在下文中一共展示了Dirac.monitorRepository方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _getOutputs
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
def _getOutputs():
repoLocation = ''
clip = _Params()
clip.registerSwitches()
Script.parseCommandLine( ignoreErrors = False )
repoLocation = clip.repo
if not repoLocation:
Script.showHelp()
dexit(1)
from DIRAC import gLogger
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac(True, repoLocation)
exitCode = 0
res = dirac.monitorRepository(False)
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
dexit(1)
res = dirac.retrieveRepositorySandboxes()
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
dexit(1)
if clip.outputdata:
res = dirac.retrieveRepositoryData()
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
exit(1)
dexit(exitCode)
示例2: _getOutputData
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
def _getOutputData():
cliParams = _Params()
cliParams.registerSwitches()
Script.parseCommandLine( ignoreErrors = False )
if not cliParams.repo:
Script.showHelp()
dexit(2)
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac(True, cliParams.repo)
exitCode = 0
dirac.monitorRepository(False)
dirac.retrieveRepositoryData()
dexit(exitCode)
示例3: len
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
Monitor the jobs present in the repository
"""
__RCSID__ = "eab4069 (2011-11-16 10:51:49 +0100) Stephane Poss <[email protected]>"
import DIRAC
from DIRAC.Core.Base import Script
import os, sys
Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
'Usage:',
' %s [option|cfgfile] ... RepoDir' % Script.scriptName,
'Arguments:',
' RepoDir: Location of Job Repository' ] ) )
Script.parseCommandLine( ignoreErrors = False )
args = Script.getPositionalArgs()
if len( args ) != 1:
Script.showHelp()
repoLocation = args[0]
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac( withRepo = True, repoLocation = repoLocation )
exitCode = 0
result = dirac.monitorRepository( printOutput = True )
if not result['OK']:
print 'ERROR: ', result['Message']
exitCode = 2
DIRAC.exit( exitCode )
示例4: Params
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
if __name__=="__main__":
repoLocation = ''
clip = Params()
clip.registerSwitches()
Script.parseCommandLine( ignoreErrors = False )
repoLocation = clip.repo
if not repoLocation:
Script.showHelp()
dexit(1)
from DIRAC import gLogger
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac(True, repoLocation)
exitCode = 0
res = dirac.monitorRepository(False)
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
dexit(1)
res = dirac.retrieveRepositorySandboxes()
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
dexit(1)
if clip.outputdata:
res = dirac.retrieveRepositoryData()
if not res['OK']:
gLogger.error("Failed because %s" % res['Message'])
exit(1)
dexit(exitCode)