Control the NetworkManager with Node.js
MIT License
Controll the NetworkManager with Node.js
This Dokumentation is based on the Dokumentation for the python-networkmanager.
NetworkManager provides a detailed and capable D-Bus interface on the system bus. You can use this interface to query NetworkManager about the overall state of the network and details of network devices like current IP addresses or DHCP options, and to activate and deactivate network connections.
node-networkmanager takes this D-Bus interface and wraps D-Bus interfaces in objects and D-Bus properties in getter and setter functions.
All the code is contained in one module: NetworkManager. Using it is very simple:
var networkmanager = require('networkmanager');
networkmanager.connect(function (error, networkmanager) {
networkmanager.NetworkManager.GetVersion(function(error, Version) {
console.log("NetworkManager Version: "+Version);
});
});
NetworkManager exposes a lot of information via D-Bus and also allows full control of network settings. The full D-Bus API can be found on NetworkManager project website. All interfaces listed there have been wrapped in objects as listed below. With a few exceptions, they behave exactly like the D-Bus methods. These exceptions are for convenience and limited to this list:
NetworkManager.Version
is wrapped to NetworkManager.GetVersion
TODO..