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


Python ExperimentController.get_attribute方法代码示例

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


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

示例1:

# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import get_attribute [as 别名]
ec.set(node1, "minBandwidth", minBandwidth)
ec.set(node1, "username", slicename)
ec.set(node1, "pluser", pl_user)
ec.set(node1, "plpassword", pl_password)
ec.set(node1, "cleanHome", True)
ec.set(node1, "cleanProcesses", True)

node2 = ec.register_resource("PlanetlabNode")
ec.set(node2, "country", "Spain")
ec.set(node2, "username", slicename)
ec.set(node2, "pluser", pl_user)
ec.set(node2, "plpassword", pl_password)
ec.set(node2, "cleanHome", True)
ec.set(node2, "cleanProcesses", True)

remote_hostname = ec.get_attribute(node1, "hostname")
destination = "%[email protected]%s" % (slicename, remote_hostname)

app1 = ec.register_resource("LinuxApplication")
file = "../big_file.geo"
ec.set(app1, "sources", file)
command = "scp $SRC/big_file.geo %s" % destination 
ec.set(app1, "command", command)
ec.register_connection(app1, node1)

app2 = ec.register_resource("LinuxApplication")
ec.set(app, "sudo", sudo)
ec.set(app, "depends", "ifstat")
command = "ifstat -b eth0 > ifstat.txt"
command = "iperf ..." 
ec.set(app2, "command", command)
开发者ID:ruben11291,项目名称:master-thesis,代码行数:33,代码来源:geo_cloud.py


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