本文整理汇总了Python中pyvcloud.vcd.vapp.VApp.create_vapp_network方法的典型用法代码示例。如果您正苦于以下问题:Python VApp.create_vapp_network方法的具体用法?Python VApp.create_vapp_network怎么用?Python VApp.create_vapp_network使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.vapp.VApp
的用法示例。
在下文中一共展示了VApp.create_vapp_network方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_test_vapp_with_network
# 需要导入模块: from pyvcloud.vcd.vapp import VApp [as 别名]
# 或者: from pyvcloud.vcd.vapp.VApp import create_vapp_network [as 别名]
def get_test_vapp_with_network(cls, client):
"""Gets the vapp for testing in current vDC.
:param pyvcloud.vcd.client.Client client: client which will be used to
create the VDC object.
:return: the vdc that is backing the organization in which all tests
will run.
:rtype: pyvcloud.vcd.vdc.VDC
"""
if not cls._vapp_href:
vdc = Environment.get_test_vdc(client)
try:
vapp = vdc.get_vapp(VAppConstants.name)
cls._vapp_href = vapp.get('href')
except EntityNotFoundException:
cls._vapp_href = create_vapp_from_template(
client,
vdc,
VAppConstants.name,
cls._config['vcd']['default_catalog_name'],
cls._config['vcd']['default_template_file_name'],
power_on=False,
deploy=False)
vapp = VApp(client, href=cls._vapp_href)
task = vapp.create_vapp_network(
VAppConstants.network1_name,
VAppConstants.network1_cidr,
ip_ranges=VAppConstants.network1_ip_ranges)
client.get_task_monitor().wait_for_success(task=task)
return VApp(client, href=cls._vapp_href)