本文整理汇总了Python中DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer.getRequestName方法的典型用法代码示例。如果您正苦于以下问题:Python RequestContainer.getRequestName方法的具体用法?Python RequestContainer.getRequestName怎么用?Python RequestContainer.getRequestName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer
的用法示例。
在下文中一共展示了RequestContainer.getRequestName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: submitTaskToExternal
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import getRequestName [as 别名]
def submitTaskToExternal(self,request):
if type(request) in types.StringTypes:
oRequest = RequestContainer(request)
name = oRequest.getRequestName()['Value']
elif type(request) == types.InstanceType:
name = request.getRequestName()['Value']
request = request.toXML()['Value']
else:
return S_ERROR("Request should be string or request object")
return self.requestClient.setRequest(name,request)
示例2: RequestContainer
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import getRequestName [as 别名]
else:
lfnpath = "%s%s" % (path, os.path.basename(appTar))
res = rm.putAndRegister(lfnpath, appTar, ops.getValue('Software/BaseStorageElement',"CERN-SRM"))
if not res['OK']:
return res
request = RequestContainer()
request.setCreationTime()
requestClient = RequestClient()
request.setRequestName('copy_%s' % os.path.basename(appTar).replace(".tgz","").replace(".tar.gz",""))
request.setSourceComponent('ReplicateILCSoft')
copies_at = ops.getValue('Software/CopiesAt',[])
index_copy = 0
for copies in copies_at:
res = request.addSubRequest({'Attributes':{'Operation' : 'replicateAndRegister',
'TargetSE' : copies,
'ExecutionOrder' : index_copy},
'Files':[{'LFN':lfnpath}]},
'transfer')
#res = rm.replicateAndRegister("%s%s"%(path,appTar),"IN2P3-SRM")
if not res['OK']:
return res
index_copy += 1
requestxml = request.toXML()['Value']
if copies_at:
res = requestClient.setRequest(request.getRequestName()['Value'], requestxml)
if not res['OK']:
gLogger.error('Could not set replication request %s' % res['Message'])
return S_OK('Application uploaded')
return S_OK()