NM.Setting¶
- Subclasses:
NM.Setting6Lowpan
,NM.Setting8021x
,NM.SettingAdsl
,NM.SettingBluetooth
,NM.SettingBond
,NM.SettingBondPort
,NM.SettingBridge
,NM.SettingBridgePort
,NM.SettingCdma
,NM.SettingConnection
,NM.SettingDcb
,NM.SettingDummy
,NM.SettingEthtool
,NM.SettingGeneric
,NM.SettingGsm
,NM.SettingHostname
,NM.SettingHsr
,NM.SettingIPConfig
,NM.SettingIPTunnel
,NM.SettingInfiniband
,NM.SettingLink
,NM.SettingLoopback
,NM.SettingMacsec
,NM.SettingMacvlan
,NM.SettingMatch
,NM.SettingOlpcMesh
,NM.SettingOvsBridge
,NM.SettingOvsDpdk
,NM.SettingOvsExternalIDs
,NM.SettingOvsInterface
,NM.SettingOvsOtherConfig
,NM.SettingOvsPatch
,NM.SettingOvsPort
,NM.SettingPpp
,NM.SettingPppoe
,NM.SettingProxy
,NM.SettingSerial
,NM.SettingSriov
,NM.SettingTCConfig
,NM.SettingTeam
,NM.SettingTeamPort
,NM.SettingTun
,NM.SettingUser
,NM.SettingVeth
,NM.SettingVlan
,NM.SettingVpn
,NM.SettingVrf
,NM.SettingVxlan
,NM.SettingWifiP2P
,NM.SettingWimax
,NM.SettingWireGuard
,NM.SettingWired
,NM.SettingWireless
,NM.SettingWirelessSecurity
,NM.SettingWpan
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.Setting(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- classmethod get_enum_property_type(setting_type, property_name)¶
- Parameters:
setting_type (
GObject.GType
) – theGObject.GType
of theNM.Setting
instanceproperty_name (
str
) – the name of the property
- Returns:
the enum’s
GObject.GType
, orGObject.TYPE_INVALID
if the property is not of enum type- Return type:
Get the type of the enum that defines the values that the property accepts. It is only useful for properties configured to accept values from certain enum type, otherwise it will return
GObject.TYPE_INVALID
. Note that flags (children ofGObject.TYPE_FLAGS
) are also considered enums.Note that the
GObject.Object
property might be implemented as an integer, actually, and not as enum. Find out what underlying type is used, checking theGObject.ParamSpec
, before setting theGObject.Object
property.New in version 1.46.
- classmethod lookup_type(name)¶
- Parameters:
name (
str
) – a setting name- Returns:
the
GObject.GType
of the setting’s class, orGObject.TYPE_INVALID
if name is not recognized.- Return type:
Returns the
GObject.GType
of the setting’s class for a given setting name.
- compare(b, flags)¶
- Parameters:
b (
NM.Setting
) – a secondNM.Setting
to compare with the firstflags (
NM.SettingCompareFlags
) – compare flags, e.g.NM.SettingCompareFlags.EXACT
- Returns:
- Return type:
Compares two
NM.Setting
objects for similarity, with comparison behavior modified by a set of flags. See the documentation forNM.SettingCompareFlags
for a description of each flag’s behavior.
- diff(b, flags, invert_results, results)¶
- Parameters:
b (
NM.Setting
) – a secondNM.Setting
to compare with the firstflags (
NM.SettingCompareFlags
) – compare flags, e.g.NM.SettingCompareFlags.EXACT
invert_results (
bool
) – this parameter is used internally by libnm and should be set toFalse
. IfTrue
inverts the meaning of theNM.SettingDiffResult
.results ({
str
:int
}) – if the settings differ, on return a hash table mapping the differing keys to one or moreNM.SettingDiffResult
values OR-ed together. If the settings do not differ, any hash table passed in is unmodified. If no hash table is passed in and the settings differ, a new one is created and returned.
- Returns:
True
if the settings contain the same values,False
if they do not- results:
if the settings differ, on return a hash table mapping the differing keys to one or more
NM.SettingDiffResult
values OR-ed together. If the settings do not differ, any hash table passed in is unmodified. If no hash table is passed in and the settings differ, a new one is created and returned.
- Return type:
Compares two
NM.Setting
objects for similarity, with comparison behavior modified by a set of flags. See the documentation forNM.SettingCompareFlags
for a description of each flag’s behavior. If the settings differ, the keys of each setting that differ from the other are added to results, mapped to one or moreNM.SettingDiffResult
values.
- duplicate()¶
- Returns:
a new
NM.Setting
containing the same properties and values as the sourceNM.Setting
- Return type:
Duplicates a
NM.Setting
.
- enumerate_values(func, *user_data)¶
- Parameters:
func (
NM.SettingValueIterFn
) – user-supplied function called for each property of the settinguser_data (
object
orNone
) – user data passed to func at each invocation
Iterates over each property of the
NM.Setting
object, calling the supplied user function for each property.
- get_dbus_property_type(property_name)¶
- Parameters:
property_name (
str
) – the property of self to get the type of- Returns:
the D-Bus marshalling type of property on self.
- Return type:
Gets the D-Bus marshalling type of a property. property_name is a D-Bus property name, which may not necessarily be a
GObject.Object
property.
- get_name()¶
- Returns:
a string containing the type name of the
NM.Setting
object, like ‘ppp’ or ‘wireless’ or ‘wired’.- Return type:
Returns the type name of the
NM.Setting
object
- get_secret_flags(secret_name, out_flags)¶
- Parameters:
secret_name (
str
) – the secret key name to get flags forout_flags (
NM.SettingSecretFlags
) – on success, theNM.SettingSecretFlags
for the secret
- Raises:
- Returns:
True
on success (if the given secret name was a valid property of this setting, and if that property is secret),False
if not- Return type:
For a given secret, retrieves the
NM.SettingSecretFlags
describing how to handle that secret.
- option_clear_by_name(predicate)¶
- Parameters:
predicate (
NM.UtilsPredicateStr
orNone
) – the predicate for which names should be clear. If the predicate returnsTrue
for an option name, the option gets removed. IfNone
, all options will be removed.
New in version 1.26.
- option_get(opt_name)¶
- Parameters:
opt_name (
str
) – the option name to request.- Returns:
the
GLib.Variant
orNone
if the option is not set.- Return type:
New in version 1.26.
- option_get_all_names()¶
- Returns:
A
None
terminated array of key names. If no names are present, this returnsNone
. The returned array and the names are owned byNM.Setting
and might be invalidated by the next operation.- Return type:
Gives the name of all set options.
New in version 1.26.
- option_get_boolean(opt_name)¶
- Parameters:
opt_name (
str
) – the option to get- Returns:
True
if opt_name is set to a boolean variant.- out_value:
the optional output value. If the option is unset,
False
will be returned.
- Return type:
New in version 1.26.
- option_get_uint32(opt_name)¶
- Parameters:
opt_name (
str
) – the option to get- Returns:
True
if opt_name is set to a uint32 variant.- out_value:
the optional output value. If the option is unset, 0 will be returned.
- Return type:
New in version 1.26.
- option_set(opt_name, variant)¶
- Parameters:
opt_name (
str
) – the option name to setvariant (
GLib.Variant
orNone
) – the variant to set.
If variant is
None
, this clears the option if it is set. Otherwise, variant is set as the option. If variant is a floating reference, it will be consumed.Note that not all setting types support options. It is a bug setting a variant to a setting that doesn’t support it. Currently, only
NM.SettingEthtool
supports it.New in version 1.26.
- option_set_boolean(opt_name, value)¶
-
Like
NM.Setting.option_set
() to set a booleanGLib.Variant
.New in version 1.26.
- option_set_uint32(opt_name, value)¶
-
Like
NM.Setting.option_set
() to set a uint32GLib.Variant
.New in version 1.26.
- set_secret_flags(secret_name, flags)¶
- Parameters:
secret_name (
str
) – the secret key name to set flags forflags (
NM.SettingSecretFlags
) – theNM.SettingSecretFlags
for the secret
- Raises:
- Returns:
True
on success (if the given secret name was a valid property of this setting, and if that property is secret),False
if not- Return type:
For a given secret, stores the
NM.SettingSecretFlags
describing how to handle that secret.
- to_string()¶
- Returns:
an allocated string containing a textual representation of the setting’s properties and values, which the caller should free with
GLib.free
()- Return type:
Convert the setting (including secrets!) into a string. For debugging purposes ONLY, should NOT be used for serialization of the setting, or machine-parsed in any way. The output format is not guaranteed to be stable and may change at any time.
- verify(connection)¶
- Parameters:
connection (
NM.Connection
orNone
) – theNM.Connection
that self came from, orNone
if self is being verified in isolation.- Raises:
- Returns:
- Return type:
Validates the setting. Each setting’s properties have allowed values, and some are dependent on other values (hence the need for connection). The returned
GLib.Error
contains information about which property of the setting failed validation, and in what way that property failed validation.
- verify_secrets(connection)¶
- Parameters:
connection (
NM.Connection
orNone
) – theNM.Connection
that self came from, orNone
if self is being verified in isolation.- Raises:
- Returns:
True
if the setting secrets are valid,False
if they are not- Return type:
Verifies the secrets in the setting. The returned
GLib.Error
contains information about which secret of the setting failed validation, and in what way that secret failed validation. The secret validation is done separately from main setting validation, because in some cases connection failure is not desired just for the secrets.New in version 1.2.