NM.Client¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r/w |
|||
r |
|||
r/w/co |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r/w/c |
|||
r |
|||
r/w |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r/w |
|
||
r |
|
||
r/w |
|||
r |
|||
r/w |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a |
|
Notifies that a permission has changed |
Fields¶
- Inherited:
Class Details¶
- class NM.Client(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
NM.Client
contains a cache of the objects of NetworkManager’s D-Bus API. It usesGLib.MainContext
andGio.DBusConnection
for that and registers to D-Bus signals. That means, when iterating the associatedGLib.MainContext
, D-Bus signals gets processed and theNM.Client
instance updates and emitsGObject.Object
signals.- classmethod new(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
- Return type:
Creates a new
NM.Client
synchronously.Note that this will block until a
NM.Client
instance is fully initialized. This does nothing beside calling g_initable_new(). You are free to call g_initable_new() or g_object_new()/Gio.Initable.init
() directly for more control, to setGObject.Object
properties or get access to theNM.Client
instance while it is still initializing.Using the synchronous initialization creates an
NM.Client
instance that uses an internalGLib.MainContext
. This context is invisible to the user. This introduces an additional overhead that is payed not only during object initialization, but for the entire lifetime of this object. Also, due to this internalGLib.MainContext
, the events are no longer in sync with other messages fromGio.DBusConnection
(but all events of theNM.Client
will themselves still be ordered). For a serious program, you should therefore avoid these problems by usingGio.AsyncInitable.init_async
() orNM.Client.new_async
() instead. The sync initialization is still useful for simple scripts or interactive testing for example via pygobject.Creating an
NM.Client
instance can only fail for two reasons. First, if you didn’t provide aNM.CLIENT_DBUS_CONNECTION
and the call toGio.bus_get
() fails. You can avoid that by using g_initable_new() directly and set a D-Bus connection. Second, if you cancelled the creation. If you do that, then note that after the failure there might still be idle actions pending which keepNM.Client.get_main_context
() alive. That means, in that case you must continue iterating the context to avoid leaks. SeeNM.Client.get_context_busy_watcher
().Creating an
NM.Client
instance when NetworkManager is not running does not cause a failure.
- classmethod new_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call when the client is created
Creates a new
NM.Client
asynchronously. callback will be called when it is done. UseNM.Client.new_finish
() to get the result.This does nothing beside calling g_async_initable_new_async(). You are free to call g_async_initable_new_async() or g_object_new()/
Gio.AsyncInitable.init_async
() directly for more control, to setGObject.Object
properties or get access to theNM.Client
instance while it is still initializing.Creating an
NM.Client
instance can only fail for two reasons. First, if you didn’t provide aNM.CLIENT_DBUS_CONNECTION
and the call toGio.bus_get
() fails. You can avoid that by using g_async_initable_new_async() directly and set a D-Bus connection. Second, if you cancelled the creation. If you do that, then note that after the failure there might still be idle actions pending which keepNM.Client.get_main_context
() alive. That means, in that case you must continue iterating the context to avoid leaks. SeeNM.Client.get_context_busy_watcher
().Creating an
NM.Client
instance when NetworkManager is not running does not cause a failure.
- classmethod new_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
Gets the result of an
NM.Client.new_async
() call.
- classmethod wait_shutdown_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toNM.Client.wait_shutdown
()- Raises:
- Returns:
True
if waiting is complete successfully. In that case, all resources of the nmclient are wrapped up and released. This can only fail by user cancellation.- Return type:
New in version 1.42.
- activate_connection_async(connection, device, specific_object, cancellable, callback, *user_data)¶
- Parameters:
connection (
NM.Connection
orNone
) – anNM.Connection
specific_object (
str
orNone
) – the object path of a connection-type-specific object this activation should use. This parameter is currently ignored for wired and mobile broadband connections, and the value ofNone
should be used (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object path of aNM.AccessPoint
orNM.WimaxNsp
owned by device, which you can get usingNM.Object.get_path
(), and which will be used to complete the details of the newly added connection.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the activation has starteduser_data (
object
orNone
) – caller-specific data passed to callback
Asynchronously starts a connection to a particular network using the configuration settings from connection and the network device device. Certain connection types also take a “specific object” which is the object path of a connection- specific object, like an
NM.AccessPoint
for Wi-Fi connections, or anNM.WimaxNsp
for WiMAX connections, to which you wish to connect. If the specific object is not given, NetworkManager can, in some cases, automatically determine which network to connect to given the settings in connection.If connection is not given for a device-based activation, NetworkManager picks the best available connection for the device and activates it.
Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can use the returned
NM.ActiveConnection
object (in particular,NM.ActiveConnection
:state
) to track the activation to its completion.
- activate_connection_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the new
NM.ActiveConnection
on success,None
on failure, in which case error will be set.- Return type:
Gets the result of a call to
NM.Client.activate_connection_async
().
- add_and_activate_connection2(partial, device, specific_object, options, cancellable, callback, *user_data)¶
- Parameters:
partial (
NM.Connection
orNone
) – anNM.Connection
to add; the connection may be partially filled (or evenNone
) and will be completed by NetworkManager using the given device and specific_object before being addedspecific_object (
str
orNone
) – the object path of a connection-type-specific object this activation should use. This parameter is currently ignored for wired and mobile broadband connections, and the value ofNone
should be used (i.e., no specific object). For Wi-Fi or WiMAX connections, pass the object path of aNM.AccessPoint
orNM.WimaxNsp
owned by device, which you can get usingNM.Object.get_path
(), and which will be used to complete the details of the newly added connection.options (
GLib.Variant
) – aGLib.Variant
containing a dictionary with options, orNone
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the activation has starteduser_data (
object
orNone
) – caller-specific data passed to callback
Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object. The new connection is then asynchronously activated as with
NM.Client.activate_connection_async
(). Cannot be used for VPN connections at this time.Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can used the returned
NM.ActiveConnection
object (in particular,NM.ActiveConnection
:state
) to track the activation to its completion.This is identical to
NM.Client.add_and_activate_connection_async
() but takes a further options parameter. Currently, the following options are supported by the daemon:“persist”: A string describing how the connection should be stored. The default is “disk”, but it can be modified to “memory” (until the daemon quits) or “volatile” (will be deleted on disconnect).
“bind-activation”: Bind the connection lifetime to something. The default is “none”, meaning an explicit disconnect is needed. The value “dbus-client” means the connection will automatically be deactivated when the calling D-Bus client disappears from the system bus.
New in version 1.16.
- add_and_activate_connection2_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the new
NM.ActiveConnection
on success,None
on failure, in which case error will be set.- out_result:
the output result of type “a{sv}” returned by D-Bus’ AddAndActivate2 call. Currently, no output is implemented yet.
- Return type:
(
NM.ActiveConnection
, out_result:GLib.Variant
orNone
)
Gets the result of a call to
NM.Client.add_and_activate_connection2
().You can call
NM.ActiveConnection.get_connection
() on the returnedNM.ActiveConnection
to find the path of the createdNM.Connection
.New in version 1.16.
- add_and_activate_connection_async(partial, device, specific_object, cancellable, callback, *user_data)¶
- Parameters:
partial (
NM.Connection
orNone
) – anNM.Connection
to add; the connection may be partially filled (or evenNone
) and will be completed by NetworkManager using the given device and specific_object before being addedspecific_object (
str
orNone
) – the object path of a connection-type-specific object this activation should use. This parameter is currently ignored for wired and mobile broadband connections, and the value ofNone
should be used (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object path of aNM.AccessPoint
orNM.WimaxNsp
owned by device, which you can get usingNM.Object.get_path
(), and which will be used to complete the details of the newly added connection. If the variant is floating, it will be consumed.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the activation has starteduser_data (
object
orNone
) – caller-specific data passed to callback
Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object. The new connection is then asynchronously activated as with
NM.Client.activate_connection_async
(). Cannot be used for VPN connections at this time.Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can used the returned
NM.ActiveConnection
object (in particular,NM.ActiveConnection
:state
) to track the activation to its completion.
- add_and_activate_connection_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the new
NM.ActiveConnection
on success,None
on failure, in which case error will be set.- Return type:
Gets the result of a call to
NM.Client.add_and_activate_connection_async
().You can call
NM.ActiveConnection.get_connection
() on the returnedNM.ActiveConnection
to find the path of the createdNM.Connection
.
- add_connection2(settings, flags, args, ignore_out_result, cancellable, callback, *user_data)¶
- Parameters:
settings (
GLib.Variant
) – the “a{sa{sv}}”GLib.Variant
with the content of the setting.flags (
NM.SettingsAddConnection2Flags
) – theNM.SettingsAddConnection2Flags
argument.args (
GLib.Variant
orNone
) – the “a{sv}”GLib.Variant
with extra argument orNone
for no extra arguments.ignore_out_result (
bool
) – this function wraps AddConnection2(), which has an additional result “a{sv}” output parameter. By setting this toTrue
, you signal that you are not interested in that output parameter. This allows the function to fall back to AddConnection() and AddConnectionUnsaved(), which is interesting if you run against an older server version that does not yet provide AddConnection2(). By setting this toFalse
, the function under the hood always calls AddConnection2().cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Call AddConnection2() D-Bus API asynchronously.
New in version 1.20.
- add_connection2_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – theGio.AsyncResult
- Raises:
- Returns:
on success, a pointer to the added
NM.RemoteConnection
.- out_result:
the output
GLib.Variant
from AddConnection2(). If you care about the output result, then the “ignore_out_result” parameter ofNM.Client.add_connection2
() must not be set toTrue
.
- Return type:
(
NM.RemoteConnection
, out_result:GLib.Variant
orNone
)
New in version 1.20.
- add_connection_async(connection, save_to_disk, cancellable, callback, *user_data)¶
- Parameters:
connection (
NM.Connection
) – the connection to add. Note that this object’s settings will be added, not the object itselfsave_to_disk (
bool
) – whether to immediately save the connection to diskcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Requests that the remote settings service add the given settings to a new connection. If save_to_disk is
True
, the connection is immediately written to disk; otherwise it is initially only stored in memory, but may be saved later by calling the connection’sNM.RemoteConnection.commit_changes
() method.connection is untouched by this function and only serves as a template of the settings to add. The
NM.RemoteConnection
object that represents what NetworkManager actually added is returned to callback when the addition operation is complete.Note that the
NM.RemoteConnection
returned in callback may not contain identical settings to connection as NetworkManager may perform automatic completion and/or normalization of connection properties.
- add_connection_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the new
NM.RemoteConnection
on success,None
on failure, in which case error will be set.- Return type:
Gets the result of a call to
NM.Client.add_connection_async
().
- check_connectivity(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
- Raises:
- Returns:
the (new) current connectivity state
- Return type:
Updates the network connectivity state and returns the (new) current state. Contrast
NM.Client.get_connectivity
(), which returns the most recent known state without re-checking.This is a blocking call; use
NM.Client.check_connectivity_async
() if you do not want to block.Deprecated since version 1.22: Use
NM.Client.check_connectivity_async
() orGio.DBusConnection
.
- check_connectivity_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call with the result
Asynchronously updates the network connectivity state and invokes callback when complete. Contrast
NM.Client.get_connectivity
(), which (immediately) returns the most recent known state without re-checking, andNM.Client.check_connectivity
(), which blocks.
- check_connectivity_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – theGio.AsyncResult
- Raises:
- Returns:
the (new) current connectivity state
- Return type:
Retrieves the result of an
NM.Client.check_connectivity_async
() call.
- checkpoint_adjust_rollback_timeout(checkpoint_path, add_timeout, cancellable, callback, *user_data)¶
- Parameters:
checkpoint_path (
str
) – a D-Bus path to a checkpointadd_timeout (
int
) – the timeout in seconds counting from now. Set to zero, to disable the timeout.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Resets the timeout for the checkpoint with path checkpoint_path to timeout_add.
New in version 1.12.
- checkpoint_adjust_rollback_timeout_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
- Return type:
Gets the result of a call to
NM.Client.checkpoint_adjust_rollback_timeout
().New in version 1.12.
- checkpoint_create(devices, rollback_timeout, flags, cancellable, callback, *user_data)¶
- Parameters:
devices ([
NM.Device
]) – a list of devices for which a checkpoint should be created.rollback_timeout (
int
) – the rollback timeout in secondsflags (
NM.CheckpointCreateFlags
) – creation flagscancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Creates a checkpoint of the current networking configuration for given interfaces. An empty devices argument means all devices. If rollback_timeout is not zero, a rollback is automatically performed after the given timeout.
New in version 1.12.
- checkpoint_create_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the new
NM.Checkpoint
on success,None
on failure, in which case error will be set.- Return type:
Gets the result of a call to
NM.Client.checkpoint_create
().New in version 1.12.
- checkpoint_destroy(checkpoint_path, cancellable, callback, *user_data)¶
- Parameters:
checkpoint_path (
str
) – the D-Bus path for the checkpointcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Destroys an existing checkpoint without performing a rollback.
New in version 1.12.
- checkpoint_destroy_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
on success orFalse
on failure, in which case error will be set.- Return type:
Gets the result of a call to
NM.Client.checkpoint_destroy
().New in version 1.12.
- checkpoint_rollback(checkpoint_path, cancellable, callback, *user_data)¶
- Parameters:
checkpoint_path (
str
) – the D-Bus path to the checkpointcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Performs the rollback of a checkpoint before the timeout is reached.
New in version 1.12.
- checkpoint_rollback_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
an hash table of devices and results. Devices are represented by their original D-Bus path; each result is a
NM.RollbackResult
.- Return type:
Gets the result of a call to
NM.Client.checkpoint_rollback
().New in version 1.12.
- connectivity_check_get_available()¶
-
Determine whether connectivity checking is available. This requires that the URI of a connectivity service has been set in the configuration file.
New in version 1.10.
- connectivity_check_get_enabled()¶
-
Determine whether connectivity checking is enabled.
New in version 1.10.
- connectivity_check_get_uri()¶
- Returns:
the connectivity URI in use
- Return type:
Get the URI that will be queried to determine if there is internet connectivity.
New in version 1.20.
- connectivity_check_set_enabled(enabled)¶
-
Enable or disable connectivity checking. Note that if a connectivity checking URI has not been configured, this will not have any effect.
New in version 1.10.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_set_property
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to set “ConnectivityCheckEnabled” property to a “(b)” value.
- dbus_call(object_path, interface_name, method_name, parameters, reply_type, timeout_msec, cancellable, callback, *user_data)¶
- Parameters:
object_path (
str
) – path of remote objectinterface_name (
str
) – D-Bus interface to invoke method onmethod_name (
str
) – the name of the method to invokeparameters (
GLib.Variant
orNone
) – aGLib.Variant
tuple with parameters for the method orNone
if not passing parametersreply_type (
GLib.VariantType
orNone
) – the expected type of the reply (which will be a tuple), orNone
timeout_msec (
int
) – the timeout in milliseconds, -1 to use the default timeout orGObject.G_MAXINT
for no timeoutcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied orNone
if you don’t care about the result of the method invocation
Call
Gio.DBusConnection.call
() on the current name owner with the specified arguments. Most importantly, this invokesGio.DBusConnection.call
() with the client’sGLib.MainContext
, so that the response is always in order with other events D-Bus events. Of course, the call usesGio.Task
and will invoke the callback on the currentGLib.MainContext.get_thread_default
().This API is merely a convenient wrapper for
Gio.DBusConnection.call
(). You can also useGio.DBusConnection.call
() directly, with the same effect.New in version 1.24.
- dbus_call_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
the result
GLib.Variant
orNone
on error.- Return type:
Gets the result of a call to
NM.Client.dbus_call
().New in version 1.24.
- dbus_set_property(object_path, interface_name, property_name, value, timeout_msec, cancellable, callback, *user_data)¶
- Parameters:
object_path (
str
) – path of remote objectinterface_name (
str
) – D-Bus interface for the property to set.property_name (
str
) – the name of the property to setvalue (
GLib.Variant
) – aGLib.Variant
with the value to set.timeout_msec (
int
) – the timeout in milliseconds, -1 to use the default timeout orGObject.G_MAXINT
for no timeoutcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied orNone
if you don’t care about the result of the method invocation
Like
NM.Client.dbus_call
() but calls “Set” on the standard “org.freedesktop.DBus.Properties” D-Bus interface.New in version 1.24.
- dbus_set_property_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
- Return type:
Gets the result of a call to
NM.Client.dbus_set_property
().New in version 1.24.
- deactivate_connection(active, cancellable)¶
- Parameters:
active (
NM.ActiveConnection
) – theNM.ActiveConnection
to deactivatecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
success or failure
- Return type:
Deactivates an active
NM.ActiveConnection
.Deprecated since version 1.22: Use
NM.Client.deactivate_connection_async
() orGio.DBusConnection
.
- deactivate_connection_async(active, cancellable, callback, *user_data)¶
- Parameters:
active (
NM.ActiveConnection
) – theNM.ActiveConnection
to deactivatecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the deactivation has completeduser_data (
object
orNone
) – caller-specific data passed to callback
Asynchronously deactivates an active
NM.ActiveConnection
.
- deactivate_connection_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
success or failure
- Return type:
Gets the result of a call to
NM.Client.deactivate_connection_async
().
- get_activating_connection()¶
- Returns:
the appropriate
NM.ActiveConnection
, if any.- Return type:
Gets the
NM.ActiveConnection
corresponding to a currently-activating connection that is expected to become the newNM.Client
:primary-connection
upon successful activation.
- get_active_connections()¶
- Returns:
a
GLib.PtrArray
containing all the activeNM.ActiveConnections
. The returned array is owned by the client and should not be modified.- Return type:
Gets the active connections.
- get_all_devices()¶
- Returns:
a
GLib.PtrArray
containing all theNM.Devices
. The returned array is owned by theNM.Client
object and should not be modified.- Return type:
Gets both real devices and device placeholders (eg, software devices which do not currently exist, but could be created automatically by NetworkManager if one of their
NM.Device
::ActivatableConnections
was activated). UseNM.Device.is_real
() to determine whether each device is a real device or a placeholder.Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine what kind of device each member of the returned array is, and then you may use device-specific methods such as nm_device_ethernet_get_hw_address().
New in version 1.2.
- get_capabilities()¶
- Returns:
the list of capabilities reported by the server or
None
if the capabilities are unknown. The numeric values correspond toNM.Capability
enum. The array is terminated by a numeric zero sentinel at position length.- Return type:
[
int
]
New in version 1.24.
- get_checkpoints()¶
- Returns:
a
GLib.PtrArray
containing all theNM.Checkpoint
. The returned array is owned by theNM.Client
object and should not be modified.- Return type:
Gets all the active checkpoints.
New in version 1.12.
- get_connection_by_id(id)¶
- Parameters:
id (
str
) – the id of the remote connection- Returns:
the remote connection object on success, or
None
if no matching object was found.The connection is as received from D-Bus and might not validate according to
NM.Connection.verify
().- Return type:
Returns the first matching
NM.RemoteConnection
matching a given id.
- get_connection_by_path(path)¶
- Parameters:
path (
str
) – the D-Bus object path of the remote connection- Returns:
the remote connection object on success, or
None
if the object was not knownThe connection is as received from D-Bus and might not validate according to
NM.Connection.verify
().- Return type:
Returns the
NM.RemoteConnection
representing the connection at path.
- get_connection_by_uuid(uuid)¶
- Parameters:
uuid (
str
) – the UUID of the remote connection- Returns:
the remote connection object on success, or
None
if the object was not knownThe connection is as received from D-Bus and might not validate according to
NM.Connection.verify
().- Return type:
Returns the
NM.RemoteConnection
identified by uuid.
- get_connections()¶
- Returns:
an array containing all connections provided by the remote settings service. The returned array is owned by the
NM.Client
object and should not be modified.The connections are as received from D-Bus and might not validate according to
NM.Connection.verify
().- Return type:
- get_connectivity()¶
- Returns:
the current connectivity state
- Return type:
Gets the current network connectivity state. Contrast
NM.Client.check_connectivity
() andNM.Client.check_connectivity_async
(), which re-check the connectivity state first before returning any information.
- get_context_busy_watcher()¶
- Returns:
a
GObject.Object
that stays alive as long as there are pending D-Bus operations.NM.Client
will schedule asynchronous D-Bus requests which will complete on theGLib.MainContext
associated with the instance. When destroying theNM.Client
instance, those requests are cancelled right away, however their pending requests are still outstanding and queued in theGLib.MainContext
. These outstanding callbacks keep theGLib.MainContext
alive. In order to fully release all resources, the user must keep iterating the main context until all these callbacks are handled. Of course, at this point no more actual callbacks will be invoked for the user, those are all cancelled internally.This just leaves one problem: how long does the user need to keep the
GLib.MainContext
running to ensure everything is cleaned up? The answer is thisGObject.Object
. Subscribe a weak reference to the returned object and keep iterating the main context until the object got unreferenced.Note that after the
NM.Client
instance gets destroyed, all outstanding operations will be cancelled right away. That means, the user needs to iterate theGLib.MainContext
a bit longer, but it is guaranteed that the cleanup happens soon after.The way of using the context-busy-watch, is by registering a weak pointer to see when it gets destroyed. That means, user code should not take additional references on this object to not keep it alive longer.
If you plan to exit the program after releasing the
NM.Client
instance you may not need to worry about these “leaks”. Also, if you anyway plan to continue iterating theGLib.MainContext
afterwards, then you don’t need to care when exactlyNM.Client
is gone completely.- Return type:
New in version 1.22.
- get_dbus_connection()¶
- Returns:
the D-Bus connection of the client, or
None
if none is set.- Return type:
Gets the
Gio.DBusConnection
of the instance. This can be either passed when constructing the instance (as “dbus-connection” property), or it will be automatically initialized during async/sync init.New in version 1.22.
- get_dbus_name_owner()¶
- Returns:
the current name owner of the D-Bus service of NetworkManager.
- Return type:
New in version 1.22.
- get_device_by_iface(iface)¶
- Parameters:
iface (
str
) – the interface name to search for- Returns:
- Return type:
- get_device_by_path(object_path)¶
- get_devices()¶
- Returns:
a
GLib.PtrArray
containing all theNM.Devices
. The returned array is owned by theNM.Client
object and should not be modified.- Return type:
Gets all the known network devices. Use nm_device_get_type() or the
NM_IS_DEVICE_XXXX
functions to determine what kind of device member of the returned array is, and then you may use device-specific methods such as nm_device_ethernet_get_hw_address().
- get_dns_configuration()¶
- Returns:
a
GLib.PtrArray
containingNM.DnsEntry
elements orNone
in case the value is not available. The returned array is owned by theNM.Client
object and should not be modified.- Return type:
Gets the current DNS configuration
New in version 1.6.
- get_dns_mode()¶
-
Gets the current DNS processing mode.
New in version 1.6.
- get_dns_rc_manager()¶
-
Gets the current DNS resolv.conf manager.
New in version 1.6.
- get_instance_flags()¶
- Returns:
the
NM.ClientInstanceFlags
flags.- Return type:
New in version 1.24.
- get_logging()¶
- Raises:
- Returns:
True
on success,False
otherwise- level:
return location for logging level string
- domains:
return location for log domains string. The string is a list of domains separated by “,”
- Return type:
Gets NetworkManager current logging level and domains.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_call
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to call “GetLogging” with no arguments to get “(ss)” for level and domains.
- get_main_context()¶
- Returns:
the
GLib.MainContext
of the client.- Return type:
The
NM.Client
instance is permanently associated with the current thread defaultGLib.MainContext
, referenced the time when the instance was created. To receive events, the user must iterate this context and can use it to synchronize access to the client.Note that even after
NM.Client
instance got destroyed, there might still be pending sources registered in the context. That means, to fully clean up, the user must continue iterating the context as long as theNM.Client.get_context_busy_watcher
() object is alive.New in version 1.22.
- get_metered()¶
- Returns:
whether the default route is metered.
- Return type:
New in version 1.22.
- get_nm_running()¶
-
Determines whether the daemon is running.
- get_object_by_path(dbus_path)¶
- Parameters:
dbus_path (
str
) – the D-Bus path of the object to look up- Returns:
the
NM.Object
instance that is cached under dbus_path, orNone
if no such object exists.- Return type:
New in version 1.24.
- get_permission_result(permission)¶
- Parameters:
permission (
NM.ClientPermission
) – the permission for which to return the result, one ofNM.ClientPermission
- Returns:
the permission’s result, one of
NM.ClientPermissionResult
- Return type:
Requests the result of a specific permission, which indicates whether the client can or cannot perform the action the permission represents
- get_permissions_state()¶
- Returns:
the state of the cached permissions.
NM.Ternary.DEFAULT
means that no permissions result was yet received. All permissions are unknown.NM.Ternary.TRUE
means that the permissions got received and are cached. %:obj:NM.Ternary.FALSE means that permissions are cached, but they are invalided as “CheckPermissions” signal was received in the meantime.- Return type:
New in version 1.24.
- get_primary_connection()¶
- Returns:
the appropriate
NM.ActiveConnection
, if any- Return type:
Gets the
NM.ActiveConnection
corresponding to the primary active network device.In particular, when there is no VPN active, or the VPN does not have the default route, this returns the active connection that has the default route. If there is a VPN active with the default route, then this function returns the active connection that contains the route to the VPN endpoint.
If there is no default route, or the default route is over a non-NetworkManager-recognized device, this will return
None
.
- get_radio_flags()¶
- Returns:
the
NM.RadioFlags
.- Return type:
Get radio flags.
New in version 1.38.
- get_startup()¶
- Returns:
whether the daemon is still starting up
- Return type:
Tests whether the daemon is still in the process of activating connections at startup.
- get_version()¶
-
Gets NetworkManager version.
- get_version_info()¶
- Returns:
the list of capabilities reported by the server or
None
if the capabilities are unknown.- Return type:
[
int
]
If available, the first element in the array is NM_VERSION which encodes the daemon version as “(major << 16 | minor << 8 | micro)”. The following elements are a bitfield of %NMVersionInfoCapabilities that indicate that the daemon supports a certain capability.
New in version 1.42.
- load_connections(filenames, cancellable)¶
- Parameters:
filenames ([
str
]) –None
-terminated array of filenames to loadcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
on success.Warning: before libnm 1.22, the boolean return value was inconsistent. That is made worse, because when running against certain server versions before 1.20, the server would return wrong values for success/failure. This means, if you use this function in libnm before 1.22, you are advised to ignore the boolean return value and only look at failures and error. With libnm >= 1.22, the boolean return value corresponds to whether error was set. Note that even in the success case, you might have individual failures. With 1.22, the return value is consistent with
NM.Client.load_connections_finish
().- failures:
on return, a
None
-terminated array of filenames that failed to load
- Return type:
Requests that the remote settings service load or reload the given files, adding or updating the connections described within.
The changes to the indicated files will not yet be reflected in self's connections array when the function returns.
If all of the indicated files were successfully loaded, the function will return
True
, and failures will be set toNone
. If NetworkManager tried to load the files, but some (or all) failed, then failures will be set to aNone
-terminated array of the filenames that failed to load.Deprecated since version 1.22: Use
NM.Client.load_connections_async
() orGio.DBusConnection
.
- load_connections_async(filenames, cancellable, callback, *user_data)¶
- Parameters:
filenames ([
str
]) –None
-terminated array of filenames to loadcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Requests that the remote settings service asynchronously load or reload the given files, adding or updating the connections described within.
See
NM.Client.load_connections
() for more details.
- load_connections_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
on success. Note that even in the success case, you might have individual failures.- failures:
on return, a
None
-terminated array of filenames that failed to load
- Return type:
Gets the result of an
NM.Client.load_connections_async
() call.See
NM.Client.load_connections
() for more details.
- networking_get_enabled()¶
-
Whether networking is enabled or disabled.
- networking_set_enabled(enabled)¶
- Parameters:
enabled (
bool
) –True
to set networking enabled,False
to set networking disabled- Raises:
- Returns:
- Return type:
Enables or disables networking. When networking is disabled, all controlled interfaces are disconnected and deactivated. When networking is enabled, all controlled interfaces are available for activation.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_call
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to call “Enable” with “(b)” arguments and no return value.
- reload(flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
NM.ManagerReloadFlags
) – flags indicating what to reload.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the add operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Reload NetworkManager’s configuration and perform certain updates, like flushing caches or rewriting external state to disk. This is similar to sending SIGHUP to NetworkManager but it allows for more fine-grained control over what to reload (see flags). It also allows non-root access via PolicyKit and contrary to signals it is synchronous.
New in version 1.22.
- reload_connections(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
- Return type:
Requests that the remote settings service reload all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
Deprecated since version 1.22: Use
NM.Client.reload_connections_async
() orGio.DBusConnection
.
- reload_connections_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the reload operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Requests that the remote settings service begin reloading all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
- reload_connections_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
- Return type:
Gets the result of an
NM.Client.reload_connections_async
() call.
- reload_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
- Return type:
Gets the result of a call to
NM.Client.reload
().New in version 1.22.
- save_hostname(hostname, cancellable)¶
- Parameters:
hostname (
str
orNone
) – the new persistent hostname to set, orNone
to clear any existing persistent hostnamecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
- Return type:
Requests that the machine’s persistent hostname be set to the specified value or cleared.
Deprecated since version 1.22: Use
NM.Client.save_hostname_async
() orGio.DBusConnection
.
- save_hostname_async(hostname, cancellable, callback, *user_data)¶
- Parameters:
hostname (
str
orNone
) – the new persistent hostname to set, orNone
to clear any existing persistent hostnamecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Requests that the machine’s persistent hostname be set to the specified value or cleared.
- save_hostname_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
- Return type:
Gets the result of an
NM.Client.save_hostname_async
() call.
- set_logging(level, domains)¶
- Parameters:
- Raises:
- Returns:
- Return type:
Sets NetworkManager logging level and/or domains.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_call
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to call “SetLogging” with “(ss)” arguments for level and domains.
- wait_shutdown(integrate_maincontext, cancellable, callback, *user_data)¶
- Parameters:
integrate_maincontext (
bool
) – whether to hook the client’s maincontext in the current thread default. Otherwise, you must ensure that the client’s maincontext gets iterated so that it can complete. By integrating the maincontext in the current thread default, you may instead only iterate the latter.cancellable (
Gio.Cancellable
orNone
) – theGio.Cancellable
to abort the shutdown.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied orNone
if you don’t care about the result of the method invocation.
The way to stop
NM.Client
is by unrefing it. That will cancel all internally pending async operations. However, as async operations inNM.Client
useGio.Task
, hence they cannot complete right away. Instead, their (internal) result callback still needs to be dispatched by iterating the client’s main context.You thus cannot stop iterating the client’s main context until everything is wrapped up.
NM.Client.get_context_busy_watcher
() helps to watch how long that will be.This function automates that waiting. Like all glib async operations this honors the current
GLib.MainContext.get_thread_default
().In any case, to complete the shutdown,
NM.Client.get_main_context
() must be iterated. If the currentGLib.MainContext.get_thread_default
() is the same asNM.Client.get_main_context
(), then integrate_maincontext is ignored. In that case, the caller is required to iterate the context for shutdown to complete. Otherwise, ifGLib.MainContext.get_thread_default
() differs fromNM.Client.get_main_context
() and integrate_maincontext isFalse
, the caller must make sure that both contexts are iterated until completion. Otherwise, if integrate_maincontext isTrue
, thenNM.Client.get_main_context
() will be integrated inGLib.MainContext.get_thread_default
(). This means, the caller givesNM.Client.get_main_context
() up until the waiting completes, the function will acquire the context and hook it intoGLib.MainContext.get_thread_default
(). It is a bug to request integrate_maincontext while havingNM.Client.get_main_context
() acquired or iterated otherwise because a context can only be acquired once at a time.Shutdown can only complete after all references to self were released.
It is possible to call this function multiple times for the same client. But note that with integrate_maincontext the client’s context is acquired, which can only be done once at a time.
It is permissible to start waiting before the objects is fully initialized.
The function really allows two separate things. To get a notification (callback) when shutdown is complete, and to integrate the client’s context in another context. The latter case is useful if the client has a separate context and you hand it over to another
GLib.MainContext
to wrap up.The main use is to have a
NM.Client
and a separateGLib.MainContext
on a worker thread. When being done, you can hand over the cleanup of the context toGLib.MainContext.default
(), assuming that the main thread iterates the default context. In that case, you don’t need to care about passing a callback to know when shutdown completed.New in version 1.42.
- wimax_get_enabled()¶
-
Determines whether WiMAX is enabled.
Deprecated since version 1.22: This function always returns
False
because WiMax is no longer supported.
- wimax_hardware_get_enabled()¶
-
Determines whether the WiMAX hardware is enabled.
Deprecated since version 1.22: This function always returns
False
because WiMax is no longer supported.
- wimax_set_enabled(enabled)¶
-
Enables or disables WiMAX devices.
Deprecated since version 1.22: This function does nothing because WiMax is no longer supported.
- wireless_get_enabled()¶
-
Determines whether the wireless is enabled.
- wireless_hardware_get_enabled()¶
-
Determines whether the wireless hardware is enabled.
- wireless_set_enabled(enabled)¶
-
Enables or disables wireless devices.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_set_property
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to set “WirelessEnabled” property to a “(b)” value.
- wwan_get_enabled()¶
-
Determines whether WWAN is enabled.
- wwan_hardware_get_enabled()¶
-
Determines whether the WWAN hardware is enabled.
- wwan_set_enabled(enabled)¶
-
Enables or disables WWAN devices.
Deprecated since version 1.22: Use the async command
NM.Client.dbus_set_property
() onNM.DBUS_PATH
,NM.DBUS_INTERFACE
to set “WwanEnabled” property to a “(b)” value.
Signal Details¶
- NM.Client.signals.active_connection_added(client, active_connection)¶
- Signal Name:
active-connection-added
- Flags:
- Parameters:
client (
NM.Client
) – The object which received the signalactive_connection (
NM.ActiveConnection
) – the new active connection
Notifies that a
NM.ActiveConnection
has been added.
- NM.Client.signals.active_connection_removed(client, active_connection)¶
- Signal Name:
active-connection-removed
- Flags:
- Parameters:
client (
NM.Client
) – The object which received the signalactive_connection (
NM.ActiveConnection
) – the removed active connection
Notifies that a
NM.ActiveConnection
has been removed.
- NM.Client.signals.any_device_added(client, device)¶
- Signal Name:
any-device-added
- Flags:
- Parameters:
Notifies that a
NM.Device
is added. This signal is emitted for both regular devices and placeholder devices.
- NM.Client.signals.any_device_removed(client, device)¶
- Signal Name:
any-device-removed
- Flags:
- Parameters:
Notifies that a
NM.Device
is removed. This signal is emitted for both regular devices and placeholder devices.
- NM.Client.signals.connection_added(client, connection)¶
- Signal Name:
connection-added
- Flags:
- Parameters:
client (
NM.Client
) – The object which received the signalconnection (
NM.RemoteConnection
) – the new connection
Notifies that a
NM.Connection
has been added.
- NM.Client.signals.connection_removed(client, connection)¶
- Signal Name:
connection-removed
- Flags:
- Parameters:
client (
NM.Client
) – The object which received the signalconnection (
NM.RemoteConnection
) – the removed connection
Notifies that a
NM.Connection
has been removed.
- NM.Client.signals.device_added(client, device)¶
- Signal Name:
device-added
- Flags:
- Parameters:
Notifies that a
NM.Device
is added. This signal is not emitted for placeholder devices.
- NM.Client.signals.device_removed(client, device)¶
- Signal Name:
device-removed
- Flags:
- Parameters:
Notifies that a
NM.Device
is removed. This signal is not emitted for placeholder devices.
- NM.Client.signals.permission_changed(client, permission, result)¶
- Signal Name:
permission-changed
- Flags:
- Parameters:
client (
NM.Client
) – The object which received the signalpermission (
int
) – a permission fromNM.ClientPermission
result (
int
) – the permission’s result, one ofNM.ClientPermissionResult
Notifies that a permission has changed
Property Details¶
- NM.Client.props.activating_connection¶
- Name:
activating-connection
- Type:
- Default Value:
- Flags:
The
NM.ActiveConnection
of the activating connection that is likely to become the newNM.Client
:primary-connection
.
- NM.Client.props.active_connections¶
- Name:
active-connections
- Type:
- Default Value:
- Flags:
The active connections.
- NM.Client.props.all_devices¶
- Name:
all-devices
- Type:
- Default Value:
- Flags:
List of both real devices and device placeholders.
New in version 1.2.
- NM.Client.props.capabilities¶
- Name:
capabilities
- Type:
- Default Value:
- Flags:
The list of capabilities numbers as guint32 or
None
if there are no capabilities. The numeric value correspond toNM.Capability
enum.New in version 1.24.
- NM.Client.props.checkpoints¶
- Name:
checkpoints
- Type:
- Default Value:
- Flags:
The list of active checkpoints.
New in version 1.12.
- NM.Client.props.connections¶
- Name:
connections
- Type:
- Default Value:
- Flags:
The list of configured connections that are available to the user. (Note that this differs from the underlying D-Bus property, which may also contain the object paths of connections that the user does not have permission to read the details of.)
- NM.Client.props.connectivity¶
- Name:
connectivity
- Type:
- Default Value:
- Flags:
The network connectivity state.
- NM.Client.props.connectivity_check_available¶
- NM.Client.props.connectivity_check_enabled¶
- NM.Client.props.connectivity_check_uri¶
-
The used URI for connectivity checking.
New in version 1.22.
- NM.Client.props.dbus_connection¶
- Name:
dbus-connection
- Type:
- Default Value:
- Flags:
The
Gio.DBusConnection
to use.If this is not set during object construction, the D-Bus connection will automatically be chosen during async/sync initalization via
Gio.bus_get
().New in version 1.22.
- NM.Client.props.dbus_name_owner¶
-
The name owner of the NetworkManager D-Bus service.
New in version 1.22.
- NM.Client.props.devices¶
- Name:
devices
- Type:
- Default Value:
- Flags:
List of real network devices. Does not include placeholder devices.
- NM.Client.props.dns_configuration¶
- Name:
dns-configuration
- Type:
- Default Value:
- Flags:
The current DNS configuration, represented as an array of
NM.DnsEntry
objects.New in version 1.6.
- NM.Client.props.dns_mode¶
-
The current DNS processing mode.
New in version 1.6.
- NM.Client.props.dns_rc_manager¶
-
The current resolv.conf management mode.
New in version 1.6.
- NM.Client.props.hostname¶
-
The machine hostname stored in persistent configuration. This can be modified by calling
NM.Client.save_hostname
().
- NM.Client.props.instance_flags¶
-
NM.ClientInstanceFlags
for the instance. These affect behavior ofNM.Client
. This is a construct property and you may only set most flags only during construction.The flag
NM.ClientInstanceFlags.NO_AUTO_FETCH_PERMISSIONS
can be toggled any time, even after constructing the instance. Note that you may want to watchNM.Client
:permissions-state
property to know whether permissions are ready. Note that permissions are only fetched whenNM.Client
has a D-Bus name owner.The flags
NM.ClientInstanceFlags.INITIALIZED_GOOD
andNM.ClientInstanceFlags.INITIALIZED_BAD
cannot be set, however they will be returned by the getter after initialization completes.New in version 1.24.
- NM.Client.props.metered¶
-
Whether the connectivity is metered.
New in version 1.2.
- NM.Client.props.networking_enabled¶
-
Whether networking is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
- NM.Client.props.nm_running¶
-
Whether the daemon is running.
- NM.Client.props.permissions_state¶
- Name:
permissions-state
- Type:
- Default Value:
- Flags:
The state of the cached permissions. The value
NM.Ternary.DEFAULT
means that no permissions are yet received (or not yet requested).NM.Ternary.TRUE
means that permissions are received, cached and up to date.NM.Ternary.FALSE
means that permissions were received and are cached, but in the meantime a “CheckPermissions” signal was received that invalidated the cached permissions. Note thatNM.Client
will always emit a notify::permissions-state signal when a “CheckPermissions” signal got received or after new permissions got received (that is regardless whether the value of the permission state actually changed). With this you can watch the permissions-state property to know whether the permissions are ready. Note that whileNM.Client
has no D-Bus name owner, no permissions are fetched (and this property won’t change).New in version 1.24.
- NM.Client.props.primary_connection¶
- Name:
primary-connection
- Type:
- Default Value:
- Flags:
The
NM.ActiveConnection
of the device with the default route; seeNM.Client.get_primary_connection
() for more details.
- NM.Client.props.radio_flags¶
-
Flags for radio interfaces. See
NM.RadioFlags
.New in version 1.38.
- NM.Client.props.startup¶
-
Whether the daemon is still starting up.
- NM.Client.props.state¶
- Name:
state
- Type:
- Default Value:
- Flags:
The current daemon state.
- NM.Client.props.version¶
-
The NetworkManager version.
- NM.Client.props.version_info¶
- Name:
version-info
- Type:
- Default Value:
- Flags:
Expose version info and capabilities of NetworkManager. If non-empty, the first element is NM_VERSION, which encodes the version of the daemon as “(major << 16 | minor << 8 | micro)”. The following elements is a bitfields of %NMVersionInfoCapabilities. If a bit is set, then the running NetworkManager has the respective capability.
New in version 1.42.
- NM.Client.props.wimax_enabled¶
-
Whether WiMAX functionality is enabled.
Deprecated since version 1.22: WiMAX is no longer supported and this always returns
False
. The setter has no effect.
- NM.Client.props.wimax_hardware_enabled¶
-
Whether the WiMAX hardware is enabled.
Deprecated since version 1.22: WiMAX is no longer supported and this always returns
False
.
- NM.Client.props.wireless_enabled¶
-
Whether wireless is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
- NM.Client.props.wireless_hardware_enabled¶
-
Whether the wireless hardware is enabled.
- NM.Client.props.wwan_enabled¶
-
Whether WWAN functionality is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.