Fwupd.Remote

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

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Fwupd.Codec (21)

Structs:

GObject.ObjectClass (5)

class

flag_from_string (flag)

class

flag_to_string (flag)

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_checksum ()

get_checksum_metadata ()

get_filename_cache ()

get_filename_cache_sig ()

get_filename_source ()

get_firmware_base_uri ()

get_flags ()

get_id ()

get_kind ()

get_metadata_uri ()

get_metadata_uri_sig ()

get_order_after ()

get_order_before ()

get_password ()

get_priority ()

get_privacy_uri ()

get_refresh_interval ()

get_remotes_dir ()

get_report_uri ()

get_title ()

get_username ()

has_flag (flag)

load_signature (filename)

load_signature_bytes (bytes)

needs_refresh ()

remove_flag (flag)

set_agreement (agreement)

set_checksum_sig (checksum_sig)

set_filename_cache (filename)

set_filename_source (filename_source)

set_firmware_base_uri (firmware_base_uri)

set_flags (flags)

set_id (id)

set_kind (kind)

set_metadata_uri (metadata_uri)

set_mtime (mtime)

set_order_after (ids)

set_order_before (ids)

set_password (password)

set_priority (priority)

set_privacy_uri (privacy_uri)

set_refresh_interval (refresh_interval)

set_remotes_dir (directory)

set_report_uri (report_uri)

set_title (title)

set_username (username)

setup ()

Virtual Methods

Inherited:

GObject.Object (7), Fwupd.Codec (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, Fwupd.Codec

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 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 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_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_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 2.0.2.

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_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_privacy_uri()[source]
Returns:

a string, or None if unset

Return type:

str

Gets the remote privacy policy URL, e.g. https://lvfs.readthedocs.io/en/latest/privacy.html

New in version 2.0.0.

get_refresh_interval()[source]
Returns:

value in seconds

Return type:

int

Gets 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_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_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.

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.

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_sig(checksum_sig)[source]
Parameters:

checksum_sig (str or None) – checksum string

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

New in version 2.0.0.

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_firmware_base_uri(firmware_base_uri)[source]
Parameters:

firmware_base_uri (str or None) – base URI for firmware

Sets the firmware base URI.

NOTE: This has to be set after MetadataURI.

New in version 2.0.2.

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 ID.

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

New in version 1.9.3.

set_kind(kind)[source]
Parameters:

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

Sets the kind of the remote.

New in version 2.0.0.

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_order_after(ids)[source]
Parameters:

ids (str or None) – optional remote IDs

Sets any remotes that should be ordered after this one.

New in version 2.0.0.

set_order_before(ids)[source]
Parameters:

ids (str or None) – optional remote IDs

Sets any remotes that should be ordered before this one.

New in version 2.0.0.

set_password(password)[source]
Parameters:

password (str or None) – an optional password

Sets the remote password.

New in version 2.0.0.

set_priority(priority)[source]
Parameters:

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

Sets the plugin priority.

New in version 0.9.5.

set_privacy_uri(privacy_uri)[source]
Parameters:

privacy_uri (str or None) – privacy URL, e.g. “https://lvfs.readthedocs.io/en/latest/privacy.html”

Sets the remote privacy policy URL.

New in version 2.0.0.

set_refresh_interval(refresh_interval)[source]
Parameters:

refresh_interval (int) – value in seconds

Sets the plugin refresh interval in seconds.

New in version 2.0.0.

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_report_uri(report_uri)[source]
Parameters:

report_uri (str or None) – report URI

Sets the report URI.

New in version 2.0.0.

set_title(title)[source]
Parameters:

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

Sets the remote title.

New in version 1.8.13.

set_username(username)[source]
Parameters:

username (str or None) – an optional username

Sets the remote username.

New in version 2.0.0.

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.

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.