NM.SettingBond¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.SettingBond(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Bonding Settings
- classmethod new()¶
- Returns:
the new empty
NM.SettingBond
object- Return type:
Creates a new
NM.SettingBond
object with default values.
- classmethod validate_option(name, value)¶
- Parameters:
- Returns:
True
, if the value is valid for the given name. If the name is not a valid option,False
will be returned.- Return type:
Checks whether name is a valid bond option and value is a valid value for the name. If value is
None
, the function only validates the option name.
- add_option(name, value)¶
- Parameters:
- Returns:
returns
False
if either name or value isNone
, in that case the option is not set. Otherwise, the function does not fail and does not validate the arguments. All validation happens viaNM.Connection.verify
() or do basic validation yourself withNM.SettingBond.validate_option
().Note: Before 1.30, libnm would perform basic validation of the name and the value via
NM.SettingBond.validate_option
() and reject the request by returningFalse
. Since 1.30, libnm no longer rejects any values as the setter is not supposed to perform validation.- Return type:
Add an option to the table. Adding a new name replaces any existing name/value pair that may already exist.
- get_num_options()¶
- Returns:
the number of bonding options
- Return type:
Returns the number of options that should be set for this bond when it is activated. This can be used to retrieve each option individually using
NM.SettingBond.get_option
().
- get_option(idx)¶
- Parameters:
idx (
int
) – index of the desired option, from 0 toNM.SettingBond.get_num_options
() - 1- Returns:
True
on success if the index was valid and an option was found,False
if the index was invalid (ie, greater than the number of options currently held by the setting)- out_name:
on return, the name of the bonding option; this value is owned by the setting and should not be modified
- out_value:
on return, the value of the name of the bonding option; this value is owned by the setting and should not be modified
- Return type:
Given an index, return the value of the bonding option at that index. Indexes are *not* guaranteed to be static across modifications to options done by
NM.SettingBond.add_option
() andNM.SettingBond.remove_option
(), and should not be used to refer to options except for short periods of time such as during option iteration.
- get_option_by_name(name)¶
- Parameters:
name (
str
) – the option name for which to retrieve the value- Returns:
the value, or
None
if the key/value pair was never added to the setting; the value is owned by the setting and must not be modified- Return type:
Returns the value associated with the bonding option specified by name, if it exists.
- get_option_default(name)¶
- Parameters:
name (
str
) – the name of the option- Returns:
the value of the bond option if not overridden by an entry in the
NM.SettingBond
:options
property.- Return type:
- get_option_normalized(name)¶
- Parameters:
name (
str
) – the name of the option- Returns:
the value of the bond option after normalization, which is what NetworkManager will actually apply when activating the connection.
None
if the option won’t be applied to the connection.- Return type:
New in version 1.24.
Property Details¶
- NM.SettingBond.props.options¶
- Name:
options
- Type:
- Default Value:
- Flags:
Dictionary of key/value pairs of bonding options. Both keys and values must be strings. Option names must contain only alphanumeric characters (ie, [a-zA-Z0-9]).