1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-02 04:21:59 +03:00

Implement new virNetworkGetDHCPLeases API

This API returns a list of DHCP leases for all network interfaces
connected to the given virtual network or limited output just for one
interface if mac is specified.

Example Output:
[{'iface': 'virbr3', 'ipaddr': '192.168.150.181', 'hostname': 'ubuntu14',
    'expirytime': 1403737495L, 'prefix': 24, 'clientid': None,
    'mac': '52:54:00:e8:73:eb', 'iaid': None, 'type': 0},
 {'iface': 'virbr3', 'ipaddr': '2001:db8:ca2:2:1::bd', 'hostname': 'fedora20-test',
    'expirytime': 1403738587L, 'prefix': 64, 'clientid': '00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd',
    'mac': '52:54:00:5b:40:98', 'iaid': '5980312', 'type': 1}]

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Nehal J Wani
2014-06-26 04:15:30 +05:30
committed by Peter Krempa
parent 724df7f11b
commit bdb64c7641
6 changed files with 159 additions and 0 deletions

View File

@ -78,6 +78,9 @@ for cname in wantfunctions:
if name[0:14] == "virTypedParams":
continue
if name[0:23] == "virNetworkDHCPLeaseFree":
continue
# These aren't functions, they're callback signatures
if name in ["virConnectAuthCallbackPtr", "virConnectCloseFunc",
"virStreamSinkFunc", "virStreamSourceFunc", "virStreamEventCallback",
@ -210,6 +213,9 @@ for name in sorted(basicklassmap):
if func[0:8] == "fSFreeze" or func[0:6] == "fSThaw":
func = "fs" + func[2:]
if klass == "virNetwork":
func = func.replace("dHCP", "DHCP")
# ...except when they don't. More stupid naming
# decisions we can't fix
if func == "iD":