NM.ActiveConnection

g GObject.Object GObject.Object NM.Object NM.Object GObject.Object->NM.Object NM.ActiveConnection NM.ActiveConnection NM.Object->NM.ActiveConnection

Subclasses:

NM.VpnConnection

Methods

Inherited:

NM.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_connection ()

get_connection_type ()

get_controller ()

get_default ()

get_default6 ()

get_devices ()

get_dhcp4_config ()

get_dhcp6_config ()

get_id ()

get_ip4_config ()

get_ip6_config ()

get_master ()

get_specific_object_path ()

get_state ()

get_state_flags ()

get_state_reason ()

get_uuid ()

get_vpn ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Object (2)

Name

Type

Flags

Short Description

connection

NM.RemoteConnection

r

controller

NM.Device

r

default

bool

r

default6

bool

r

devices

GLib.PtrArray

r

dhcp4-config

NM.DhcpConfig

r

dhcp6-config

NM.DhcpConfig

r

id

str

r

ip4-config

NM.IPConfig

r

ip6-config

NM.IPConfig

r

master

NM.Device

r

deprecated

specific-object-path

str

r

state

NM.ActiveConnectionState

r

state-flags

int

r

type

str

r

uuid

str

r

vpn

bool

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

state-changed

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.ActiveConnection(**kwargs)
Bases:

NM.Object

Abstract:

No

Structure:

NM.ActiveConnectionClass

get_connection()
Returns:

the NM.RemoteConnection which this NM.ActiveConnection is an active instance of.

Return type:

NM.RemoteConnection

Gets the NM.RemoteConnection associated with self.

get_connection_type()
Returns:

the type of the NM.Connection that backs the NM.ActiveConnection. This is the internal string used by the connection, and must not be modified.

Return type:

str

Gets the NM.Connection's type.

get_controller()
Returns:

the controller NM.Device of the NM.ActiveConnection.

Return type:

object or None

Gets the controller NM.Device of the connection. This replaces the deprecated NM.ActiveConnection.get_master() method.

New in version 1.44.

get_default()
Returns:

True if the active connection is the default IPv4 connection

Return type:

bool

Whether the active connection is the default IPv4 one (that is, is used for the default IPv4 route and DNS information).

get_default6()
Returns:

True if the active connection is the default IPv6 connection

Return type:

bool

Whether the active connection is the default IPv6 one (that is, is used for the default IPv6 route and DNS information).

get_devices()
Returns:

the GLib.PtrArray containing NM.Devices. This is the internal copy used by the connection, and must not be modified.

Return type:

[NM.Device]

Gets the NM.Devices used for the active connections.

get_dhcp4_config()
Returns:

the IPv4 NM.DhcpConfig, or None if the connection does not use DHCP, or is not in the NM.ActiveConnectionState.ACTIVATED state.

Return type:

NM.DhcpConfig

Gets the current IPv4 NM.DhcpConfig (if any) associated with the NM.ActiveConnection.

get_dhcp6_config()
Returns:

the IPv6 NM.DhcpConfig, or None if the connection does not use DHCPv6, or is not in the NM.ActiveConnectionState.ACTIVATED state.

Return type:

NM.DhcpConfig

Gets the current IPv6 NM.DhcpConfig (if any) associated with the NM.ActiveConnection.

get_id()
Returns:

the ID of the NM.Connection that backs the NM.ActiveConnection. This is the internal string used by the connection, and must not be modified.

Return type:

str

Gets the NM.Connection's ID.

get_ip4_config()
Returns:

the IPv4 NM.IPConfig, or None if the connection is not in the NM.ActiveConnectionState.ACTIVATED state.

Return type:

NM.IPConfig

Gets the current IPv4 NM.IPConfig associated with the NM.ActiveConnection.

get_ip6_config()
Returns:

the IPv6 NM.IPConfig, or None if the connection is not in the NM.ActiveConnectionState.ACTIVATED state.

Return type:

NM.IPConfig

Gets the current IPv6 NM.IPConfig associated with the NM.ActiveConnection.

get_master()
Returns:

the master NM.Device of the NM.ActiveConnection.

Return type:

object or None

Gets the master NM.Device of the connection.

Deprecated since version 1.44: Use NM.ActiveConnection.get_controller() instead.

get_specific_object_path()
Returns:

the specific object’s D-Bus path. This is the internal string used by the connection, and must not be modified.

Return type:

str

Gets the path of the “specific object” used at activation.

Currently, there is no single method that will allow you to automatically turn this into an appropriate NM.Object; you need to know what kind of object it is based on other information. (Eg, if self corresponds to a Wi-Fi connection, then the specific object will be an NM.AccessPoint, and you can resolve it with NM.DeviceWifi.get_access_point_by_path().)

get_state()
Returns:

the state

Return type:

NM.ActiveConnectionState

Gets the active connection’s state.

get_state_flags()
Returns:

the state flags

Return type:

NM.ActivationStateFlags

Gets the active connection’s state flags.

New in version 1.10.

get_state_reason()
Returns:

the reason

Return type:

NM.ActiveConnectionStateReason

Gets the reason for active connection’s state.

New in version 1.8.

get_uuid()
Returns:

the UUID of the NM.Connection that backs the NM.ActiveConnection. This is the internal string used by the connection, and must not be modified.

Return type:

str

Gets the NM.Connection's UUID.

get_vpn()
Returns:

True if the active connection is a VPN connection

Return type:

bool

Whether the active connection is a VPN connection.

Signal Details

NM.ActiveConnection.signals.state_changed(active_connection, state, reason)
Signal Name:

state-changed

Flags:

RUN_FIRST

Parameters:

Property Details

NM.ActiveConnection.props.connection
Name:

connection

Type:

NM.RemoteConnection

Default Value:

None

Flags:

READABLE

The connection that this is an active instance of.

NM.ActiveConnection.props.controller
Name:

controller

Type:

NM.Device

Default Value:

None

Flags:

READABLE

The controller device if one exists. This replaces the deprecated “master” property.

New in version 1.44.

NM.ActiveConnection.props.default
Name:

default

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the active connection is the default IPv4 one.

NM.ActiveConnection.props.default6
Name:

default6

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the active connection is the default IPv6 one.

NM.ActiveConnection.props.devices
Name:

devices

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

The devices of the active connection.

NM.ActiveConnection.props.dhcp4_config
Name:

dhcp4-config

Type:

NM.DhcpConfig

Default Value:

None

Flags:

READABLE

The IPv4 NM.DhcpConfig of the connection.

NM.ActiveConnection.props.dhcp6_config
Name:

dhcp6-config

Type:

NM.DhcpConfig

Default Value:

None

Flags:

READABLE

The IPv6 NM.DhcpConfig of the connection.

NM.ActiveConnection.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE

The active connection’s ID

NM.ActiveConnection.props.ip4_config
Name:

ip4-config

Type:

NM.IPConfig

Default Value:

None

Flags:

READABLE

The IPv4 NM.IPConfig of the connection.

NM.ActiveConnection.props.ip6_config
Name:

ip6-config

Type:

NM.IPConfig

Default Value:

None

Flags:

READABLE

The IPv6 NM.IPConfig of the connection.

NM.ActiveConnection.props.master
Name:

master

Type:

NM.Device

Default Value:

None

Flags:

READABLE

The master device if one exists. Replaced by the “controller” property.

Deprecated since version 1.44.

NM.ActiveConnection.props.specific_object_path
Name:

specific-object-path

Type:

str

Default Value:

None

Flags:

READABLE

The path to the “specific object” of the active connection; see NM.ActiveConnection.get_specific_object_path() for more details.

NM.ActiveConnection.props.state
Name:

state

Type:

NM.ActiveConnectionState

Default Value:

NM.ActiveConnectionState.UNKNOWN

Flags:

READABLE

The state of the active connection.

NM.ActiveConnection.props.state_flags
Name:

state-flags

Type:

int

Default Value:

0

Flags:

READABLE

The state flags of the active connection.

New in version 1.10.

NM.ActiveConnection.props.type
Name:

type

Type:

str

Default Value:

None

Flags:

READABLE

The active connection’s type

NM.ActiveConnection.props.uuid
Name:

uuid

Type:

str

Default Value:

None

Flags:

READABLE

The active connection’s UUID

NM.ActiveConnection.props.vpn
Name:

vpn

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the active connection is a VPN connection.