本文整理汇总了Python中pyvcloud.vcd.gateway.Gateway.add_dhcp_binding方法的典型用法代码示例。如果您正苦于以下问题:Python Gateway.add_dhcp_binding方法的具体用法?Python Gateway.add_dhcp_binding怎么用?Python Gateway.add_dhcp_binding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.gateway.Gateway
的用法示例。
在下文中一共展示了Gateway.add_dhcp_binding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0105_add_dhcp_binding
# 需要导入模块: from pyvcloud.vcd.gateway import Gateway [as 别名]
# 或者: from pyvcloud.vcd.gateway.Gateway import add_dhcp_binding [as 别名]
def test_0105_add_dhcp_binding(self):
"""Add DHCP Binding in the gateway.
Invokes the add_dhcp_binding of the gateway.
"""
gateway_obj = Gateway(
TestGateway._client, self._name,
Environment.get_test_gateway(Environment.get_sys_admin_client())
.get('href'))
gateway_obj.add_dhcp_binding(TestGateway._mac_address,
TestGateway._host_name,
TestGateway._binding_ip_address)
dhcp_resource = gateway_obj.get_dhcp()
# Verify
matchFound = False
for static_binding in dhcp_resource.staticBindings.staticBinding:
if static_binding.macAddress.text == TestGateway._mac_address:
matchFound = True
break
self.assertTrue(matchFound)