本文整理汇总了Python中DIRAC.RequestManagementSystem.Client.ReqClient.ReqClient.requestProxies方法的典型用法代码示例。如果您正苦于以下问题:Python ReqClient.requestProxies方法的具体用法?Python ReqClient.requestProxies怎么用?Python ReqClient.requestProxies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.RequestManagementSystem.Client.ReqClient.ReqClient
的用法示例。
在下文中一共展示了ReqClient.requestProxies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseCommandLine
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.ReqClient.ReqClient import requestProxies [as 别名]
Script.registerSwitch('', 'Full', ' Print full list of requests')
Script.setUsageMessage('\n'.join([__doc__, 'Usage:', ' %s [option|cfgfile]' % Script.scriptName]))
parseCommandLine()
from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient
if __name__ == "__main__":
fullPrint = False
for switch in Script.getUnprocessedSwitches():
if switch[0] == 'Full':
fullPrint = True
reqClient = ReqClient()
for server, rpcClient in reqClient.requestProxies().iteritems():
DIRAC.gLogger.always("Checking request cache at %s" % server)
reqCache = rpcClient.listCacheDir()
if not reqCache['OK']:
DIRAC.gLogger.error("Cannot list request cache", reqCache)
continue
reqCache = reqCache['Value']
if fullPrint:
DIRAC.gLogger.always("List of requests", reqCache)
else:
DIRAC.gLogger.always("Number of requests in the cache", len(reqCache))
DIRAC.exit(0)