本文整理汇总了Python中pyvcloud.vcd.gateway.Gateway.edit_config_ip_settings方法的典型用法代码示例。如果您正苦于以下问题:Python Gateway.edit_config_ip_settings方法的具体用法?Python Gateway.edit_config_ip_settings怎么用?Python Gateway.edit_config_ip_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.gateway.Gateway
的用法示例。
在下文中一共展示了Gateway.edit_config_ip_settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0035_edit_config_ipaddress
# 需要导入模块: from pyvcloud.vcd.gateway import Gateway [as 别名]
# 或者: from pyvcloud.vcd.gateway.Gateway import edit_config_ip_settings [as 别名]
def test_0035_edit_config_ipaddress(self):
"""It edits the config ip settings of gateway.
In this user can only modify Subnet participation and config Ip address
of gateway's external network.
Invokes the edit_config_ip_settings of the gateway.
"""
gateway_obj = Gateway(TestGateway._client, self._name,
TestGateway._gateway.get('href'))
ip_allocations = gateway_obj.list_configure_ip_settings()
ip_allocation = ip_allocations[0]
ipconfig = dict()
subnet_participation = dict()
subnet = dict()
subnet_participation['enable'] = True
subnet_participation['ip_address'] = ip_allocation.get('ip_address')[0]
subnet[ip_allocation.get('gateway')[0]] = subnet_participation
ipconfig[ip_allocation.get('external_network')] = subnet
task = gateway_obj.edit_config_ip_settings(ipconfig)
result = TestGateway._client.get_task_monitor().wait_for_success(
task=task)
self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)