Snapd.Client

g GObject.Object GObject.Object Snapd.Client Snapd.Client GObject.Object->Snapd.Client

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_from_socket (socket)

abort_change_async (id, cancellable, callback, *user_data)

abort_change_finish (result)

abort_change_sync (id, cancellable)

add_assertions_async (assertions, cancellable, callback, *user_data)

add_assertions_finish (result)

add_assertions_sync (assertions, cancellable)

alias_async (snap, app, alias, progress_callback, progress_callback_data, cancellable, callback, *user_data)

alias_finish (result)

alias_sync (snap, app, alias, progress_callback, progress_callback_data, cancellable)

buy_async (id, amount, currency, cancellable, callback, *user_data)

buy_finish (result)

buy_sync (id, amount, currency, cancellable)

check_buy_async (cancellable, callback, *user_data)

check_buy_finish (result)

check_buy_sync (cancellable)

check_themes_async (gtk_theme_names, icon_theme_names, sound_theme_names, cancellable, callback, *user_data)

check_themes_finish (result)

check_themes_sync (gtk_theme_names, icon_theme_names, sound_theme_names, cancellable)

connect_async (cancellable, callback, *user_data)

connect_finish (result)

connect_interface_async (plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

connect_interface_finish (result)

connect_interface_sync (plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable)

connect_sync (cancellable)

create_user_async (email, flags, cancellable, callback, *user_data)

create_user_finish (result)

create_user_sync (email, flags, cancellable)

create_users_async (cancellable, callback, *user_data)

create_users_finish (result)

create_users_sync (cancellable)

disable_aliases_async (snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)

disable_aliases_finish (result)

disable_aliases_sync (snap, aliases, progress_callback, progress_callback_data, cancellable)

disable_async (name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

disable_finish (result)

disable_sync (name, progress_callback, progress_callback_data, cancellable)

disconnect_interface_async (plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

disconnect_interface_finish (result)

disconnect_interface_sync (plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable)

download_async (name, channel, revision, cancellable, callback, *user_data)

download_finish (result)

download_sync (name, channel, revision, cancellable)

enable_aliases_async (snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)

enable_aliases_finish (result)

enable_aliases_sync (snap, aliases, progress_callback, progress_callback_data, cancellable)

enable_async (name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

enable_finish (result)

enable_sync (name, progress_callback, progress_callback_data, cancellable)

find_async (flags, query, cancellable, callback, *user_data)

find_category_async (flags, category, query, cancellable, callback, *user_data)

find_category_finish (result)

find_category_sync (flags, category, query, cancellable)

find_finish (result)

find_refreshable_async (cancellable, callback, *user_data)

find_refreshable_finish (result)

find_refreshable_sync (cancellable)

find_section_async (flags, section, query, cancellable, callback, *user_data)

find_section_finish (result)

find_section_sync (flags, section, query, cancellable)

find_sync (flags, query, cancellable)

follow_logs_async (names, log_callback, log_callback_data, cancellable, callback, *user_data)

follow_logs_finish (result)

follow_logs_sync (names, log_callback, log_callback_data, cancellable)

get_aliases_async (cancellable, callback, *user_data)

get_aliases_finish (result)

get_aliases_sync (cancellable)

get_allow_interaction ()

get_apps2_async (flags, snaps, cancellable, callback, *user_data)

get_apps2_finish (result)

get_apps2_sync (flags, snaps, cancellable)

get_apps_async (flags, cancellable, callback, *user_data)

get_apps_finish (result)

get_apps_sync (flags, cancellable)

get_assertions_async (type, cancellable, callback, *user_data)

get_assertions_finish (result)

get_assertions_sync (type, cancellable)

get_auth_data ()

get_categories_async (cancellable, callback, *user_data)

get_categories_finish (result)

get_categories_sync (cancellable)

get_change_async (id, cancellable, callback, *user_data)

get_change_finish (result)

get_change_sync (id, cancellable)

get_changes_async (filter, snap_name, cancellable, callback, *user_data)

get_changes_finish (result)

get_changes_sync (filter, snap_name, cancellable)

get_connections2_async (flags, snap, interface, cancellable, callback, *user_data)

get_connections2_finish (result)

get_connections2_sync (flags, snap, interface, cancellable)

get_connections_async (cancellable, callback, *user_data)

get_connections_finish (result)

get_connections_sync (cancellable)

get_icon_async (name, cancellable, callback, *user_data)

get_icon_finish (result)

get_icon_sync (name, cancellable)

get_interfaces2_async (flags, names, cancellable, callback, *user_data)

get_interfaces2_finish (result)

get_interfaces2_sync (flags, names, cancellable)

get_interfaces_async (cancellable, callback, *user_data)

get_interfaces_finish (result)

get_interfaces_sync (cancellable)

get_logs_async (names, n, cancellable, callback, *user_data)

get_logs_finish (result)

get_logs_sync (names, n, cancellable)

get_maintenance ()

get_sections_async (cancellable, callback, *user_data)

get_sections_finish (result)

get_sections_sync (cancellable)

get_snap_async (name, cancellable, callback, *user_data)

get_snap_conf_async (name, keys, cancellable, callback, *user_data)

get_snap_conf_finish (result)

get_snap_conf_sync (name, keys, cancellable)

get_snap_finish (result)

get_snap_sync (name, cancellable)

get_snaps_async (flags, names, cancellable, callback, *user_data)

get_snaps_finish (result)

get_snaps_sync (flags, names, cancellable)

get_socket_path ()

get_system_information_async (cancellable, callback, *user_data)

get_system_information_finish (result)

get_system_information_sync (cancellable)

get_user_agent ()

get_users_async (cancellable, callback, *user_data)

get_users_finish (result)

get_users_sync (cancellable)

install2_async (flags, name, channel, revision, progress_callback, progress_callback_data, cancellable, callback, *user_data)

install2_finish (result)

install2_sync (flags, name, channel, revision, progress_callback, progress_callback_data, cancellable)

install_async (name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)

install_finish (result)

install_stream_async (flags, stream, progress_callback, progress_callback_data, cancellable, callback, *user_data)

install_stream_finish (result)

install_stream_sync (flags, stream, progress_callback, progress_callback_data, cancellable)

install_sync (name, channel, progress_callback, progress_callback_data, cancellable)

install_themes_async (gtk_theme_names, icon_theme_names, sound_theme_names, progress_callback, progress_callback_data, cancellable, callback, *user_data)

install_themes_finish (result)

install_themes_sync (gtk_theme_names, icon_theme_names, sound_theme_names, progress_callback, progress_callback_data, cancellable)

list_async (cancellable, callback, *user_data)

list_finish (result)

list_one_async (name, cancellable, callback, *user_data)

list_one_finish (result)

list_one_sync (name, cancellable)

list_sync (cancellable)

login2_async (email, password, otp, cancellable, callback, *user_data)

login2_finish (result)

login2_sync (email, password, otp, cancellable)

login_async (email, password, otp, cancellable, callback, *user_data)

login_finish (result)

login_sync (email, password, otp, cancellable)

logout_async (id, cancellable, callback, *user_data)

logout_finish (result)

logout_sync (id, cancellable)

prefer_async (snap, progress_callback, progress_callback_data, cancellable, callback, *user_data)

prefer_finish (result)

prefer_sync (snap, progress_callback, progress_callback_data, cancellable)

refresh_all_async (progress_callback, progress_callback_data, cancellable, callback, *user_data)

refresh_all_finish (result)

refresh_all_sync (progress_callback, progress_callback_data, cancellable)

refresh_async (name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)

refresh_finish (result)

refresh_sync (name, channel, progress_callback, progress_callback_data, cancellable)

remove2_async (flags, name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

remove2_finish (result)

remove2_sync (flags, name, progress_callback, progress_callback_data, cancellable)

remove_async (name, progress_callback, progress_callback_data, cancellable, callback, *user_data)

remove_finish (result)

remove_sync (name, progress_callback, progress_callback_data, cancellable)

reset_aliases_async (snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)

reset_aliases_finish (result)

reset_aliases_sync (snap, aliases, progress_callback, progress_callback_data, cancellable)

run_snapctl2_async (context_id, args, cancellable, callback, *user_data)

run_snapctl2_finish (result)

run_snapctl2_sync (context_id, args, cancellable)

run_snapctl_async (context_id, args, cancellable, callback, *user_data)

run_snapctl_finish (result)

run_snapctl_sync (context_id, args, cancellable)

set_allow_interaction (allow_interaction)

set_auth_data (auth_data)

set_snap_conf_async (name, key_values, cancellable, callback, *user_data)

set_snap_conf_finish (result)

set_snap_conf_sync (name, key_values, cancellable)

set_socket_path (socket_path)

set_user_agent (user_agent)

switch_async (name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)

switch_finish (result)

switch_sync (name, channel, progress_callback, progress_callback_data, cancellable)

try_async (path, progress_callback, progress_callback_data, cancellable, callback, *user_data)

try_finish (result)

try_sync (path, progress_callback, progress_callback_data, cancellable)

unalias_async (snap, alias, progress_callback, progress_callback_data, cancellable, callback, *user_data)

unalias_finish (result)

unalias_sync (snap, alias, progress_callback, progress_callback_data, cancellable)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Snapd.Client(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Snapd.ClientClass

Snapd.Client contains connection state with snapd.

New in version 1.0.

classmethod new()
Returns:

a new Snapd.Client

Return type:

Snapd.Client

Create a new client to talk to snapd.

New in version 1.0.

classmethod new_from_socket(socket)
Parameters:

socket (Gio.Socket) – A Gio.Socket that is connected to snapd.

Returns:

a new Snapd.Client

Return type:

Snapd.Client

Create a new client to talk on an existing socket.

New in version 1.5.

abort_change_async(id, cancellable, callback, *user_data)
Parameters:

Asynchronously abort a change. See Snapd.Client.abort_change_sync() for more information.

New in version 1.30.

abort_change_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.Change or None on error.

Return type:

Snapd.Change

Complete request started with Snapd.Client.abort_change_async(). See Snapd.Client.abort_change_sync() for more information.

New in version 1.30.

abort_change_sync(id, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.Change or None on error.

Return type:

Snapd.Change

Get information on a change.

New in version 1.30.

add_assertions_async(assertions, cancellable, callback, *user_data)
Parameters:

Asynchronously add an assertion. See Snapd.Client.add_assertions_sync() for more information.

New in version 1.8.

add_assertions_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.add_assertions_async(). See Snapd.Client.add_assertions_sync() for more information.

New in version 1.8.

add_assertions_sync(assertions, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Add an assertion.

New in version 1.8.

alias_async(snap, app, alias, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously create an alias to an app. See Snapd.Client.alias_sync() for more information.

New in version 1.25.

alias_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.alias_async(). See Snapd.Client.alias_sync() for more information.

New in version 1.25.

alias_sync(snap, app, alias, progress_callback, progress_callback_data, cancellable)
Parameters:
  • snap (str) – the name of the snap to modify.

  • app (str) – an app in the snap to make the alias to.

  • alias (str) – the name of the alias (i.e. the command that will run this app).

  • progress_callback (Snapd.ProgressCallback or None) – function to callback with progress.

  • progress_callback_data (object or None) – user data to pass to progress_callback.

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Return type:

bool

Create an alias to an app.

New in version 1.25.

buy_async(id, amount, currency, cancellable, callback, *user_data)
Parameters:

Asynchronously buy a snap from the store. See Snapd.Client.buy_sync() for more information.

New in version 1.3.

buy_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.buy_async(). See Snapd.Client.buy_sync() for more information.

New in version 1.3.

buy_sync(id, amount, currency, cancellable)
Parameters:
  • id (str) – id of snap to buy.

  • amount (float) – amount of currency to spend, e.g. 0.99.

  • currency (str) – the currency to buy with as an ISO 4217 currency code, e.g. “NZD”.

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Buy a snap from the store. Once purchased, this snap can be installed with Snapd.Client.install2_sync().

New in version 1.3.

check_buy_async(cancellable, callback, *user_data)
Parameters:

Asynchronously check if able to buy snaps. See Snapd.Client.check_buy_sync() for more information.

New in version 1.3.

check_buy_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.check_buy_async(). See Snapd.Client.check_buy_sync() for more information.

New in version 1.3.

check_buy_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if able to buy snaps or False on error.

Return type:

bool

Check if able to buy snaps.

New in version 1.3.

check_themes_async(gtk_theme_names, icon_theme_names, sound_theme_names, cancellable, callback, *user_data)
Parameters:

Asynchronously check for snaps providing the requested desktop themes. See Snapd.Client.check_themes_sync() for more information.

New in version 1.60.

check_themes_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success.

gtk_theme_status:

status of GTK themes.

icon_theme_status:

status of icon themes.

sound_theme_status:

status of sound themes.

Return type:

(bool, gtk_theme_status: {str: Snapd.ThemeStatus}, icon_theme_status: {str: Snapd.ThemeStatus}, sound_theme_status: {str: Snapd.ThemeStatus})

Complete request started with Snapd.Client.check_themes_async(). See Snapd.Client.check_themes_sync() for more information.

New in version 1.60.

check_themes_sync(gtk_theme_names, icon_theme_names, sound_theme_names, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

gtk_theme_status:

status of GTK themes.

icon_theme_status:

status of icon themes.

sound_theme_status:

status of sound themes.

Return type:

(bool, gtk_theme_status: {str: Snapd.ThemeStatus}, icon_theme_status: {str: Snapd.ThemeStatus}, sound_theme_status: {str: Snapd.ThemeStatus})

Check the status of snap packaged versions of named desktop themes. For each theme, it will determine whether it is already installed, uninstalled but available on the store, or unavailable.

New in version 1.60.

connect_async(cancellable, callback, *user_data)
Parameters:

This method is no longer required and does nothing, snapd-glib now connects on demand.

New in version 1.3.

Deprecated since version 1.24.

connect_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True if successfully connected to snapd.

Return type:

bool

Complete request started with Snapd.Client.connect_async(). See Snapd.Client.connect_sync() for more information.

New in version 1.3.

connect_interface_async(plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously connect two interfaces together. See Snapd.Client.connect_interface_sync() for more information.

New in version 1.0.

connect_interface_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.connect_interface_async(). See Snapd.Client.connect_interface_sync() for more information.

New in version 1.0.

connect_interface_sync(plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable)
Parameters:
  • plug_snap (str) – name of snap containing plug.

  • plug_name (str) – name of plug to connect.

  • slot_snap (str) – name of snap containing socket.

  • slot_name (str) – name of slot to connect.

  • progress_callback (Snapd.ProgressCallback or None) – function to callback with progress.

  • progress_callback_data (object or None) – user data to pass to progress_callback.

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Connect two interfaces together. An asynchronous version of this function is Snapd.Client.connect_interface_async().

New in version 1.0.

connect_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True if successfully connected to snapd.

Return type:

bool

This method is no longer required and does nothing, snapd-glib now connects on demand.

New in version 1.0.

create_user_async(email, flags, cancellable, callback, *user_data)
Parameters:

Asynchronously create a local user account. See Snapd.Client.create_user_sync() for more information.

New in version 1.3.

create_user_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.UserInformation or None on error.

Return type:

Snapd.UserInformation

Complete request started with Snapd.Client.create_user_async(). See Snapd.Client.create_user_sync() for more information.

New in version 1.3.

create_user_sync(email, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.UserInformation or None on error.

Return type:

Snapd.UserInformation

Create a local user account for the given user.

New in version 1.3.

create_users_async(cancellable, callback, *user_data)
Parameters:

Asynchronously create local user accounts using the system-user assertions that are valid for this device. See Snapd.Client.create_users_sync() for more information.

New in version 1.3.

create_users_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.UserInformation or None on error.

Return type:

[Snapd.UserInformation]

Complete request started with Snapd.Client.create_users_async(). See Snapd.Client.create_users_sync() for more information.

New in version 1.3.

create_users_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.UserInformation or None on error.

Return type:

[Snapd.UserInformation]

Create local user accounts using the system-user assertions that are valid for this device.

New in version 1.3.

disable_aliases_async(snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously change the state of aliases. See Snapd.Client.disable_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.unalias_async()

disable_aliases_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.disable_aliases_async(). See Snapd.Client.disable_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.unalias_finish()

disable_aliases_sync(snap, aliases, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Change the state of aliases.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.unalias_sync()

disable_async(name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously disable an installed snap. See Snapd.Client.disable_sync() for more information.

New in version 1.0.

disable_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.disable_async(). See Snapd.Client.disable_sync() for more information.

New in version 1.0.

disable_sync(name, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Disable an installed snap.

New in version 1.0.

disconnect_interface_async(plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously disconnect two interfaces. See Snapd.Client.disconnect_interface_sync() for more information.

New in version 1.0.

disconnect_interface_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.disconnect_interface_async(). See Snapd.Client.disconnect_interface_sync() for more information.

New in version 1.0.

disconnect_interface_sync(plug_snap, plug_name, slot_snap, slot_name, progress_callback, progress_callback_data, cancellable)
Parameters:
  • plug_snap (str) – name of snap containing plug.

  • plug_name (str) – name of plug to disconnect.

  • slot_snap (str) – name of snap containing socket.

  • slot_name (str) – name of slot to disconnect.

  • progress_callback (Snapd.ProgressCallback or None) – function to callback with progress.

  • progress_callback_data (object or None) – user data to pass to progress_callback.

  • cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Disconnect two interfaces.

New in version 1.0.

download_async(name, channel, revision, cancellable, callback, *user_data)
Parameters:

Asynchronously download a snap. See Snapd.Client.download_sync() for more information.

New in version 1.54.

download_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

the snap contents or None on error.

Return type:

GLib.Bytes

Complete request started with Snapd.Client.download_async(). See Snapd.Client.download_sync() for more information.

New in version 1.54.

download_sync(name, channel, revision, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the snap contents or None on error.

Return type:

GLib.Bytes

Download the given snap.

New in version 1.54.

enable_aliases_async(snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously change the state of aliases. See Snapd.Client.enable_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.alias_async()

enable_aliases_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.enable_aliases_async(). See Snapd.Client.enable_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.unalias_finish()

enable_aliases_sync(snap, aliases, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Change the state of aliases.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.alias_sync()

enable_async(name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously enable an installed snap. See Snapd.Client.enable_sync() for more information.

New in version 1.0.

enable_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.enable_async(). See Snapd.Client.enable_sync() for more information.

New in version 1.0.

enable_sync(name, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Enable an installed snap.

New in version 1.0.

find_async(flags, query, cancellable, callback, *user_data)
Parameters:

Asynchronously find snaps in the store. See Snapd.Client.find_sync() for more information.

New in version 1.0.

find_category_async(flags, category, query, cancellable, callback, *user_data)
Parameters:

Asynchronously find snaps in the store. See Snapd.Client.find_category_sync() for more information.

New in version 1.64.

find_category_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Complete request started with Snapd.Client.find_async(). See Snapd.Client.find_sync() for more information.

New in version 1.64.

find_category_sync(flags, category, query, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Find snaps in the store.

New in version 1.64.

find_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Complete request started with Snapd.Client.find_async(). See Snapd.Client.find_sync() for more information.

New in version 1.0.

find_refreshable_async(cancellable, callback, *user_data)
Parameters:

Asynchronously find snaps in store that are newer revisions than locally installed versions. See Snapd.Client.find_refreshable_sync() for more information.

New in version 1.8.

find_refreshable_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Complete request started with Snapd.Client.find_refreshable_async(). See Snapd.Client.find_refreshable_sync() for more information.

New in version 1.5.

find_refreshable_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Find snaps in store that are newer revisions than locally installed versions.

New in version 1.8.

find_section_async(flags, section, query, cancellable, callback, *user_data)
Parameters:

Asynchronously find snaps in the store. See Snapd.Client.find_section_sync() for more information.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.find_category_async()

find_section_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Complete request started with Snapd.Client.find_async(). See Snapd.Client.find_sync() for more information.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.find_category_finish()

find_section_sync(flags, section, query, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Find snaps in the store.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.find_category_sync()

find_sync(flags, query, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

suggested_currency:

location to store the ISO 4217 currency that is suggested to purchase with.

Return type:

([Snapd.Snap], suggested_currency: str)

Find snaps in the store.

New in version 1.0.

follow_logs_async(names, log_callback, log_callback_data, cancellable, callback, *user_data)
Parameters:

Follow logs for snap services. This call will only complete if snapd closes the connection and will stop any other request on this client from being sent.

New in version 1.64.

follow_logs_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Complete request started with Snapd.Client.follow_logs_async(). See Snapd.Client.follow_logs_sync() for more information.

New in version 1.64.

follow_logs_sync(names, log_callback, log_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Follow logs for snap services. This call will only complete if snapd closes the connection and will stop any other request on this client from being sent.

New in version 1.64.

get_aliases_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get the available aliases. See Snapd.Client.get_aliases_sync() for more information.

New in version 1.8.

get_aliases_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Alias or None on error.

Return type:

[Snapd.Alias]

Complete request started with Snapd.Client.get_aliases_async(). See Snapd.Client.get_aliases_sync() for more information.

New in version 1.8.

get_aliases_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.Alias or None on error.

Return type:

[Snapd.Alias]

Get the available aliases.

New in version 1.8.

get_allow_interaction()
Returns:

True if interaction is allowed.

Return type:

bool

Get whether snapd operations are allowed to interact with the user.

New in version 1.19.

get_apps2_async(flags, snaps, cancellable, callback, *user_data)
Parameters:

Asynchronously get information on installed apps. See Snapd.Client.get_apps2_sync() for more information.

New in version 1.45.

get_apps2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.App or None on error.

Return type:

[Snapd.App]

Complete request started with Snapd.Client.get_apps2_async(). See Snapd.Client.get_apps2_sync() for more information.

New in version 1.45.

get_apps2_sync(flags, snaps, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.App or None on error.

Return type:

[Snapd.App]

Get information on installed apps.

New in version 1.45.

get_apps_async(flags, cancellable, callback, *user_data)
Parameters:

Asynchronously get information on installed apps. See Snapd.Client.get_apps_sync() for more information.

New in version 1.25.

Deprecated since version 1.45: Use Snapd.Client.get_apps2_async()

get_apps_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.App or None on error.

Return type:

[Snapd.App]

Complete request started with Snapd.Client.get_apps_async(). See Snapd.Client.get_apps_sync() for more information.

New in version 1.25.

Deprecated since version 1.45: Use Snapd.Client.get_apps2_finish()

get_apps_sync(flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.App or None on error.

Return type:

[Snapd.App]

Get information on installed apps.

New in version 1.25.

Deprecated since version 1.45: Use Snapd.Client.get_apps2_sync()

get_assertions_async(type, cancellable, callback, *user_data)
Parameters:

Asynchronously get assertions. See Snapd.Client.get_assertions_sync() for more information.

New in version 1.8.

get_assertions_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of assertions or None on error.

Return type:

[str]

Complete request started with Snapd.Client.get_assertions_async(). See Snapd.Client.get_assertions_sync() for more information.

New in version 1.8.

get_assertions_sync(type, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of assertions or None on error.

Return type:

[str]

Get assertions.

New in version 1.8.

get_auth_data()
Returns:

a Snapd.AuthData or None.

Return type:

Snapd.AuthData or None

Get the authorization data that is used for requests.

New in version 1.0.

get_categories_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get the store categories. See Snapd.Client.get_categories_sync() for more information.

New in version 1.64.

get_categories_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.CategoryDetails or None on error.

Return type:

[Snapd.CategoryDetails]

Complete request started with Snapd.Client.get_categories_async(). See Snapd.Client.get_categories_sync() for more information.

New in version 1.64.

get_categories_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.CategoryDetails or None on error.

Return type:

[Snapd.CategoryDetails]

Get the store categories.

New in version 1.64.

get_change_async(id, cancellable, callback, *user_data)
Parameters:

Asynchronously get information on a change. See Snapd.Client.get_change_sync() for more information.

New in version 1.29.

get_change_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.Change or None on error.

Return type:

Snapd.Change

Complete request started with Snapd.Client.get_change_async(). See Snapd.Client.get_change_sync() for more information.

New in version 1.29.

get_change_sync(id, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.Change or None on error.

Return type:

Snapd.Change

Get information on a change.

New in version 1.29.

get_changes_async(filter, snap_name, cancellable, callback, *user_data)
Parameters:

Asynchronously get changes that have occurred / are occurring on the snap daemon. See Snapd.Client.get_changes_sync() for more information.

New in version 1.29.

get_changes_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Change or None on error.

Return type:

[Snapd.Change]

Complete request started with Snapd.Client.get_changes_async(). See Snapd.Client.get_changes_sync() for more information.

New in version 1.29.

get_changes_sync(filter, snap_name, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Change or None on error.

Return type:

[Snapd.Change]

Get changes that have occurred / are occurring on the snap daemon.

New in version 1.29.

get_connections2_async(flags, snap, interface, cancellable, callback, *user_data)
Parameters:

Asynchronously get the installed snap connections. See Snapd.Client.get_connections_sync() for more information.

New in version 1.49.

get_connections2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

established:

the location to store the array of connections or None.

undesired:

the location to store the array of auto-connected connections that have been manually disconnected or None.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, established: [Snapd.Connection], undesired: [Snapd.Connection], plugs: [Snapd.Plug], slots: [Snapd.Slot])

Complete request started with Snapd.Client.get_connections_async(). See Snapd.Client.get_connections_sync() for more information.

New in version 1.49.

get_connections2_sync(flags, snap, interface, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

established:

the location to store the array of connections or None.

undesired:

the location to store the array of auto-connected connections that have been manually disconnected or None.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, established: [Snapd.Connection], undesired: [Snapd.Connection], plugs: [Snapd.Plug], slots: [Snapd.Slot])

Get the installed snap connections.

New in version 1.49.

get_connections_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get the installed snap connections. See Snapd.Client.get_connections_sync() for more information.

New in version 1.48.

Deprecated since version 1.49: Use Snapd.Client.get_connections2_async()

get_connections_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

established:

the location to store the array of connections or None.

undesired:

the location to store the array of auto-connected connections that have been manually disconnected or None.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, established: [Snapd.Connection], undesired: [Snapd.Connection], plugs: [Snapd.Plug], slots: [Snapd.Slot])

Complete request started with Snapd.Client.get_connections_async(). See Snapd.Client.get_connections_sync() for more information.

New in version 1.48.

Deprecated since version 1.49: Use Snapd.Client.get_connections2_finish()

get_connections_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True on success or False on error.

established:

the location to store the array of connections or None.

undesired:

the location to store the array of auto-connected connections that have been manually disconnected or None.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, established: [Snapd.Connection], undesired: [Snapd.Connection], plugs: [Snapd.Plug], slots: [Snapd.Slot])

Get the installed snap connections.

New in version 1.48.

Deprecated since version 1.49: Use Snapd.Client.get_connections2_sync()

get_icon_async(name, cancellable, callback, *user_data)
Parameters:

Asynchronously get the icon for an installed snap. See Snapd.Client.get_icon_sync() for more information.

New in version 1.0.

get_icon_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.Icon or None on error.

Return type:

Snapd.Icon

Complete request started with Snapd.Client.get_icon_async(). See Snapd.Client.get_icon_sync() for more information.

New in version 1.0.

get_icon_sync(name, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.Icon or None on error.

Return type:

Snapd.Icon

Get the icon for an installed snap.

New in version 1.0.

get_interfaces2_async(flags, names, cancellable, callback, *user_data)
Parameters:

Asynchronously get the installed snap interfaces. See Snapd.Client.get_interfaces2_sync() for more information.

New in version 1.48.

get_interfaces2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Interface or None on error.

Return type:

[Snapd.Interface]

Complete request started with Snapd.Client.get_interfaces2_async(). See Snapd.Client.get_interfaces2_sync() for more information.

New in version 1.48.

get_interfaces2_sync(flags, names, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the available interfaces.

Return type:

[Snapd.Interface]

Get information about the available snap interfaces.

New in version 1.48.

get_interfaces_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get the installed snap interfaces. See Snapd.Client.get_interfaces_sync() for more information.

New in version 1.0.

Deprecated since version 1.48: Use Snapd.Client.get_connections2_async()

get_interfaces_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, plugs: [Snapd.Plug], slots: [Snapd.Slot])

Complete request started with Snapd.Client.get_interfaces_async(). See Snapd.Client.get_interfaces_sync() for more information.

New in version 1.0.

Deprecated since version 1.48: Use Snapd.Client.get_connections2_finish()

get_interfaces_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True on success or False on error.

plugs:

the location to store the array of Snapd.Plug or None.

slots:

the location to store the array of Snapd.Slot or None.

Return type:

(bool, plugs: [Snapd.Plug], slots: [Snapd.Slot])

Get the installed snap interfaces.

New in version 1.0.

Deprecated since version 1.48: Use Snapd.Client.get_connections_sync()

get_logs_async(names, n, cancellable, callback, *user_data)
Parameters:

Asynchronously get logs for snap services. See Snapd.Client.get_logs_sync() for more information.

New in version 1.64.

get_logs_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Log or None on error.

Return type:

[Snapd.Log]

Complete request started with Snapd.Client.get_logs_async(). See Snapd.Client.get_logs_sync() for more information.

New in version 1.64.

get_logs_sync(names, n, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Log or None on error.

Return type:

[Snapd.Log]

Get logs for snap services.

New in version 1.64.

get_maintenance()
Returns:

a Snapd.Maintenance or None.

Return type:

Snapd.Maintenance or None

Get the maintenance information reported by snapd or None if no maintenance is in progress. This information is updated after every request.

New in version 1.45.

get_sections_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get the store sections. See Snapd.Client.get_sections_sync() for more information.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.get_categories_async()

get_sections_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of section names or None on error.

Return type:

[str]

Complete request started with Snapd.Client.get_sections_async(). See Snapd.Client.get_sections_sync() for more information.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.get_categories_finish()

get_sections_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of section names or None on error.

Return type:

[str]

Get the store sections.

New in version 1.7.

Deprecated since version 1.64: Use Snapd.Client.get_categories_sync()

get_snap_async(name, cancellable, callback, *user_data)
Parameters:

Asynchronously get information of a single installed snap. See Snapd.Client.get_snap_sync() for more information.

New in version 1.42.

get_snap_conf_async(name, keys, cancellable, callback, *user_data)
Parameters:

Asynchronously get configuration for a snap. See Snapd.Client.get_snap_conf_sync() for more information.

New in version 1.48.

get_snap_conf_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a table of configuration values or None on error.

Return type:

{str: GLib.Variant}

Complete request started with Snapd.Client.get_snap_conf_async(). See Snapd.Client.get_snap_conf_sync() for more information.

New in version 1.48.

get_snap_conf_sync(name, keys, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a table of configuration values or None on error.

Return type:

{str: GLib.Variant}

Get configuration for a snap. System configuration is stored using the name “system”.

New in version 1.48.

get_snap_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.Snap or None on error.

Return type:

Snapd.Snap

Complete request started with Snapd.Client.get_snap_async(). See Snapd.Client.get_snap_sync() for more information.

New in version 1.42.

get_snap_sync(name, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.Snap or None on error.

Return type:

Snapd.Snap

Get information of a single installed snap. If the snap does not exist an error occurs.

New in version 1.42.

get_snaps_async(flags, names, cancellable, callback, *user_data)
Parameters:

Asynchronously get information on installed snaps. See Snapd.Client.get_snaps_sync() for more information.

New in version 1.42.

get_snaps_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Complete request started with Snapd.Client.get_snaps_async(). See Snapd.Client.get_snaps_sync() for more information.

New in version 1.42.

get_snaps_sync(flags, names, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Get information on installed snaps (snaps with status Snapd.SnapStatus.ACTIVE). If flags contains Snapd.GetSnapsFlags.INCLUDE_INACTIVE then also return snaps with status Snapd.SnapStatus.INSTALLED.

If names is not None and contains at least one name only snaps that match these names are returned. If a snap is not installed it is not returned (no error is generated).

New in version 1.42.

get_socket_path()
Returns:

socket path.

Return type:

str

Get the unix socket path to connect to snapd with.

New in version 1.24.

get_system_information_async(cancellable, callback, *user_data)
Parameters:

Request system information asynchronously from snapd. See Snapd.Client.get_system_information_sync() for more information.

New in version 1.0.

get_system_information_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.SystemInformation or None on error.

Return type:

Snapd.SystemInformation

Complete request started with Snapd.Client.get_system_information_async(). See Snapd.Client.get_system_information_sync() for more information.

New in version 1.0.

get_system_information_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

a Snapd.SystemInformation or None on error.

Return type:

Snapd.SystemInformation

Request system information from snapd. While this blocks, snapd is expected to return the information quickly.

New in version 1.0.

get_user_agent()
Returns:

user agent or None if none set.

Return type:

str or None

Get the HTTP user-agent that is sent with each request to snapd.

New in version 1.16.

get_users_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get user accounts that are valid for this device. See Snapd.Client.get_users_sync() for more information.

New in version 1.26.

get_users_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.UserInformation or None on error.

Return type:

[Snapd.UserInformation]

Complete request started with Snapd.Client.get_users_async(). See Snapd.Client.get_users_sync() for more information.

New in version 1.26.

get_users_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.UserInformation or None on error.

Return type:

[Snapd.UserInformation]

Get user accounts that are valid for this device.

New in version 1.26.

install2_async(flags, name, channel, revision, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously install a snap from the store. See Snapd.Client.install2_sync() for more information.

New in version 1.12.

install2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.install2_async(). See Snapd.Client.install2_sync() for more information.

New in version 1.12.

install2_sync(flags, name, channel, revision, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Install a snap from the store.

New in version 1.12.

install_async(name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously install a snap from the store. See Snapd.Client.install_sync() for more information.

New in version 1.0.

Deprecated since version 1.12: Use Snapd.Client.install2_async()

install_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.install_async(). See Snapd.Client.install_sync() for more information.

New in version 1.0.

Deprecated since version 1.12: Use Snapd.Client.install2_finish()

install_stream_async(flags, stream, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously install a snap. See Snapd.Client.install_stream_sync() for more information.

New in version 1.9.

install_stream_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.install_stream_async(). See Snapd.Client.install_stream_sync() for more information.

New in version 1.9.

install_stream_sync(flags, stream, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Install a snap. The snap contents are provided in the form of an input stream. To install from a local file, do the following:

g_autoptr(GFile) file = g_file_new_for_path (path_to_snap_file);
g_autoptr(GInputStream) stream = g_file_read (file, cancellable, &error);
snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error);
\]

Or if you have the file in memory you can use:

|[
g_autoptr(GInputStream) stream = g_memory_input_stream_new_from_data (data, data_length, free_data);
snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error);
\]

New in version 1.9.

install_sync(name, channel, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Install a snap from the store.

New in version 1.0.

Deprecated since version 1.12: Use Snapd.Client.install2_sync()

install_themes_async(gtk_theme_names, icon_theme_names, sound_theme_names, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously install snaps that provide the requested desktop themes. See Snapd.Client.install_themes_sync() for more information.

New in version 1.60.

install_themes_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Complete request started with Snapd.Client.install_themes_async(). See Snapd.Client.install_themes_sync() for more information.

New in version 1.60.

install_themes_sync(gtk_theme_names, icon_theme_names, sound_theme_names, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

Install snaps that provide the named desktop themes. If all the named themes are in the “installed” or “unavailable” states, then an error will be returned.

New in version 1.60.

list_async(cancellable, callback, *user_data)
Parameters:

Asynchronously get information on all installed snaps. See Snapd.Client.list_sync() for more information.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snaps_async()

list_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Complete request started with Snapd.Client.list_async(). See Snapd.Client.list_sync() for more information.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snaps_finish()

list_one_async(name, cancellable, callback, *user_data)
Parameters:

Asynchronously get information of a single installed snap. See Snapd.Client.list_one_sync() for more information.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snap_async()

list_one_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.Snap or None on error.

Return type:

Snapd.Snap

Complete request started with Snapd.Client.list_one_async(). See Snapd.Client.list_one_sync() for more information.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snap_finish()

list_one_sync(name, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.Snap or None on error.

Return type:

Snapd.Snap

Get information of a single installed snap.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snap_sync()

list_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

an array of Snapd.Snap or None on error.

Return type:

[Snapd.Snap]

Get information on all installed snaps.

New in version 1.0.

Deprecated since version 1.42: Use Snapd.Client.get_snaps_sync()

login2_async(email, password, otp, cancellable, callback, *user_data)
Parameters:

Asynchronously get authorization to install/remove snaps. See Snapd.Client.login2_sync() for more information.

New in version 1.26.

login2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.UserInformation or None on error.

Return type:

Snapd.UserInformation

Complete request started with Snapd.Client.login2_async(). See Snapd.Client.login2_sync() for more information.

New in version 1.26.

login2_sync(email, password, otp, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.UserInformation or None on error.

Return type:

Snapd.UserInformation

Log in to snapd and get authorization to install/remove snaps.

New in version 1.26.

login_async(email, password, otp, cancellable, callback, *user_data)
Parameters:

Asynchronously get authorization to install/remove snaps. See Snapd.Client.login_sync() for more information.

New in version 1.0.

Deprecated since version 1.26: Use Snapd.Client.login2_async()

login_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a Snapd.AuthData or None on error.

Return type:

Snapd.AuthData

Complete request started with Snapd.Client.login_async(). See Snapd.Client.login_sync() for more information.

New in version 1.0.

Deprecated since version 1.26: Use Snapd.Client.login2_finish()

login_sync(email, password, otp, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Snapd.AuthData or None on error.

Return type:

Snapd.AuthData

Log in to snapd and get authorization to install/remove snaps.

New in version 1.0.

Deprecated since version 1.26: Use Snapd.Client.login2_sync()

logout_async(id, cancellable, callback, *user_data)
Parameters:

Asynchronously log out from the snap store. See Snapd.Client.logout_sync() for more information.

New in version 1.55.

logout_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.logout_async(). See Snapd.Client.logout_sync() for more information.

New in version 1.55.

logout_sync(id, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Log out from snapd.

New in version 1.55.

prefer_async(snap, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously ???. See Snapd.Client.prefer_sync() for more information.

New in version 1.25.

prefer_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.prefer_async(). See Snapd.Client.prefer_sync() for more information.

New in version 1.25.

prefer_sync(snap, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

???

New in version 1.25.

refresh_all_async(progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously ensure all snaps are updated to their latest versions. See Snapd.Client.refresh_all_sync() for more information.

New in version 1.5.

refresh_all_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

a None-terminated array of the snap names refreshed or None on error.

Return type:

[str]

Complete request started with Snapd.Client.refresh_all_async(). See Snapd.Client.refresh_all_sync() for more information.

New in version 1.5.

refresh_all_sync(progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a None-terminated array of the snap names refreshed or None on error.

Return type:

[str]

Update all installed snaps to their latest version.

New in version 1.5.

refresh_async(name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously ensure an installed snap is at the latest version. See Snapd.Client.refresh_sync() for more information.

New in version 1.0.

refresh_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.refresh_async(). See Snapd.Client.refresh_sync() for more information.

New in version 1.0.

refresh_sync(name, channel, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Ensure an installed snap is at the latest version.

New in version 1.0.

remove2_async(flags, name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously uninstall a snap. See Snapd.Client.remove2_sync() for more information.

New in version 1.50.

remove2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.remove2_async(). See Snapd.Client.remove2_sync() for more information.

New in version 1.50.

remove2_sync(flags, name, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Uninstall a snap.

New in version 1.50.

remove_async(name, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously uninstall a snap. See Snapd.Client.remove_sync() for more information.

New in version 1.0.

remove_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.remove_async(). See Snapd.Client.remove_sync() for more information.

New in version 1.0.

remove_sync(name, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Uninstall a snap.

New in version 1.0.

Deprecated since version 1.50: Use Snapd.Client.remove2_sync()

reset_aliases_async(snap, aliases, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously change the state of aliases. See Snapd.Client.reset_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.disable_aliases_async()

reset_aliases_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.reset_aliases_async(). See Snapd.Client.reset_aliases_sync() for more information.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.disable_aliases_finish()

reset_aliases_sync(snap, aliases, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Change the state of aliases.

New in version 1.8.

Deprecated since version 1.25: Use Snapd.Client.disable_aliases_sync()

run_snapctl2_async(context_id, args, cancellable, callback, *user_data)
Parameters:

Asynchronously run a snapctl command. See Snapd.Client.run_snapctl_sync() for more information.

New in version 1.59.

run_snapctl2_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

stdout_output:

the location to write the stdout from the command or None.

stderr_output:

the location to write the stderr from the command or None.

exit_code:

the location to write the exit code of the command or None.

Return type:

(bool, stdout_output: str, stderr_output: str, exit_code: int)

Complete request started with Snapd.Client.run_snapctl2_async(). See Snapd.Client.run_snapctl2_sync() for more information.

New in version 1.59.

run_snapctl2_sync(context_id, args, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

stdout_output:

the location to write the stdout from the command or None.

stderr_output:

the location to write the stderr from the command or None.

exit_code:

the location to write the exit code of the command or None.

Return type:

(bool, stdout_output: str, stderr_output: str, exit_code: int)

Run a snapctl command.

New in version 1.59.

run_snapctl_async(context_id, args, cancellable, callback, *user_data)
Parameters:

Asynchronously run a snapctl command. See Snapd.Client.run_snapctl_sync() for more information.

New in version 1.8.

Deprecated since version 1.59: Use Snapd.Client.run_snapctl2_async()

run_snapctl_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

stdout_output:

the location to write the stdout from the command or None.

stderr_output:

the location to write the stderr from the command or None.

Return type:

(bool, stdout_output: str, stderr_output: str)

Complete request started with Snapd.Client.run_snapctl_async(). See Snapd.Client.run_snapctl_sync() for more information.

New in version 1.8.

Deprecated since version 1.59: Use Snapd.Client.run_snapctl2_finish()

run_snapctl_sync(context_id, args, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

stdout_output:

the location to write the stdout from the command or None.

stderr_output:

the location to write the stderr from the command or None.

Return type:

(bool, stdout_output: str, stderr_output: str)

Run a snapctl command.

New in version 1.8.

Deprecated since version 1.59: Use Snapd.Client.run_snapctl2_async()

set_allow_interaction(allow_interaction)
Parameters:

allow_interaction (bool) – whether to allow interaction.

Set whether snapd operations are allowed to interact with the user. This affects operations that use polkit authorisation. Defaults to True.

New in version 1.19.

set_auth_data(auth_data)
Parameters:

auth_data (Snapd.AuthData or None) – a Snapd.AuthData or None.

Set the authorization data to use for requests. Authorization data can be obtained by:

New in version 1.0.

set_snap_conf_async(name, key_values, cancellable, callback, *user_data)
Parameters:

Asynchronously set configuration for a snap. See Snapd.Client.set_snap_conf_sync() for more information.

New in version 1.48.

set_snap_conf_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True if configuration successfully applied.

Return type:

bool

Complete request started with Snapd.Client.set_snap_conf_async(). See Snapd.Client.set_snap_conf_sync() for more information.

New in version 1.48.

set_snap_conf_sync(name, key_values, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if configuration successfully applied.

Return type:

bool

Set configuration for a snap. System configuration is stored using the name “system”.

New in version 1.48.

set_socket_path(socket_path)
Parameters:

socket_path (str or None) – a socket path or None to reset to the default.

Set the Unix socket path to connect to snapd with. Defaults to the system socket.

New in version 1.24.

set_user_agent(user_agent)
Parameters:

user_agent (str or None) – a user agent or None.

Set the HTTP user-agent that is sent with each request to snapd. Defaults to “snapd-glib/VERSION”.

New in version 1.16.

switch_async(name, channel, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously set the tracking channel on an installed snap. See Snapd.Client.switch_sync() for more information.

New in version 1.26.

switch_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.switch_async(). See Snapd.Client.switch_sync() for more information.

New in version 1.26.

switch_sync(name, channel, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Set the tracking channel on an installed snap.

New in version 1.26.

try_async(path, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously try a snap. See Snapd.Client.try_sync() for more information.

New in version 1.9.

try_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.try_async(). See Snapd.Client.try_sync() for more information.

New in version 1.9.

try_sync(path, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Try a snap.

New in version 1.9.

unalias_async(snap, alias, progress_callback, progress_callback_data, cancellable, callback, *user_data)
Parameters:

Asynchronously remove an alias from an app. See Snapd.Client.unalias_sync() for more information.

New in version 1.25.

unalias_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Complete request started with Snapd.Client.unalias_async(). See Snapd.Client.unalias_sync() for more information.

New in version 1.25.

unalias_sync(snap, alias, progress_callback, progress_callback_data, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

Remove an alias from an app.

New in version 1.25.