本文整理汇总了Python中henmanager.HenManager.getInfrastructures方法的典型用法代码示例。如果您正苦于以下问题:Python HenManager.getInfrastructures方法的具体用法?Python HenManager.getInfrastructures怎么用?Python HenManager.getInfrastructures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类henmanager.HenManager
的用法示例。
在下文中一共展示了HenManager.getInfrastructures方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HenManager
# 需要导入模块: from henmanager import HenManager [as 别名]
# 或者: from henmanager.HenManager import getInfrastructures [as 别名]
sys.path.append("/usr/local/hen/lib/")
for i in temp:
sys.path.append(i)
from henmanager import HenManager
###########################################################################################
# Main execution
###########################################################################################
print "Content-Type: text/xml"
print ""
print ""
print "<row>"
manager = HenManager("/usr/local/hen/etc/configs/config" )
racks = manager.getInfrastructures("rack")
nodes = manager.getNodes("all", "all")
rackNodes = {}
for key in racks.keys():
rackNodes[key] = []
for nodeTypeDictionary in nodes.values():
for node in nodeTypeDictionary.values():
location = node.getPhysicalLocation()
if (location != None):
if rackNodes.has_key(location.getRackName()):
s = '<node id="' + str(node.getNodeID())
s += '" type="physicallocation-' + str(node.getNodeType())
if (location.getRackStartUnit() != None):
示例2: HenManager
# 需要导入模块: from henmanager import HenManager [as 别名]
# 或者: from henmanager.HenManager import getInfrastructures [as 别名]
#! /usr/bin/env python
from henmanager import HenManager
from auxiliary.hen import Node, SensorNode
manager = HenManager()
manager.initLogging()
infrastructures = manager.getInfrastructures("all")
for infrastructureType in infrastructures.keys():
for infrastructure in infrastructures[infrastructureType].values():
#print infrastructure.getID()
print str(infrastructure)