Re: D-bus create device, tutorials, resources

----- Original Message -----
From: "Thomas Haller" <thaller redhat com>
To: "Yegor Yefremov" <yegorslists googlemail com>
Cc: "Petr Horacek" <phoracek redhat com>, "networkmanager." <networkmanager-list gnome org>
Sent: Tuesday, March 3, 2015 12:03:43 PM
Subject: Re: D-bus create device, tutorials, resources

On Tue, 2015-03-03 at 10:28 +0100, Yegor Yefremov wrote:
On Tue, Mar 3, 2015 at 10:03 AM, Petr Horacek <phoracek redhat com> wrote:
Hello folks,

I'm new to NetworkManager, getting familiar with D-bus interface etc.
I'd like to create a high level Python interface for nm, but I have
with insufficient documentation resources (or my Google skills).

Is there any tutorial or D-bus code example for e.g. creating a bond
with defined IP? I've found plenty of 'list devices' but nothing like

What's wrong with this project ?
(Copying from another response:)
I know this lib, "problem" is, that you still have to handle NetworkManager with
some strings, dictionaries etc. I would like to do it more Pythonic way, like:

add_bond(name, slaves), or even better with some context managers and stuff.

See also,
which are examples for using Python to access the D-Bus interface directly.

then there is also
which uses libnm via gobject introspection. If you want something quick,
this might be better. If you want to implement the best possible python
NM library, you might don't want to use it.

Note that libnm will always be installed together with NetworkManager,
so the additional dependency is not that cumbersome.
But libnm was only introduced with nm-1-0, so if you want to support
older NM (too), you must use the now deprecated libnm-utils library.
The deprecated library libnm-utils also works with NM 1.0 and newer, but
it is... deprecated.

The D-Bus API for NM is quite stable, so if you are using D-Bus
directly, you should easily be able to support various version of

I didn't look at python-networkmanager, but that might be worth using
(and improving) instead of adding yet another wrapper.


I would love to use D-Bus API, but I don't know what strings should I use for for
example adding bond and stuff like that. Thanks for links, but I think, i read them all.

Improving python-networkmanager could be fine, but i would like to do more
higher interface, as I mentioned in response to Yegor. Something like
Python nmcli.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]