Fwupd.Remote

g Fwupd.Remote Fwupd.Remote GObject.Object GObject.Object GObject.Object->Fwupd.Remote

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

array_from_variant (value)

class

flag_from_string (flag)

class

flag_to_string (flag)

class

from_variant (value)

class

kind_from_string (kind)

class

kind_to_string (kind)

class

new ()

add_flag (flag)

build_firmware_uri (url)

build_metadata_sig_uri ()

build_metadata_uri ()

build_report_uri ()

get_age ()

get_agreement ()

get_approval_required ()

get_automatic_reports ()

get_automatic_security_reports ()

get_checksum ()

get_checksum_metadata ()

get_enabled ()

get_filename_cache ()

get_filename_cache_sig ()

get_filename_source ()

get_firmware_base_uri ()

get_flags ()

get_id ()

get_keyring_kind ()

get_kind ()

get_metadata_uri ()

get_metadata_uri_sig ()

get_order_after ()

get_order_before ()

get_password ()

get_priority ()

get_refresh_interval ()

get_remotes_dir ()

get_report_uri ()

get_security_report_uri ()

get_title ()

get_username ()

has_flag (flag)

load_from_filename (filename, cancellable)

load_signature (filename)

load_signature_bytes (bytes)

needs_refresh ()

remove_flag (flag)

save_to_filename (filename, cancellable)

set_agreement (agreement)

set_checksum (checksum_sig)

set_enabled (enabled)

set_filename_cache (filename)

set_filename_source (filename_source)

set_flags (flags)

set_id (id)

set_keyring_kind (keyring_kind)

set_metadata_uri (metadata_uri)

set_mtime (mtime)

set_priority (priority)

set_remotes_dir (directory)

set_title (title)

setup ()

to_json (builder)

to_variant ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

approval-required

bool

r/w

automatic-reports

bool

r/w

automatic-security-reports

bool

r/w

enabled

bool

r/w

flags

int

r/w

id

str

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Fwupd.Remote(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fwupd.RemoteClass

A source of metadata that provides firmware.

Remotes can be local (e.g. folders on a disk) or remote (e.g. downloaded over HTTP or IPFS).

See also: [class`FwupdClient`]

classmethod array_from_variant(value)[source]
Parameters:

value (GLib.Variant) – the serialized data

Returns:

remotes, or None if value was invalid

Return type:

[Fwupd.Remote]

Creates an array of new devices using serialized data.

New in version 1.2.10.

classmethod flag_from_string(flag)[source]
Parameters:

flag (str or None) – a string, e.g. enabled

Returns:

enumerated value

Return type:

Fwupd.RemoteFlags

Converts a string to an enumerated flag.

New in version 1.9.4.

classmethod flag_to_string(flag)[source]
Parameters:

flag (Fwupd.RemoteFlags) – remote attribute flags, e.g. Fwupd.RemoteFlags.ENABLED

Returns:

string, or None

Return type:

str

Returns the printable string for the flag.

New in version 1.9.4.

classmethod from_variant(value)[source]
Parameters:

value (GLib.Variant) – the serialized data

Returns:

a new Fwupd.Remote, or None if value was invalid

Return type:

Fwupd.Remote

Creates a new remote using serialized data.

New in version 1.0.0.

classmethod kind_from_string(kind)[source]
Parameters:

kind (str or None) – a string, e.g. download

Returns:

a Fwupd.RemoteKind, e.g. Fwupd.RemoteKind.DOWNLOAD

Return type:

Fwupd.RemoteKind

Converts an printable string to an enumerated type.

New in version 0.9.6.

classmethod kind_to_string(kind)[source]
Parameters:

kind (Fwupd.RemoteKind) – a Fwupd.RemoteKind, e.g. Fwupd.RemoteKind.DOWNLOAD

Returns:

a string, e.g. download

Return type:

str

Converts an enumerated type to a printable string.

New in version 0.9.6.

classmethod new()[source]
Returns:

a new Fwupd.Remote

Return type:

Fwupd.Remote

Creates a new fwupd remote.

New in version 0.9.3.

add_flag(flag)[source]
Parameters:

flag (Fwupd.RemoteFlags) – the Fwupd.RemoteFlags, e.g. Fwupd.RemoteFlags.APPROVAL_REQUIRED

Adds a specific attribute flag to the attribute.

New in version 1.9.4.

build_firmware_uri(url)[source]
Parameters:

url (str) – the URL to use

Raises:

GLib.Error

Returns:

a URI, or None for error

Return type:

str

Builds a URI for the URL using the username and password set for the remote, including any basename URI substitution.

New in version 0.9.7.

build_metadata_sig_uri()[source]
Raises:

GLib.Error

Returns:

a URI, or None for error

Return type:

str

Builds a URI for the metadata using the username and password set for the remote.

New in version 1.9.8.

build_metadata_uri()[source]
Raises:

GLib.Error

Returns:

a URI, or None for error

Return type:

str

Builds a URI for the metadata signature using the username and password set for the remote.

New in version 1.9.8.

build_report_uri()[source]
Raises:

GLib.Error

Returns:

a URI, or None for error

Return type:

str

Builds a URI for the URL using the username and password set for the remote.

New in version 1.9.1.

get_age()[source]
Returns:

a age, or GObject.G_MAXUINT64 for unavailable

Return type:

int

Gets the age of the remote in seconds.

New in version 0.9.5.

get_agreement()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote agreement in AppStream markup format

New in version 1.0.7.

get_approval_required()[source]
Returns:

a True if the remote is restricted

Return type:

bool

Gets if firmware from the remote should be checked against the list of a approved checksums.

New in version 1.2.6.

get_automatic_reports()[source]
Returns:

a True if the remote should have reports uploaded automatically

Return type:

bool

Gets if reports should be automatically uploaded to this remote

New in version 1.3.3.

get_automatic_security_reports()[source]
Returns:

a True if the remote should have reports uploaded automatically

Return type:

bool

Gets if security reports should be automatically uploaded to this remote

New in version 1.5.0.

get_checksum()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote signature checksum.

New in version 1.0.0.

get_checksum_metadata()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote metadata checksum.

New in version 1.9.4.

get_enabled()[source]
Returns:

a True if the remote is enabled

Return type:

bool

Gets if the remote is enabled and should be used.

New in version 0.9.3.

get_filename_cache()[source]
Returns:

a string, or None for unset

Return type:

str

Gets the path and filename that the remote is using for a cache.

New in version 0.9.6.

get_filename_cache_sig()[source]
Returns:

a string, or None for unset

Return type:

str

Gets the path and filename that the remote is using for a signature cache.

New in version 0.9.7.

get_filename_source()[source]
Returns:

a string, or None for unset

Return type:

str

Gets the path and filename of the remote itself, typically a .conf file.

New in version 0.9.8.

get_firmware_base_uri()[source]
Returns:

a URI, or None for unset.

Return type:

str

Gets the base URI for firmware.

New in version 0.9.7.

get_flags()[source]
Returns:

remote attribute flags, or 0 if unset

Return type:

Fwupd.RemoteFlags

Gets the self flags.

New in version 1.9.4.

get_id()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote ID, e.g. lvfs-testing.

New in version 0.9.3.

get_keyring_kind()[source]
Returns:

a Fwupd.KeyringKind, e.g. Fwupd.KeyringKind.GPG

Return type:

Fwupd.KeyringKind

Gets the keyring kind of the remote.

New in version 0.9.7.

get_kind()[source]
Returns:

a Fwupd.RemoteKind, e.g. Fwupd.RemoteKind.LOCAL

Return type:

Fwupd.RemoteKind

Gets the kind of the remote.

New in version 0.9.6.

get_metadata_uri()[source]
Returns:

a URI, or None for invalid.

Return type:

str

Gets the URI for the remote metadata.

New in version 0.9.7.

get_metadata_uri_sig()[source]
Returns:

a URI, or None for invalid.

Return type:

str

Gets the URI for the remote metadata signature.

New in version 0.9.7.

get_order_after()[source]
Returns:

an array

Return type:

[str]

Gets the list of remotes this plugin should be ordered after.

New in version 0.9.5.

get_order_before()[source]
Returns:

an array

Return type:

[str]

Gets the list of remotes this plugin should be ordered before.

New in version 0.9.5.

get_password()[source]
Returns:

a string, or None for unset

Return type:

str

Gets the password configured for the remote.

New in version 0.9.5.

get_priority()[source]
Returns:

a priority, or 0 for the default value

Return type:

int

Gets the priority of the remote, where bigger numbers are better.

New in version 0.9.5.

get_refresh_interval()[source]
Returns:

value in seconds

Return type:

int

Sets the plugin refresh interval in seconds.

New in version 1.9.4.

get_remotes_dir()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the base directory for storing remote metadata

New in version 1.3.1.

get_report_uri()[source]
Returns:

a URI, or None for invalid.

Return type:

str

Gets the URI for the remote reporting.

New in version 1.0.4.

get_security_report_uri()[source]
Returns:

a URI, or None for invalid.

Return type:

str

Gets the URI for the security report.

New in version 1.5.0.

get_title()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote title, e.g. Linux Vendor Firmware Service.

New in version 0.9.8.

get_username()[source]
Returns:

a string, or None for unset

Return type:

str

Gets the username configured for the remote.

New in version 0.9.5.

has_flag(flag)[source]
Parameters:

flag (Fwupd.RemoteFlags) – the remote flag, e.g. Fwupd.RemoteFlags.APPROVAL_REQUIRED

Returns:

True if the flag is set

Return type:

bool

Finds if the remote has a specific flag.

New in version 1.9.4.

load_from_filename(filename, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Loads metadata about the remote from a keyfile. This can be called zero or multiple times for each remote.

New in version 0.9.3.

load_signature(filename)[source]
Parameters:

filename (str) – a filename

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Parses the signature, updating the metadata URI as appropriate.

New in version 1.4.0.

load_signature_bytes(bytes)[source]
Parameters:

bytes (GLib.Bytes) – data blob

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Parses the signature, updating the metadata URI as appropriate.

This can only be called for remotes with Keyring=jcat which is the default for most remotes.

New in version 1.4.5.

needs_refresh()[source]
Returns:

a True if the remote contents are considered old

Return type:

bool

Gets if the metadata remote needs re-downloading.

New in version 1.9.4.

remove_flag(flag)[source]
Parameters:

flag (Fwupd.RemoteFlags) – the Fwupd.RemoteFlags, e.g. Fwupd.RemoteFlags.APPROVAL_REQUIRED

Removes a specific attribute flag from the remote.

New in version 1.9.4.

save_to_filename(filename, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Saves metadata about the remote to a keyfile.

New in version 1.8.13.

set_agreement(agreement)[source]
Parameters:

agreement (str or None) – agreement markup text

Sets the remote agreement in AppStream markup format

New in version 1.0.7.

set_checksum(checksum_sig)[source]
Parameters:

checksum_sig (str or None) – checksum string

Sets the remote signature checksum, typically only useful in the self tests.

NOTE: This should have been called fwupd_remote_set_checksum_sig() but alas, ABI.

New in version 1.8.2.

set_enabled(enabled)[source]
Parameters:

enabled (bool) – boolean

Sets if the remote is enabled and should be used.

New in version 1.8.13.

set_filename_cache(filename)[source]
Parameters:

filename (str or None) – filename string

Sets the remote filename cache filename, typically only useful in the self tests.

New in version 1.8.2.

set_filename_source(filename_source)[source]
Parameters:

filename_source (str or None) – filename

Sets the source filename. This is typically a file in /etc/fwupd/remotes/.

New in version 1.6.1.

set_flags(flags)[source]
Parameters:

flags (Fwupd.RemoteFlags) – remote attribute flags, e.g. Fwupd.RemoteFlags.APPROVAL_REQUIRED

Sets the attribute flags.

New in version 1.9.4.

set_id(id)[source]
Parameters:

id (str or None) – remote ID, e.g. “lvfs”

Sets the remote title.

NOTE: the ID has to be set before the URL.

New in version 1.9.3.

set_keyring_kind(keyring_kind)[source]
Parameters:

keyring_kind (Fwupd.KeyringKind) – keyring kind e.g. Fwupd.KeyringKind.PKCS7

Sets the keyring kind

New in version 1.5.3.

set_metadata_uri(metadata_uri)[source]
Parameters:

metadata_uri (str or None) – metadata URI

Sets the remote metadata URI.

NOTE: This has to be set before the username and password.

New in version 1.8.13.

set_mtime(mtime)[source]
Parameters:

mtime (int) – a UNIX timestamp

Sets the plugin modification time.

New in version 0.9.5.

set_priority(priority)[source]
Parameters:

priority (int) – an integer, where 1 is better

Sets the plugin priority.

New in version 0.9.5.

set_remotes_dir(directory)[source]
Parameters:

directory (str or None) – Remotes directory

Sets the directory to store remote data

New in version 1.3.1.

set_title(title)[source]
Parameters:

title (str or None) – title text, e.g. “Backup”

Sets the remote title.

New in version 1.8.13.

setup()[source]
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Sets up the remote ready for use, checking that required parameters have been set. Calling this method multiple times has no effect.

New in version 1.6.1.

to_json(builder)[source]
Parameters:

builder (Json.Builder) – a JSON builder

Adds a fwupd remote to a JSON builder

New in version 1.6.2.

to_variant()[source]
Returns:

the serialized data, or None for error

Return type:

GLib.Variant

Serialize the remote data.

New in version 1.0.0.

Property Details

Fwupd.Remote.props.approval_required
Name:

approval-required

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If firmware from the remote should be checked against the system list of approved firmware.

New in version 1.2.6.

Fwupd.Remote.props.automatic_reports
Name:

automatic-reports

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

The behavior for auto-uploading reports.

New in version 1.3.3.

Fwupd.Remote.props.automatic_security_reports
Name:

automatic-security-reports

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

The behavior for auto-uploading security reports.

New in version 1.5.0.

Fwupd.Remote.props.enabled
Name:

enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If the remote is enabled and should be used.

New in version 0.9.3.

Fwupd.Remote.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The remote flags.

New in version 1.9.4.

Fwupd.Remote.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The remote ID.

New in version 0.9.3.