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


Python DiracAdmin.getBDIISA方法代码示例

本文整理汇总了Python中DIRAC.Interfaces.API.DiracAdmin.DiracAdmin.getBDIISA方法的典型用法代码示例。如果您正苦于以下问题:Python DiracAdmin.getBDIISA方法的具体用法?Python DiracAdmin.getBDIISA怎么用?Python DiracAdmin.getBDIISA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Interfaces.API.DiracAdmin.DiracAdmin的用法示例。


在下文中一共展示了DiracAdmin.getBDIISA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getInfo

# 需要导入模块: from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin [as 别名]
# 或者: from DIRAC.Interfaces.API.DiracAdmin.DiracAdmin import getBDIISA [as 别名]
def getInfo( params ):
  '''
    Retrieve information from BDII 
  '''

  from DIRAC.Interfaces.API.DiracAdmin                         import DiracAdmin
  diracAdmin = DiracAdmin()

  if params['info'] == 'ce':
    result = diracAdmin.getBDIICE( params['ce'], host = params['host'] )
  if params['info'] == 'ce-state':
    result = diracAdmin.getBDIICEState( params['ce'], useVO = params['vo'], host = params['host'] )
  if params['info'] == 'ce-cluster':
    result = diracAdmin.getBDIICluster( params['ce'], host = params['host'] )
  if params['info'] == 'ce-vo':
    result = diracAdmin.getBDIICEVOView( params['ce'], useVO = params['vo'], host = params['host'] )
  if params['info'] == 'site':
    result = diracAdmin.getBDIISite( params['site'], host = params['host'] )
  if params['info'] == 'site-sa':
    result = diracAdmin.getBDIISA( params['site'], useVO = params['vo'], host = params['host'] )
 
  if not result['OK']:
    print result['Message']
    DIRAC.exit( 2 )

  return result
开发者ID:SimonBidwell,项目名称:DIRAC,代码行数:28,代码来源:dirac-admin-bdii-info.py

示例2: getVOForGroup

# 需要导入模块: from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin [as 别名]
# 或者: from DIRAC.Interfaces.API.DiracAdmin.DiracAdmin import getBDIISA [as 别名]
  voName = getVOForGroup( ret['Value']['group'] )

for unprocSw in Script.getUnprocessedSwitches():
  if unprocSw[0] in ( "H", "host" ):
    host = unprocSw[1]
  if unprocSw[0] in ( "V", "vo" ):
    voName = unprocSw[1]

if not voName:
  Script.gLogger.error( 'Could not determine VO' )
  Script.showHelp()

from DIRAC import exit as DIRACExit
from DIRAC.Interfaces.API.DiracAdmin                         import DiracAdmin
diracAdmin = DiracAdmin()

result = diracAdmin.getBDIISA( site, useVO = voName, host = host )
if not ['OK']:
  print result['Message']
  DIRACExit( 2 )


sas = result['Value']
for sa in sas:
  print "SA: %s {" % sa.get( 'GlueChunkKey', 'Unknown' )
  for item in sa.iteritems():
    print "%s: %s" % item
  print "}"


开发者ID:graciani,项目名称:DIRAC,代码行数:30,代码来源:dirac-admin-bdii-sa.py


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