hosts_service = connection.system_service().hosts_service()
host = hosts_service.list(search='name=ovirt-node-ng-image-20190129-1')[0]
host_service = hosts_service.host_service(
host.id)
host_service.setup_networks(
modified_network_attachments=[
types.NetworkAttachment(
network=types.Network(
name='ovirtmgmt',
),
host_nic=types.HostNic(
name='eth0',
),
ip_address_assignments=[
types.IpAddressAssignment(
assignment_method=types.BootProtocol.STATIC,
ip=types.Ip(
address='192.168.122.22',
netmask='255.255.255.0',
gateway='192.168.122.1'
),
),
],
),
]
)