本文整理汇总了Python中pyvcloud.vcd.platform.Platform.update_external_network方法的典型用法代码示例。如果您正苦于以下问题:Python Platform.update_external_network方法的具体用法?Python Platform.update_external_network怎么用?Python Platform.update_external_network使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.platform.Platform
的用法示例。
在下文中一共展示了Platform.update_external_network方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0010_update
# 需要导入模块: from pyvcloud.vcd.platform import Platform [as 别名]
# 或者: from pyvcloud.vcd.platform.Platform import update_external_network [as 别名]
def test_0010_update(self):
"""Test the method Platform.update_external_network()
Update name and description of the external network created by setup.
Verifies name and description after update completes. Reset the name
and description to original.
This test passes if name and description are updated successfully.
"""
logger = Environment.get_default_logger()
platform = Platform(TestExtNet._sys_admin_client)
new_name = 'updated_' + TestExtNet._name
new_description = 'Updated ' + TestExtNet._description
ext_net = platform.update_external_network(TestExtNet._name, new_name,
new_description)
task = ext_net['{' + NSMAP['vcloud'] + '}Tasks'].Task[0]
TestExtNet._sys_admin_client.get_task_monitor().wait_for_success(
task=task)
logger.debug('Updated external network ' + TestExtNet._name + '.')
ext_net = platform.get_external_network(new_name)
self.assertIsNotNone(ext_net)
self.assertEqual(new_description,
ext_net['{' + NSMAP['vcloud'] + '}Description'].text)
# Reset the name and description to original
ext_net = platform.update_external_network(new_name, self._name,
self._description)
task = ext_net['{' + NSMAP['vcloud'] + '}Tasks'].Task[0]
TestExtNet._sys_admin_client.get_task_monitor().wait_for_success(
task=task)