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.SettingIpvlan,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.GTypeof theNM.Settinginstanceproperty_name (
str) – the name of the property
- Returns:
the enum’s
GObject.GType, orGObject.TYPE_INVALIDif 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.Objectproperty might be implemented as an integer, actually, and not as enum. Find out what underlying type is used, checking theGObject.ParamSpec, before setting theGObject.Objectproperty.New in version 1.46.
- classmethod lookup_type(name)¶
- Parameters:
name (
str) – a setting name- Returns:
the
GObject.GTypeof the setting’s class, orGObject.TYPE_INVALIDif name is not recognized.- Return type:
Returns the
GObject.GTypeof the setting’s class for a given setting name.
- compare(b, flags)¶
- Parameters:
b (
NM.Setting) – a secondNM.Settingto compare with the firstflags (
NM.SettingCompareFlags) – compare flags, e.g.NM.SettingCompareFlags.EXACT
- Returns:
- Return type:
Compares two
NM.Settingobjects for similarity, with comparison behavior modified by a set of flags. See the documentation forNM.SettingCompareFlagsfor a description of each flag’s behavior.
- diff(b, flags, invert_results, results)¶
- Parameters:
b (
NM.Setting) – a secondNM.Settingto compare with the firstflags (
NM.SettingCompareFlags) – compare flags, e.g.NM.SettingCompareFlags.EXACTinvert_results (
bool) – this parameter is used internally by libnm and should be set toFalse. IfTrueinverts 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.SettingDiffResultvalues 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:
Trueif the settings contain the same values,Falseif they do not- results:
if the settings differ, on return a hash table mapping the differing keys to one or more
NM.SettingDiffResultvalues 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.Settingobjects for similarity, with comparison behavior modified by a set of flags. See the documentation forNM.SettingCompareFlagsfor 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.SettingDiffResultvalues.
- duplicate()¶
- Returns:
a new
NM.Settingcontaining 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 (
objectorNone) – user data passed to func at each invocation
Iterates over each property of the
NM.Settingobject, 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.Objectproperty.
- get_name()¶
- Returns:
a string containing the type name of the
NM.Settingobject, like ‘ppp’ or ‘wireless’ or ‘wired’.- Return type:
Returns the type name of the
NM.Settingobject
- 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.SettingSecretFlagsfor the secret
- Raises:
- Returns:
Trueon success (if the given secret name was a valid property of this setting, and if that property is secret),Falseif not- Return type:
For a given secret, retrieves the
NM.SettingSecretFlagsdescribing how to handle that secret.
- option_clear_by_name(predicate)¶
- Parameters:
predicate (
NM.UtilsPredicateStrorNone) – the predicate for which names should be clear. If the predicate returnsTruefor 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.VariantorNoneif the option is not set.- Return type:
New in version 1.26.
- option_get_all_names()¶
- Returns:
A
Noneterminated array of key names. If no names are present, this returnsNone. The returned array and the names are owned byNM.Settingand 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:
Trueif opt_name is set to a boolean variant.- out_value:
the optional output value. If the option is unset,
Falsewill be returned.
- Return type:
New in version 1.26.
- option_get_uint32(opt_name)¶
- Parameters:
opt_name (
str) – the option to get- Returns:
Trueif 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.VariantorNone) – 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.SettingEthtoolsupports 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.SettingSecretFlagsfor the secret
- Raises:
- Returns:
Trueon success (if the given secret name was a valid property of this setting, and if that property is secret),Falseif not- Return type:
For a given secret, stores the
NM.SettingSecretFlagsdescribing 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.ConnectionorNone) – theNM.Connectionthat self came from, orNoneif 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.Errorcontains information about which property of the setting failed validation, and in what way that property failed validation.
- verify_secrets(connection)¶
- Parameters:
connection (
NM.ConnectionorNone) – theNM.Connectionthat self came from, orNoneif self is being verified in isolation.- Raises:
- Returns:
Trueif the setting secrets are valid,Falseif they are not- Return type:
Verifies the secrets in the setting. The returned
GLib.Errorcontains 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.