NM.RemoteConnection¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
|||
r |
|||
r |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.RemoteConnection(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- commit_changes(save_to_disk, cancellable)¶
- Parameters:
save_to_disk (
bool
) – whether to persist the changes to diskcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
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; ifFalse
, then only the in-memory representation will be changed.Deprecated since version 1.22: Use
NM.RemoteConnection.commit_changes_async
() orGio.DBusConnection
.
- commit_changes_async(save_to_disk, cancellable, callback, *user_data)¶
- Parameters:
save_to_disk (
bool
) – whether to save the changes to persistent storagecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the commit operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
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; ifFalse
, then only the in-memory representation will be changed.
- commit_changes_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
Gets the result of a call to
NM.RemoteConnection.commit_changes_async
().
- delete(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
Deletes the connection.
Deprecated since version 1.22: Use
NM.RemoteConnection.delete_async
() orGio.DBusConnection
.
- delete_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the delete operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Asynchronously deletes the connection.
- delete_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
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:
New in version 1.12.
- get_flags()¶
- Returns:
the flags of the connection of type
NM.SettingsConnectionFlags
.- Return type:
New in version 1.12.
- get_secrets(setting_name, cancellable)¶
- Parameters:
setting_name (
str
) – theNM.Setting
object name to get secrets forcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a
GLib.Variant
of type %NM_VARIANT_TYPE_CONNECTION containing self's secrets, orNone
on error.Warning:
NM.Client
contains a cache of objects on D-Bus. This cache gets updated with D-Bus signals when iterating theGLib.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 theNM.Client
cache. This function used to be deprecated between 1.22 and 1.38 releases.- Return type:
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:
setting_name (
str
) – theNM.Setting
object name to get secrets forcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the secret request completesuser_data (
object
orNone
) – caller-specific data passed to callback
Asynchronously requests the connection’s secrets.
- get_secrets_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
a
GLib.Variant
of type %NM_VARIANT_TYPE_CONNECTION containing self's secrets, orNone
on error.- Return type:
Gets the result of a call to
NM.RemoteConnection.get_secrets_async
().
- get_unsaved()¶
- get_version_id()¶
- Returns:
the version-id of the profile. This ID is incremented whenever the profile is modified.
- Return type:
New in version 1.44.
- get_visible()¶
-
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
() andNM.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
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
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
() orGio.DBusConnection
.
- save_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the save operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
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 theGio.AsyncReadyCallback
- Raises:
- Returns:
True
on success,False
on error, in which case error will be set.- Return type:
Gets the result of a call to
NM.RemoteConnection.save_async
().
- update2(settings, flags, args, cancellable, callback, *user_data)¶
- Parameters:
settings (
GLib.Variant
orNone
) – optional connection to update the settings.flags (
NM.SettingsUpdate2Flags
) – update-flagsargs (
GLib.Variant
orNone
) – optional arguments.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to be called when the commit operation completesuser_data (
object
orNone
) – caller-specific data passed to callback
Asynchronously calls the Update2() D-Bus method.
New in version 1.12.
- update2_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
on success, a
GLib.Variant
of type “a{sv}” with the result. On failure,None
.- Return type:
Gets the result of a call to
NM.RemoteConnection.commit_changes_async
().New in version 1.12.
Property Details¶
- NM.RemoteConnection.props.filename¶
-
File that stores the connection in case the connection is file-backed.
New in version 1.12.
- NM.RemoteConnection.props.flags¶
-
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¶
-
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¶
-
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¶
-
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 asNM.RemoteConnection.save
() andNM.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.)