NM.SettingVpn¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r/w/en |
|||
r/w |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.SettingVpn(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
VPN Settings
- classmethod new()¶
- Returns:
the new empty
NM.SettingVpn
object- Return type:
Creates a new
NM.SettingVpn
object with default values.
- add_data_item(key, item)¶
- Parameters:
Establishes a relationship between key and item internally in the setting which may be retrieved later. Should not be used to store passwords or other secrets, which is what
NM.SettingVpn.add_secret
() is for.Before 1.24, item must not be
None
and not an empty string.`item` can be set to an empty string. It can also be set toNone
to unset the key. In that case, the behavior is as if callingNM.SettingVpn.remove_data_item
().New in version 1.24,.
- add_secret(key, secret)¶
- Parameters:
Establishes a relationship between key and secret internally in the setting which may be retrieved later.
Before 1.24, secret must not be
None
and not an empty string.`secret` can be set to an empty string. It can also be set toNone
to unset the key. In that case, the behavior is as if callingNM.SettingVpn.remove_secret
().New in version 1.24,.
- foreach_data_item(func, *user_data)¶
- Parameters:
func (
NM.VpnIterFunc
) – an user provided function
Iterates all data items stored in this setting. It is safe to add, remove, and modify data items inside func, though any additions or removals made during iteration will not be part of the iteration.
- foreach_secret(func, *user_data)¶
- Parameters:
func (
NM.VpnIterFunc
) – an user provided function
Iterates all secrets stored in this setting. It is safe to add, remove, and modify secrets inside func, though any additions or removals made during iteration will not be part of the iteration.
- get_data_item(key)¶
- Parameters:
key (
str
) – the name of the data item to retrieve- Returns:
the data item, if any
- Return type:
Retrieves the data item of a key/value relationship previously established by
NM.SettingVpn.add_data_item
().
- get_data_keys()¶
- Returns:
a
None
-terminated array containing each data key orNone
if there are no data items.- Return type:
Retrieves every data key inside self, as an array.
New in version 1.12.
- get_num_data_items()¶
- Returns:
the number of VPN plugin specific configuration data items
- Return type:
Gets number of key/value pairs of VPN configuration data.
- get_num_secrets()¶
- Returns:
the number of VPN plugin specific secrets
- Return type:
Gets number of VPN plugin specific secrets in the setting.
- get_persistent()¶
- Returns:
the
NM.SettingVpn
:persistent
property of the setting- Return type:
New in version 1.42.
- get_secret(key)¶
- Parameters:
key (
str
) – the name of the secret to retrieve- Returns:
the secret, if any
- Return type:
Retrieves the secret of a key/value relationship previously established by
NM.SettingVpn.add_secret
().
- get_secret_keys()¶
- Returns:
a
None
-terminated array containing each secret key orNone
if there are no secrets.- Return type:
Retrieves every secret key inside self, as an array.
New in version 1.12.
- get_service_type()¶
- Returns:
the VPN plugin’s service name
- Return type:
Returns the service name of the VPN, which identifies the specific VPN plugin that should be used to connect to this VPN.
- get_timeout()¶
- Returns:
the
NM.SettingVpn
:timeout
property of the setting- Return type:
New in version 1.2.
- get_user_name()¶
- Returns:
the
NM.SettingVpn
:user-name
property of the setting- Return type:
- remove_data_item(key)¶
- Parameters:
key (
str
) – the name of the data item to remove- Returns:
True
if the data item was found and removed from the internal list,False
if it was not.- Return type:
Deletes a key/value relationship previously established by
NM.SettingVpn.add_data_item
().
Property Details¶
- NM.SettingVpn.props.data¶
- Name:
data
- Type:
- Default Value:
- Flags:
Dictionary of key/value pairs of VPN plugin specific data. Both keys and values must be strings.
- NM.SettingVpn.props.persistent¶
- Name:
persistent
- Type:
- Default Value:
- Flags:
If the VPN service supports persistence, and this property is
True
, the VPN will attempt to stay connected across link changes and outages, until explicitly disconnected.
- NM.SettingVpn.props.secrets¶
- Name:
secrets
- Type:
- Default Value:
- Flags:
Dictionary of key/value pairs of VPN plugin specific secrets like passwords or private keys. Both keys and values must be strings.
- NM.SettingVpn.props.service_type¶
- Name:
service-type
- Type:
- Default Value:
- Flags:
D-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin.
- NM.SettingVpn.props.timeout¶
- Name:
timeout
- Type:
- Default Value:
0
- Flags:
Timeout for the VPN service to establish the connection. Some services may take quite a long time to connect. Value of 0 means a default timeout, which is 60 seconds (unless overridden by vpn.timeout in configuration file). Values greater than zero mean timeout in seconds.
New in version 1.2.
- NM.SettingVpn.props.user_name¶
- Name:
user-name
- Type:
- Default Value:
- Flags:
If the VPN connection requires a user name for authentication, that name should be provided here. If the connection is available to more than one user, and the VPN requires each user to supply a different name, then leave this property empty. If this property is empty, NetworkManager will automatically supply the username of the user which requested the VPN connection.