当前位置: 首页>>代码示例>>Python>>正文


Python RequestContainer.getRequestName方法代码示例

本文整理汇总了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)
开发者ID:NathalieRauschmayr,项目名称:DIRAC,代码行数:12,代码来源:TaskManager.py

示例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()

开发者ID:LCDgit,项目名称:ILCDIRAC,代码行数:31,代码来源:FileUtils.py


注:本文中的DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer.getRequestName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。