NM.SettingVpn

g GObject.Object GObject.Object NM.Setting NM.Setting GObject.Object->NM.Setting NM.SettingVpn NM.SettingVpn NM.Setting->NM.SettingVpn

Subclasses:

None

Methods

Inherited:

NM.Setting (21), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_data_item (key, item)

add_secret (key, secret)

foreach_data_item (func, *user_data)

foreach_secret (func, *user_data)

get_data_item (key)

get_data_keys ()

get_num_data_items ()

get_num_secrets ()

get_persistent ()

get_secret (key)

get_secret_keys ()

get_service_type ()

get_timeout ()

get_user_name ()

remove_data_item (key)

remove_secret (key)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

data

GLib.HashTable

r/w

persistent

bool

r/w/en

secrets

GLib.HashTable

r/w

service-type

str

r/w/en

timeout

int

r/w/en

user-name

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingVpn(**kwargs)
Bases:

NM.Setting

Abstract:

No

Structure:

NM.SettingVpnClass

VPN Settings

classmethod new()
Returns:

the new empty NM.SettingVpn object

Return type:

NM.Setting

Creates a new NM.SettingVpn object with default values.

add_data_item(key, item)
Parameters:
  • key (str) – a name that uniquely identifies the given value item

  • item (str or None) – the value to be referenced by key

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 to None to unset the key. In that case, the behavior is as if calling NM.SettingVpn.remove_data_item().

New in version 1.24,.

add_secret(key, secret)
Parameters:
  • key (str) – a name that uniquely identifies the given secret secret

  • secret (str or None) – the secret to be referenced by key

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 to None to unset the key. In that case, the behavior is as if calling NM.SettingVpn.remove_secret().

New in version 1.24,.

foreach_data_item(func, *user_data)
Parameters:

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:

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:

str

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 or None if there are no data items.

Return type:

[str] or None

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:

int

Gets number of key/value pairs of VPN configuration data.

get_num_secrets()
Returns:

the number of VPN plugin specific secrets

Return type:

int

Gets number of VPN plugin specific secrets in the setting.

get_persistent()
Returns:

the NM.SettingVpn :persistent property of the setting

Return type:

bool

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:

str

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 or None if there are no secrets.

Return type:

[str] or None

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:

str

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:

int

New in version 1.2.

get_user_name()
Returns:

the NM.SettingVpn :user-name property of the setting

Return type:

str

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:

bool

Deletes a key/value relationship previously established by NM.SettingVpn.add_data_item().

remove_secret(key)
Parameters:

key (str) – the name of the secret to remove

Returns:

True if the secret was found and removed from the internal list, False if it was not.

Return type:

bool

Deletes a key/value relationship previously established by NM.SettingVpn.add_secret().

Property Details

NM.SettingVpn.props.data
Name:

data

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE

Dictionary of key/value pairs of VPN plugin specific data. Both keys and values must be strings.

NM.SettingVpn.props.persistent
Name:

persistent

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE

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:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.