NM.RemoteConnection

g GObject.GInterface GObject.GInterface NM.Connection NM.Connection GObject.GInterface->NM.Connection GObject.Object GObject.Object NM.Object NM.Object GObject.Object->NM.Object NM.RemoteConnection NM.RemoteConnection NM.Connection->NM.RemoteConnection NM.Object->NM.RemoteConnection

Subclasses:

None

Methods

Inherited:

NM.Object (2), GObject.Object (37), NM.Connection (66)

Structs:

GObject.ObjectClass (5)

commit_changes (save_to_disk, cancellable)

commit_changes_async (save_to_disk, cancellable, callback, *user_data)

commit_changes_finish (result)

delete (cancellable)

delete_async (cancellable, callback, *user_data)

delete_finish (result)

get_filename ()

get_flags ()

get_secrets (setting_name, cancellable)

get_secrets_async (setting_name, cancellable, callback, *user_data)

get_secrets_finish (result)

get_unsaved ()

get_version_id ()

get_visible ()

save (cancellable)

save_async (cancellable, callback, *user_data)

save_finish (result)

update2 (settings, flags, args, cancellable, callback, *user_data)

update2_finish (result)

Virtual Methods

Inherited:

GObject.Object (7), NM.Connection (3)

Properties

Inherited:

NM.Object (2)

Name

Type

Flags

Short Description

filename

str

r

flags

int

r

unsaved

bool

r

version-id

int

r

visible

bool

r

Signals

Inherited:

GObject.Object (1), NM.Connection (3)

Fields

Inherited:

GObject.Object (1), NM.Connection (3)

Class Details

class NM.RemoteConnection(**kwargs)
Bases:

NM.Object, NM.Connection

Abstract:

No

Structure:

NM.RemoteConnectionClass

commit_changes(save_to_disk, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

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

Return type:

bool

Send any local changes to the settings and properties of self to NetworkManager. If save_to_disk is True, the updated connection will be saved to disk; if False, then only the in-memory representation will be changed.

Deprecated since version 1.22: Use NM.RemoteConnection.commit_changes_async() or Gio.DBusConnection.

commit_changes_async(save_to_disk, cancellable, callback, *user_data)
Parameters:

Asynchronously sends any local changes to the settings and properties of self to NetworkManager. If save is True, the updated connection will be saved to disk; if False, then only the in-memory representation will be changed.

commit_changes_finish(result)
Parameters:

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

Raises:

GLib.Error

Returns:

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

Return type:

bool

Gets the result of a call to NM.RemoteConnection.commit_changes_async().

delete(cancellable)
Parameters:

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

Raises:

GLib.Error

Returns:

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

Return type:

bool

Deletes the connection.

Deprecated since version 1.22: Use NM.RemoteConnection.delete_async() or Gio.DBusConnection.

delete_async(cancellable, callback, *user_data)
Parameters:

Asynchronously deletes the connection.

delete_finish(result)
Parameters:

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

Raises:

GLib.Error

Returns:

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

Return type:

bool

Gets the result of a call to NM.RemoteConnection.delete_async().

get_filename()
Returns:

file that stores the connection in case the connection is file-backed.

Return type:

str

New in version 1.12.

get_flags()
Returns:

the flags of the connection of type NM.SettingsConnectionFlags.

Return type:

NM.SettingsConnectionFlags

New in version 1.12.

get_secrets(setting_name, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a GLib.Variant of type %NM_VARIANT_TYPE_CONNECTION containing self's secrets, or None on error.

Warning: NM.Client contains a cache of objects on D-Bus. This cache gets updated with D-Bus signals when iterating the GLib.MainContext. This function performs a (pseudo) blocking D-Bus call. Aside blocking, the result will not be in sync and not be ordered with the content of the NM.Client cache. This function used to be deprecated between 1.22 and 1.38 releases.

Return type:

GLib.Variant

Request the connection’s secrets. Note that this is a blocking D-Bus call, not a simple property accessor.

get_secrets_async(setting_name, cancellable, callback, *user_data)
Parameters:

Asynchronously requests the connection’s secrets.

get_secrets_finish(result)
Parameters:

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

Raises:

GLib.Error

Returns:

a GLib.Variant of type %NM_VARIANT_TYPE_CONNECTION containing self's secrets, or None on error.

Return type:

GLib.Variant

Gets the result of a call to NM.RemoteConnection.get_secrets_async().

get_unsaved()
Returns:

True if the remote connection contains changes that have not been saved to disk, False if the connection is the same as its on-disk representation.

Return type:

bool

get_version_id()
Returns:

the version-id of the profile. This ID is incremented whenever the profile is modified.

Return type:

int

New in version 1.44.

get_visible()
Returns:

True if the remote connection is visible to the current user, False if not.

Return type:

bool

Checks if the connection is visible to the current user. If the connection is not visible then it is essentially useless; it will not contain any settings, and operations such as NM.RemoteConnection.save() and NM.RemoteConnection.delete() will always fail. (#NMRemoteSettings will not normally return non-visible connections to callers, but it is possible for a connection’s visibility to change after you already have a reference to it.)

save(cancellable)
Parameters:

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

Raises:

GLib.Error

Returns:

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

Return type:

bool

Saves the connection to disk if the connection has changes that have not yet been written to disk, or if the connection has never been saved.

Deprecated since version 1.22: Use NM.RemoteConnection.save_async() or Gio.DBusConnection.

save_async(cancellable, callback, *user_data)
Parameters:

Saves the connection to disk if the connection has changes that have not yet been written to disk, or if the connection has never been saved.

save_finish(result)
Parameters:

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

Raises:

GLib.Error

Returns:

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

Return type:

bool

Gets the result of a call to NM.RemoteConnection.save_async().

update2(settings, flags, args, cancellable, callback, *user_data)
Parameters:

Asynchronously calls the Update2() D-Bus method.

New in version 1.12.

update2_finish(result)
Parameters:

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

Raises:

GLib.Error

Returns:

on success, a GLib.Variant of type “a{sv}” with the result. On failure, None.

Return type:

GLib.Variant

Gets the result of a call to NM.RemoteConnection.commit_changes_async().

New in version 1.12.

Property Details

NM.RemoteConnection.props.filename
Name:

filename

Type:

str

Default Value:

None

Flags:

READABLE

File that stores the connection in case the connection is file-backed.

New in version 1.12.

NM.RemoteConnection.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE

The flags of the connection as unsigned integer. The values correspond to the NM.SettingsConnectionFlags enum.

New in version 1.12.

NM.RemoteConnection.props.unsaved
Name:

unsaved

Type:

bool

Default Value:

False

Flags:

READABLE

True if the remote connection contains changes that have not been saved to disk, False if the connection is the same as its on-disk representation.

NM.RemoteConnection.props.version_id
Name:

version-id

Type:

int

Default Value:

0

Flags:

READABLE

The version ID of the profile that is incremented when the profile gets modified. This can be used to track concurrent modifications of the profile.

New in version 1.44.

NM.RemoteConnection.props.visible
Name:

visible

Type:

bool

Default Value:

False

Flags:

READABLE

True if the remote connection is visible to the current user, False if not. If the connection is not visible then it is essentially useless; it will not contain any settings, and operations such as NM.RemoteConnection.save() and NM.RemoteConnection.delete() will always fail. (#NMRemoteSettings will not normally return non-visible connections to callers, but it is possible for a connection’s visibility to change after you already have a reference to it.)