Snapd.Connection

g GObject.Object GObject.Object Snapd.Connection Snapd.Connection GObject.Object->Snapd.Connection

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_gadget ()

get_interface ()

get_manual ()

get_name ()

get_plug ()

get_plug_attribute (name)

get_plug_attribute_names ()

get_slot ()

get_slot_attribute (name)

get_slot_attribute_names ()

get_snap ()

has_plug_attribute (name)

has_slot_attribute (name)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

gadget

bool

r/w/co

True if connection was made by the gadget snap

interface

str

r/w/co

Interface this connection uses

manual

bool

r/w/co

True if connection was made manually

name

str

r/w/co

Name of connection/plug on snap

plug

Snapd.PlugRef

r/w/co

Plug this connection is made with

plug-attrs

GLib.HashTable

r/w/co

Attributes for connected plug

slot

Snapd.SlotRef

r/w/co

Slot this connection is made with

slot-attrs

GLib.HashTable

r/w/co

Attributes for connected slot

snap

str

r/w/co

Snap this connection is made to

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Snapd.Connection(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Snapd.ConnectionClass

Snapd.Connection contains the state of Snap a interface connection.

New in version 1.0.

get_gadget()
Returns:

True if connection was made by the gadget snap.

Return type:

bool

Get if this connection was made by the gadget snap.

New in version 1.48.

get_interface()
Returns:

an interface name.

Return type:

str

Get the interface this connections uses.

New in version 1.48.

get_manual()
Returns:

True if connection was made manually.

Return type:

bool

Get if this connection was made manually.

New in version 1.48.

get_name()
Returns:

a name.

Return type:

str

Get the name of this connection (i.e. a slot or plug name).

New in version 1.0.

Deprecated since version 1.48: Use Snapd.PlugRef.get_plug() or Snapd.SlotRef.get_slot()

get_plug()
Returns:

a reference to a plug.

Return type:

Snapd.PlugRef

Get the plug this connection is made with.

New in version 1.48.

get_plug_attribute(name)
Parameters:

name (str) – an attribute name.

Returns:

an attribute value or None if not set.

Return type:

GLib.Variant or None

Get an attribute for connected plug.

New in version 1.48.

get_plug_attribute_names()
Returns:

a string array of attribute names. Free with GLib.strfreev().

length:

location to write number of attributes or None if not required.

Return type:

([str], length: int)

Get the names of the attributes the connected plug has.

New in version 1.48.

get_slot()
Returns:

a reference to a slot.

Return type:

Snapd.SlotRef

Get the slot this connection is made with.

New in version 1.48.

get_slot_attribute(name)
Parameters:

name (str) – an attribute name.

Returns:

an attribute value or None if not set.

Return type:

GLib.Variant or None

Get an attribute for connected slot.

New in version 1.48.

get_slot_attribute_names()
Returns:

a string array of attribute names. Free with GLib.strfreev().

length:

location to write number of attributes or None if not required.

Return type:

([str], length: int)

Get the names of the attributes the connected slot has.

New in version 1.48.

get_snap()
Returns:

a snap name.

Return type:

str

Get the snap this connection is on.

New in version 1.0.

Deprecated since version 1.48: Use Snapd.PlugRef.get_snap() or Snapd.SlotRef.get_snap()

has_plug_attribute(name)
Parameters:

name (str) – an attribute name.

Returns:

True if this attribute exists.

Return type:

bool

Check if the connected plug has an attribute.

New in version 1.48.

has_slot_attribute(name)
Parameters:

name (str) – an attribute name.

Returns:

True if this attribute exists.

Return type:

bool

Check if the connected slot has an attribute.

New in version 1.48.

Property Details

Snapd.Connection.props.gadget
Name:

gadget

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

True if connection was made by the gadget snap

Snapd.Connection.props.interface
Name:

interface

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Interface this connection uses

Snapd.Connection.props.manual
Name:

manual

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

True if connection was made manually

Snapd.Connection.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Name of connection/plug on snap

Snapd.Connection.props.plug
Name:

plug

Type:

Snapd.PlugRef

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Plug this connection is made with

Snapd.Connection.props.plug_attrs
Name:

plug-attrs

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Attributes for connected plug

Snapd.Connection.props.slot
Name:

slot

Type:

Snapd.SlotRef

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Slot this connection is made with

Snapd.Connection.props.slot_attrs
Name:

slot-attrs

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Attributes for connected slot

Snapd.Connection.props.snap
Name:

snap

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Snap this connection is made to