NM.Client

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object NM.Client NM.Client GObject.Object->NM.Client Gio.AsyncInitable->NM.Client Gio.Initable->NM.Client

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (cancellable)

class

new_async (cancellable, callback, *user_data)

class

new_finish (result)

class

wait_shutdown_finish (result)

activate_connection_async (connection, device, specific_object, cancellable, callback, *user_data)

activate_connection_finish (result)

add_and_activate_connection2 (partial, device, specific_object, options, cancellable, callback, *user_data)

add_and_activate_connection2_finish (result)

add_and_activate_connection_async (partial, device, specific_object, cancellable, callback, *user_data)

add_and_activate_connection_finish (result)

add_connection2 (settings, flags, args, ignore_out_result, cancellable, callback, *user_data)

add_connection2_finish (result)

add_connection_async (connection, save_to_disk, cancellable, callback, *user_data)

add_connection_finish (result)

check_connectivity (cancellable)

check_connectivity_async (cancellable, callback, *user_data)

check_connectivity_finish (result)

checkpoint_adjust_rollback_timeout (checkpoint_path, add_timeout, cancellable, callback, *user_data)

checkpoint_adjust_rollback_timeout_finish (result)

checkpoint_create (devices, rollback_timeout, flags, cancellable, callback, *user_data)

checkpoint_create_finish (result)

checkpoint_destroy (checkpoint_path, cancellable, callback, *user_data)

checkpoint_destroy_finish (result)

checkpoint_rollback (checkpoint_path, cancellable, callback, *user_data)

checkpoint_rollback_finish (result)

connectivity_check_get_available ()

connectivity_check_get_enabled ()

connectivity_check_get_uri ()

connectivity_check_set_enabled (enabled)

dbus_call (object_path, interface_name, method_name, parameters, reply_type, timeout_msec, cancellable, callback, *user_data)

dbus_call_finish (result)

dbus_set_property (object_path, interface_name, property_name, value, timeout_msec, cancellable, callback, *user_data)

dbus_set_property_finish (result)

deactivate_connection (active, cancellable)

deactivate_connection_async (active, cancellable, callback, *user_data)

deactivate_connection_finish (result)

get_activating_connection ()

get_active_connections ()

get_all_devices ()

get_capabilities ()

get_checkpoints ()

get_connection_by_id (id)

get_connection_by_path (path)

get_connection_by_uuid (uuid)

get_connections ()

get_connectivity ()

get_context_busy_watcher ()

get_dbus_connection ()

get_dbus_name_owner ()

get_device_by_iface (iface)

get_device_by_path (object_path)

get_devices ()

get_dns_configuration ()

get_dns_mode ()

get_dns_rc_manager ()

get_instance_flags ()

get_logging ()

get_main_context ()

get_metered ()

get_nm_running ()

get_object_by_path (dbus_path)

get_permission_result (permission)

get_permissions_state ()

get_primary_connection ()

get_radio_flags ()

get_startup ()

get_state ()

get_version ()

get_version_info ()

load_connections (filenames, cancellable)

load_connections_async (filenames, cancellable, callback, *user_data)

load_connections_finish (result)

networking_get_enabled ()

networking_set_enabled (enabled)

reload (flags, cancellable, callback, *user_data)

reload_connections (cancellable)

reload_connections_async (cancellable, callback, *user_data)

reload_connections_finish (result)

reload_finish (result)

save_hostname (hostname, cancellable)

save_hostname_async (hostname, cancellable, callback, *user_data)

save_hostname_finish (result)

set_logging (level, domains)

wait_shutdown (integrate_maincontext, cancellable, callback, *user_data)

wimax_get_enabled ()

wimax_hardware_get_enabled ()

wimax_set_enabled (enabled)

wireless_get_enabled ()

wireless_hardware_get_enabled ()

wireless_set_enabled (enabled)

wwan_get_enabled ()

wwan_hardware_get_enabled ()

wwan_set_enabled (enabled)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncInitable (2), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

activating-connection

NM.ActiveConnection

r

active-connections

GLib.PtrArray

r

all-devices

GLib.PtrArray

r

can-modify

bool

r

capabilities

GLib.Array

r

checkpoints

GLib.PtrArray

r

connections

GLib.PtrArray

r

connectivity

NM.ConnectivityState

r

connectivity-check-available

bool

r

connectivity-check-enabled

bool

r/w

connectivity-check-uri

str

r

dbus-connection

Gio.DBusConnection

r/w/co

dbus-name-owner

str

r

devices

GLib.PtrArray

r

dns-configuration

GLib.PtrArray

r

dns-mode

str

r

dns-rc-manager

str

r

hostname

str

r

instance-flags

int

r/w/c

metered

int

r

networking-enabled

bool

r/w

nm-running

bool

r

permissions-state

NM.Ternary

r

primary-connection

NM.ActiveConnection

r

radio-flags

int

r

startup

bool

r

state

NM.State

r

version

str

r

version-info

GLib.Array

r

wimax-enabled

bool

r/w

deprecated

wimax-hardware-enabled

bool

r

deprecated

wireless-enabled

bool

r/w

wireless-hardware-enabled

bool

r

wwan-enabled

bool

r/w

wwan-hardware-enabled

bool

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

active-connection-added

Notifies that a NM.ActiveConnection has been added.

active-connection-removed

Notifies that a NM.ActiveConnection has been removed.

any-device-added

Notifies that a NM.Device is added.

any-device-removed

Notifies that a NM.Device is removed.

connection-added

Notifies that a NM.Connection has been added.

connection-removed

Notifies that a NM.Connection has been removed.

device-added

Notifies that a NM.Device is added.

device-removed

Notifies that a NM.Device is removed.

permission-changed

Notifies that a permission has changed

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.Client(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable, Gio.Initable

Abstract:

No

Structure:

NM.ClientClass

NM.Client contains a cache of the objects of NetworkManager’s D-Bus API. It uses GLib.MainContext and Gio.DBusConnection for that and registers to D-Bus signals. That means, when iterating the associated GLib.MainContext, D-Bus signals gets processed and the NM.Client instance updates and emits GObject.Object signals.

classmethod new(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Returns:

a new NM.Client or None on an error

Return type:

NM.Client

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 set GObject.Object properties or get access to the NM.Client instance while it is still initializing.

Using the synchronous initialization creates an NM.Client instance that uses an internal GLib.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 internal GLib.MainContext, the events are no longer in sync with other messages from Gio.DBusConnection (but all events of the NM.Client will themselves still be ordered). For a serious program, you should therefore avoid these problems by using Gio.AsyncInitable.init_async() or NM.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 a NM.CLIENT_DBUS_CONNECTION and the call to Gio.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 keep NM.Client.get_main_context() alive. That means, in that case you must continue iterating the context to avoid leaks. See NM.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:

Creates a new NM.Client asynchronously. callback will be called when it is done. Use NM.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 set GObject.Object properties or get access to the NM.Client instance while it is still initializing.

Creating an NM.Client instance can only fail for two reasons. First, if you didn’t provide a NM.CLIENT_DBUS_CONNECTION and the call to Gio.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 keep NM.Client.get_main_context() alive. That means, in that case you must continue iterating the context to avoid leaks. See NM.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a new NM.Client, or None on error

Return type:

NM.Client

Gets the result of an NM.Client.new_async() call.

classmethod wait_shutdown_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to NM.Client.wait_shutdown()

Raises:

GLib.Error

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:

bool

New in version 1.42.

activate_connection_async(connection, device, specific_object, cancellable, callback, *user_data)
Parameters:

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 an NM.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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

the new NM.ActiveConnection on success, None on failure, in which case error will be set.

Return type:

NM.ActiveConnection

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 or None) – an NM.Connection to add; the connection may be partially filled (or even None) and will be completed by NetworkManager using the given device and specific_object before being added

  • device (NM.Device or None) – the NM.Device

  • specific_object (str or None) – 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 of None should be used (i.e., no specific object). For Wi-Fi or WiMAX connections, pass the object path of a NM.AccessPoint or NM.WimaxNsp owned by device, which you can get using NM.Object.get_path(), and which will be used to complete the details of the newly added connection.

  • options (GLib.Variant) – a GLib.Variant containing a dictionary with options, or None

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

  • callback (Gio.AsyncReadyCallback or None) – callback to be called when the activation has started

  • user_data (object or None) – 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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

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 or None)

Gets the result of a call to NM.Client.add_and_activate_connection2().

You can call NM.ActiveConnection.get_connection() on the returned NM.ActiveConnection to find the path of the created NM.Connection.

New in version 1.16.

add_and_activate_connection_async(partial, device, specific_object, cancellable, callback, *user_data)
Parameters:
  • partial (NM.Connection or None) – an NM.Connection to add; the connection may be partially filled (or even None) and will be completed by NetworkManager using the given device and specific_object before being added

  • device (NM.Device or None) – the NM.Device

  • specific_object (str or None) – 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 of None should be used (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object path of a NM.AccessPoint or NM.WimaxNsp owned by device, which you can get using NM.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 or None) – a Gio.Cancellable, or None

  • callback (Gio.AsyncReadyCallback or None) – callback to be called when the activation has started

  • user_data (object or None) – 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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

the new NM.ActiveConnection on success, None on failure, in which case error will be set.

Return type:

NM.ActiveConnection

Gets the result of a call to NM.Client.add_and_activate_connection_async().

You can call NM.ActiveConnection.get_connection() on the returned NM.ActiveConnection to find the path of the created NM.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) – the NM.SettingsAddConnection2Flags argument.

  • args (GLib.Variant or None) – the “a{sv}” GLib.Variant with extra argument or None for no extra arguments.

  • ignore_out_result (bool) – this function wraps AddConnection2(), which has an additional result “a{sv}” output parameter. By setting this to True, 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 to False, the function under the hood always calls AddConnection2().

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

  • callback (Gio.AsyncReadyCallback or None) – callback to be called when the add operation completes

  • user_data (object or None) – 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) – the Gio.AsyncResult

Raises:

GLib.Error

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 of NM.Client.add_connection2() must not be set to True.

Return type:

(NM.RemoteConnection, out_result: GLib.Variant or None)

New in version 1.20.

add_connection_async(connection, save_to_disk, cancellable, callback, *user_data)
Parameters:

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’s NM.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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

the new NM.RemoteConnection on success, None on failure, in which case error will be set.

Return type:

NM.RemoteConnection

Gets the result of a call to NM.Client.add_connection_async().

check_connectivity(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable

Raises:

GLib.Error

Returns:

the (new) current connectivity state

Return type:

NM.ConnectivityState

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() or Gio.DBusConnection.

check_connectivity_async(cancellable, callback, *user_data)
Parameters:

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, and NM.Client.check_connectivity(), which blocks.

check_connectivity_finish(result)
Parameters:

result (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

the (new) current connectivity state

Return type:

NM.ConnectivityState

Retrieves the result of an NM.Client.check_connectivity_async() call.

checkpoint_adjust_rollback_timeout(checkpoint_path, add_timeout, cancellable, callback, *user_data)
Parameters:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success or False on failure.

Return type:

bool

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:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

the new NM.Checkpoint on success, None on failure, in which case error will be set.

Return type:

NM.Checkpoint

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:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success or False on failure, in which case error will be set.

Return type:

bool

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:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

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:

{str: int}

Gets the result of a call to NM.Client.checkpoint_rollback().

New in version 1.12.

connectivity_check_get_available()
Returns:

True if connectivity checking is available.

Return type:

bool

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()
Returns:

True if connectivity checking is enabled.

Return type:

bool

Determine whether connectivity checking is enabled.

New in version 1.10.

connectivity_check_get_uri()
Returns:

the connectivity URI in use

Return type:

str

Get the URI that will be queried to determine if there is internet connectivity.

New in version 1.20.

connectivity_check_set_enabled(enabled)
Parameters:

enabled (bool) – True to enable connectivity checking

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() on NM.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:

Call Gio.DBusConnection.call() on the current name owner with the specified arguments. Most importantly, this invokes Gio.DBusConnection.call() with the client’s GLib.MainContext, so that the response is always in order with other events D-Bus events. Of course, the call uses Gio.Task and will invoke the callback on the current GLib.MainContext.get_thread_default().

This API is merely a convenient wrapper for Gio.DBusConnection.call(). You can also use Gio.DBusConnection.call() directly, with the same effect.

New in version 1.24.

dbus_call_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

the result GLib.Variant or None on error.

Return type:

GLib.Variant

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:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success or False on failure.

Return type:

bool

Gets the result of a call to NM.Client.dbus_set_property().

New in version 1.24.

deactivate_connection(active, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

success or failure

Return type:

bool

Deactivates an active NM.ActiveConnection.

Deprecated since version 1.22: Use NM.Client.deactivate_connection_async() or Gio.DBusConnection.

deactivate_connection_async(active, cancellable, callback, *user_data)
Parameters:

Asynchronously deactivates an active NM.ActiveConnection.

deactivate_connection_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

success or failure

Return type:

bool

Gets the result of a call to NM.Client.deactivate_connection_async().

get_activating_connection()
Returns:

the appropriate NM.ActiveConnection, if any.

Return type:

NM.ActiveConnection

Gets the NM.ActiveConnection corresponding to a currently-activating connection that is expected to become the new NM.Client :primary-connection upon successful activation.

get_active_connections()
Returns:

a GLib.PtrArray containing all the active NM.ActiveConnections. The returned array is owned by the client and should not be modified.

Return type:

[NM.ActiveConnection]

Gets the active connections.

get_all_devices()
Returns:

a GLib.PtrArray containing all the NM.Devices. The returned array is owned by the NM.Client object and should not be modified.

Return type:

[NM.Device]

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). Use NM.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 to NM.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 the NM.Checkpoint. The returned array is owned by the NM.Client object and should not be modified.

Return type:

[NM.Checkpoint]

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:

NM.RemoteConnection

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 known

The connection is as received from D-Bus and might not validate according to NM.Connection.verify().

Return type:

NM.RemoteConnection

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 known

The connection is as received from D-Bus and might not validate according to NM.Connection.verify().

Return type:

NM.RemoteConnection

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:

[NM.RemoteConnection]

get_connectivity()
Returns:

the current connectivity state

Return type:

NM.ConnectivityState

Gets the current network connectivity state. Contrast NM.Client.check_connectivity() and NM.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 the GLib.MainContext associated with the instance. When destroying the NM.Client instance, those requests are cancelled right away, however their pending requests are still outstanding and queued in the GLib.MainContext. These outstanding callbacks keep the GLib.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 this GObject.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 the GLib.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 the GLib.MainContext afterwards, then you don’t need to care when exactly NM.Client is gone completely.

Return type:

GObject.Object

New in version 1.22.

get_dbus_connection()
Returns:

the D-Bus connection of the client, or None if none is set.

Return type:

Gio.DBusConnection

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:

str

New in version 1.22.

get_device_by_iface(iface)
Parameters:

iface (str) – the interface name to search for

Returns:

the NM.Device for the given iface or None if none is found.

Return type:

NM.Device

Gets a NM.Device from a NM.Client.

get_device_by_path(object_path)
Parameters:

object_path (str) – the object path to search for

Returns:

the NM.Device for the given object_path or None if none is found.

Return type:

NM.Device

Gets a NM.Device from a NM.Client.

get_devices()
Returns:

a GLib.PtrArray containing all the NM.Devices. The returned array is owned by the NM.Client object and should not be modified.

Return type:

[NM.Device]

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 containing NM.DnsEntry elements or None in case the value is not available. The returned array is owned by the NM.Client object and should not be modified.

Return type:

[NM.DnsEntry]

Gets the current DNS configuration

New in version 1.6.

get_dns_mode()
Returns:

the DNS processing mode, or None in case the value is not available.

Return type:

str

Gets the current DNS processing mode.

New in version 1.6.

get_dns_rc_manager()
Returns:

the resolv.conf manager or None in case the value is not available.

Return type:

str

Gets the current DNS resolv.conf manager.

New in version 1.6.

get_instance_flags()
Returns:

the NM.ClientInstanceFlags flags.

Return type:

NM.ClientInstanceFlags

New in version 1.24.

get_logging()
Raises:

GLib.Error

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:

(bool, level: str or None, domains: str or None)

Gets NetworkManager current logging level and domains.

Deprecated since version 1.22: Use the async command NM.Client.dbus_call() on NM.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:

GLib.MainContext

The NM.Client instance is permanently associated with the current thread default GLib.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 the NM.Client.get_context_busy_watcher() object is alive.

New in version 1.22.

get_metered()
Returns:

whether the default route is metered.

Return type:

NM.Metered

New in version 1.22.

get_nm_running()
Returns:

True if the daemon is running

Return type:

bool

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, or None if no such object exists.

Return type:

NM.Object

New in version 1.24.

get_permission_result(permission)
Parameters:

permission (NM.ClientPermission) – the permission for which to return the result, one of NM.ClientPermission

Returns:

the permission’s result, one of NM.ClientPermissionResult

Return type:

NM.ClientPermissionResult

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:

NM.Ternary

New in version 1.24.

get_primary_connection()
Returns:

the appropriate NM.ActiveConnection, if any

Return type:

NM.ActiveConnection

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:

NM.RadioFlags

Get radio flags.

New in version 1.38.

get_startup()
Returns:

whether the daemon is still starting up

Return type:

bool

Tests whether the daemon is still in the process of activating connections at startup.

get_state()
Returns:

the current NM.State

Return type:

NM.State

Gets the current daemon state.

get_version()
Returns:

string with the version (or None if NetworkManager is not running)

Return type:

str

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:
Raises:

GLib.Error

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:

(bool, failures: str)

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 to None. If NetworkManager tried to load the files, but some (or all) failed, then failures will be set to a None-terminated array of the filenames that failed to load.

Deprecated since version 1.22: Use NM.Client.load_connections_async() or Gio.DBusConnection.

load_connections_async(filenames, cancellable, callback, *user_data)
Parameters:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

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:

(bool, failures: [str])

Gets the result of an NM.Client.load_connections_async() call.

See NM.Client.load_connections() for more details.

networking_get_enabled()
Returns:

True if networking is enabled, False if networking is disabled

Return type:

bool

Whether networking is enabled or disabled.

networking_set_enabled(enabled)
Parameters:

enabled (bool) – True to set networking enabled, False to set networking disabled

Raises:

GLib.Error

Returns:

True on success, False otherwise

Return type:

bool

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() on NM.DBUS_PATH, NM.DBUS_INTERFACE to call “Enable” with “(b)” arguments and no return value.

reload(flags, cancellable, callback, *user_data)
Parameters:

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 or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

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() or Gio.DBusConnection.

reload_connections_async(cancellable, callback, *user_data)
Parameters:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

Gets the result of an NM.Client.reload_connections_async() call.

reload_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success or False on failure.

Return type:

bool

Gets the result of a call to NM.Client.reload().

New in version 1.22.

save_hostname(hostname, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the request was successful, False if it failed

Return type:

bool

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() or Gio.DBusConnection.

save_hostname_async(hostname, cancellable, callback, *user_data)
Parameters:

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 the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True if the request was successful, False if it failed

Return type:

bool

Gets the result of an NM.Client.save_hostname_async() call.

set_logging(level, domains)
Parameters:
  • level (str or None) – logging level to set (None or an empty string for no change)

  • domains (str or None) – logging domains to set. The string should be a list of log domains separated by “,”. (None or an empty string for no change)

Raises:

GLib.Error

Returns:

True on success, False otherwise

Return type:

bool

Sets NetworkManager logging level and/or domains.

Deprecated since version 1.22: Use the async command NM.Client.dbus_call() on NM.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 or None) – the Gio.Cancellable to abort the shutdown.

  • callback (Gio.AsyncReadyCallback or None) – a Gio.AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result of the method invocation.

  • user_data (object or None) – the data to pass to callback

The way to stop NM.Client is by unrefing it. That will cancel all internally pending async operations. However, as async operations in NM.Client use Gio.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 current GLib.MainContext.get_thread_default() is the same as NM.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, if GLib.MainContext.get_thread_default() differs from NM.Client.get_main_context() and integrate_maincontext is False, the caller must make sure that both contexts are iterated until completion. Otherwise, if integrate_maincontext is True, then NM.Client.get_main_context() will be integrated in GLib.MainContext.get_thread_default(). This means, the caller gives NM.Client.get_main_context() up until the waiting completes, the function will acquire the context and hook it into GLib.MainContext.get_thread_default(). It is a bug to request integrate_maincontext while having NM.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 separate GLib.MainContext on a worker thread. When being done, you can hand over the cleanup of the context to GLib.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()
Returns:

True if WiMAX is enabled

Return type:

bool

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()
Returns:

True if the WiMAX hardware is enabled

Return type:

bool

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)
Parameters:

enabled (bool) – True to enable WiMAX

Enables or disables WiMAX devices.

Deprecated since version 1.22: This function does nothing because WiMax is no longer supported.

wireless_get_enabled()
Returns:

True if wireless is enabled

Return type:

bool

Determines whether the wireless is enabled.

wireless_hardware_get_enabled()
Returns:

True if the wireless hardware is enabled

Return type:

bool

Determines whether the wireless hardware is enabled.

wireless_set_enabled(enabled)
Parameters:

enabled (bool) – True to enable wireless

Enables or disables wireless devices.

Deprecated since version 1.22: Use the async command NM.Client.dbus_set_property() on NM.DBUS_PATH, NM.DBUS_INTERFACE to set “WirelessEnabled” property to a “(b)” value.

wwan_get_enabled()
Returns:

True if WWAN is enabled

Return type:

bool

Determines whether WWAN is enabled.

wwan_hardware_get_enabled()
Returns:

True if the WWAN hardware is enabled

Return type:

bool

Determines whether the WWAN hardware is enabled.

wwan_set_enabled(enabled)
Parameters:

enabled (bool) – True to enable WWAN

Enables or disables WWAN devices.

Deprecated since version 1.22: Use the async command NM.Client.dbus_set_property() on NM.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:

RUN_FIRST

Parameters:

Notifies that a NM.ActiveConnection has been added.

NM.Client.signals.active_connection_removed(client, active_connection)
Signal Name:

active-connection-removed

Flags:

RUN_FIRST

Parameters:

Notifies that a NM.ActiveConnection has been removed.

NM.Client.signals.any_device_added(client, device)
Signal Name:

any-device-added

Flags:

RUN_FIRST

Parameters:
  • client (NM.Client) – The object which received the signal

  • device (NM.Device) – the new device

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:

RUN_FIRST

Parameters:
  • client (NM.Client) – The object which received the signal

  • device (NM.Device) – the removed device

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:

RUN_FIRST

Parameters:

Notifies that a NM.Connection has been added.

NM.Client.signals.connection_removed(client, connection)
Signal Name:

connection-removed

Flags:

RUN_FIRST

Parameters:

Notifies that a NM.Connection has been removed.

NM.Client.signals.device_added(client, device)
Signal Name:

device-added

Flags:

RUN_FIRST

Parameters:
  • client (NM.Client) – The object which received the signal

  • device (NM.Device) – the new device

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:

RUN_FIRST

Parameters:
  • client (NM.Client) – The object which received the signal

  • device (NM.Device) – the removed device

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:

RUN_FIRST

Parameters:

Notifies that a permission has changed

Property Details

NM.Client.props.activating_connection
Name:

activating-connection

Type:

NM.ActiveConnection

Default Value:

None

Flags:

READABLE

The NM.ActiveConnection of the activating connection that is likely to become the new NM.Client :primary-connection.

NM.Client.props.active_connections
Name:

active-connections

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

The active connections.

NM.Client.props.all_devices
Name:

all-devices

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

List of both real devices and device placeholders.

New in version 1.2.

NM.Client.props.can_modify
Name:

can-modify

Type:

bool

Default Value:

False

Flags:

READABLE

If True, adding and modifying connections is supported.

NM.Client.props.capabilities
Name:

capabilities

Type:

GLib.Array

Default Value:

None

Flags:

READABLE

The list of capabilities numbers as guint32 or None if there are no capabilities. The numeric value correspond to NM.Capability enum.

New in version 1.24.

NM.Client.props.checkpoints
Name:

checkpoints

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

The list of active checkpoints.

New in version 1.12.

NM.Client.props.connections
Name:

connections

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

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:

NM.ConnectivityState

Default Value:

NM.ConnectivityState.UNKNOWN

Flags:

READABLE

The network connectivity state.

NM.Client.props.connectivity_check_available
Name:

connectivity-check-available

Type:

bool

Default Value:

False

Flags:

READABLE

NM.Client.props.connectivity_check_enabled
Name:

connectivity-check-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

NM.Client.props.connectivity_check_uri
Name:

connectivity-check-uri

Type:

str

Default Value:

None

Flags:

READABLE

The used URI for connectivity checking.

New in version 1.22.

NM.Client.props.dbus_connection
Name:

dbus-connection

Type:

Gio.DBusConnection

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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
Name:

dbus-name-owner

Type:

str

Default Value:

None

Flags:

READABLE

The name owner of the NetworkManager D-Bus service.

New in version 1.22.

NM.Client.props.devices
Name:

devices

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

List of real network devices. Does not include placeholder devices.

NM.Client.props.dns_configuration
Name:

dns-configuration

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

The current DNS configuration, represented as an array of NM.DnsEntry objects.

New in version 1.6.

NM.Client.props.dns_mode
Name:

dns-mode

Type:

str

Default Value:

None

Flags:

READABLE

The current DNS processing mode.

New in version 1.6.

NM.Client.props.dns_rc_manager
Name:

dns-rc-manager

Type:

str

Default Value:

None

Flags:

READABLE

The current resolv.conf management mode.

New in version 1.6.

NM.Client.props.hostname
Name:

hostname

Type:

str

Default Value:

None

Flags:

READABLE

The machine hostname stored in persistent configuration. This can be modified by calling NM.Client.save_hostname().

NM.Client.props.instance_flags
Name:

instance-flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

NM.ClientInstanceFlags for the instance. These affect behavior of NM.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 watch NM.Client :permissions-state property to know whether permissions are ready. Note that permissions are only fetched when NM.Client has a D-Bus name owner.

The flags NM.ClientInstanceFlags.INITIALIZED_GOOD and NM.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
Name:

metered

Type:

int

Default Value:

0

Flags:

READABLE

Whether the connectivity is metered.

New in version 1.2.

NM.Client.props.networking_enabled
Name:

networking-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether networking is enabled.

The property setter is a synchronous D-Bus call. This is deprecated since 1.22.

NM.Client.props.nm_running
Name:

nm-running

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the daemon is running.

NM.Client.props.permissions_state
Name:

permissions-state

Type:

NM.Ternary

Default Value:

NM.Ternary.DEFAULT

Flags:

READABLE

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 that NM.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 while NM.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:

NM.ActiveConnection

Default Value:

None

Flags:

READABLE

The NM.ActiveConnection of the device with the default route; see NM.Client.get_primary_connection() for more details.

NM.Client.props.radio_flags
Name:

radio-flags

Type:

int

Default Value:

0

Flags:

READABLE

Flags for radio interfaces. See NM.RadioFlags.

New in version 1.38.

NM.Client.props.startup
Name:

startup

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the daemon is still starting up.

NM.Client.props.state
Name:

state

Type:

NM.State

Default Value:

NM.State.UNKNOWN

Flags:

READABLE

The current daemon state.

NM.Client.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE

The NetworkManager version.

NM.Client.props.version_info
Name:

version-info

Type:

GLib.Array

Default Value:

None

Flags:

READABLE

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
Name:

wimax-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

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
Name:

wimax-hardware-enabled

Type:

bool

Default Value:

False

Flags:

READABLE

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
Name:

wireless-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

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
Name:

wireless-hardware-enabled

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the wireless hardware is enabled.

NM.Client.props.wwan_enabled
Name:

wwan-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether WWAN functionality is enabled.

The property setter is a synchronous D-Bus call. This is deprecated since 1.22.

NM.Client.props.wwan_hardware_enabled
Name:

wwan-hardware-enabled

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the WWAN hardware is enabled.