本文整理汇总了Python中DIRAC.ResourceStatusSystem.Client.ResourceStatusClient.ResourceStatusClient.getPeriods方法的典型用法代码示例。如果您正苦于以下问题:Python ResourceStatusClient.getPeriods方法的具体用法?Python ResourceStatusClient.getPeriods怎么用?Python ResourceStatusClient.getPeriods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.ResourceStatusSystem.Client.ResourceStatusClient.ResourceStatusClient
的用法示例。
在下文中一共展示了ResourceStatusClient.getPeriods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RSPeriods_Command
# 需要导入模块: from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient import ResourceStatusClient [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient.ResourceStatusClient import getPeriods [as 别名]
class RSPeriods_Command(Command):
def doCommand(self):
"""
Return getPeriods from ResourceStatus Client
- args[0] should be a ValidRes
- args[1] should be the name of the ValidRes
- args[2] should be the present status
- args[3] are the number of hours requested
"""
super(RSPeriods_Command, self).doCommand()
if self.client is None:
from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient import ResourceStatusClient
self.client = ResourceStatusClient()
try:
res = self.client.getPeriods(self.args[0], self.args[1], self.args[2], self.args[3])
except:
gLogger.exception("Exception when calling ResourceStatusClient for %s %s" % (self.args[0], self.args[1]))
return {"Result": "Unknown"}
return {"Result": res}
doCommand.__doc__ = Command.doCommand.__doc__ + doCommand.__doc__
示例2: RSPeriodsCommand
# 需要导入模块: from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient import ResourceStatusClient [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Client.ResourceStatusClient.ResourceStatusClient import getPeriods [as 别名]
class RSPeriodsCommand( Command ):
def __init__( self, args = None, clients = None ):
super( RSPeriodsCommand, self ).__init__( args, clients )
if 'ResourceStatusClient' in self.apis:
self.rsClient = self.apis[ 'ResourceStatusClient' ]
else:
self.rsClient = ResourceStatusClient()
def doCommand( self ):
"""
Return getPeriods from ResourceStatus Client
- args[0] should be a ValidElement
- args[1] should be the name of the ValidElement
- args[2] should be the present status
- args[3] are the number of hours requested
"""
# try:
res = self.rsClient.getPeriods( self.args[0], self.args[1], self.args[2], self.args[3] )
# except Exception, e:
# _msg = '%s (%s): %s' % ( self.__class__.__name__, self.args, e )
# gLogger.exception( _msg )
# return S_ERROR( _msg )
return res