Google is committed to advancing racial equity for Black communities. See how.

fuchsia.update.installer

PROTOCOLS

AttemptsMonitor

Defined in fuchsia.update.installer/progress.fidl

Monitors update attempts as they start.

OnStart

Emitted when a new update attempt has started.

  • request attempt_id UUID identifying this update attempt.
  • request monitor A protocol on which to receive progress updates.

Response

NameType
attempt_id string
monitor Monitor

Installer

Defined in fuchsia.update.installer/installer.fidl

Updates the system.

This protocol is intended to be consumed by a component capable of discovering when to update and what version of the system to install.

GetLastUpdateResult

Get the status of the last update attempt. If this device hasn't attempted an update since the last factory reset, every field in the result will be absent.

  • response info the status of the last update attempt, if available.

Request

NameType

Response

NameType
info UpdateResult

GetUpdateResult

Get the status of the given update attempt, if it exists. If this device hasn't attempted an update with the given attempt_id or forgotten about that attempt, every field in the result will be absent.

  • request attempt_id UUID identifying the requested update attempt.
  • response info the status of the last update attempt, if available.

Request

NameType
attempt_id string

Response

NameType
info UpdateResult

MonitorAllUpdates

Monitor all update attempts as they start, as well as an in-progress attempt, if there is one.

  • request attempts_monitor A protocol on which to receive Monitor instances as update attempts start.
  • request monitor_options Configuration options to control the behavior of the given Monitor.

Request

NameType
attempts_monitor request<AttemptsMonitor>
monitor_options MonitorOptions

MonitorUpdate

Attempt to monitor a specific update attempt, if it exists. This API will not start an update if one is not already running.

  • request attempt_id UUID identifying the requested update attempt. If not given, monitor any active update attempt.
  • request monitor A protocol on which to receive progress updates.
  • request monitor_options Configuration options to control the behavior of the given Monitor.
  • response attached Whether or not the provided monitor was attached to an in-progress update attempt. If false, monitor will be closed by the server.

Request

NameType
attempt_id string?
monitor request<Monitor>
monitor_options MonitorOptions

Response

NameType
attached bool

StartUpdate

Start an update if one is not running, or attach to a pending update attempt. Attach the provided monitor to the update attempt.

  • request url The fuchsia-pkg URL of the update package to update to.
  • request options Configuration options for this update attempt. Ignored or merged with the existing options if an update attempt is already in progress.
  • request monitor A protocol on which to receive progress updates.
  • request monitor_options Configuration options to control the behavior of the given Monitor.
  • response attempt_id UUID identifying this update attempt. For updates that require a reboot, components may use this identifier to disambiguate the completion of this update attempt from new update attempts that start post-reboot.

Request

NameType
url string
options Options
monitor request<Monitor>
monitor_options MonitorOptions

Response

NameType
attempt_id string

Monitor

Defined in fuchsia.update.installer/progress.fidl

Monitors an update attempt.

When a Monitor is attached to an update attempt with MonitorOptions.should_notify set to true, the server will emit events on the protocol that the client must consume. Clients that attach to an attempt will be sent any events they may have missed (by attaching to an update attempt after it has started, for example).

GetNextProgress

Retrieve the latest progress of this update attempt, blocking until newer progress is available if this client has already seen the currently available progress. If this update attempt has completed (or failed), this API immediately returns the final progress.

  • response progress The latest progress of this update attempt.

Request

NameType

Response

NameType
progress Progress

OnStateEnter

Emitted when transitioning from one state to another.

  • response state The new state.

Response

NameType
state State

STRUCTS

ENUMS

Initiator

Type: uint32

Defined in fuchsia.update.installer/installer.fidl

Who or what initiated the update check.

NameValueDescription
USER 0

The update check was initiated by an interactive user, or the user is otherwise blocked and waiting for the result of this update check.

SERVICE 1

The update check was initiated by a service, in the background.

State

Type: uint32

Defined in fuchsia.update.installer/progress.fidl

States that an update attempt may transition through. An update attempt always starts in State.PREPARE. See each state for more details.

NameValueDescription
PREPARE 0

Fetching required metadata to begin the update. This state will also compute and expose an estimate of the required download size.

Next States

DOWNLOAD 1

Downloading packages and kernel images.

Next States

STAGE 2

Writing kernel images and preparing to switch over to the new system.

Next States

REBOOT 3

Waiting to reboot.

Next States

FINALIZE 4

Running final tasks post-reboot.

Next States

COMPLETE 5

Terminal states. An update attempt will eventually end up in one of these and will not transition out of them.

Next States

none

FAIL 6

TABLES

MonitorOptions

Defined in fuchsia.update.installer/installer.fidl

Configuration options for the Monitor protocol.

OrdinalNameTypeDescription
1 should_notify bool

True if events should be sent over the Monitor protocol. Assumed to be false if absent.

Options

Defined in fuchsia.update.installer/installer.fidl

Configuration options for an update attempt.

OrdinalNameTypeDescription
1 initiator Initiator

What initiated this update attempt. Required.

Progress

Defined in fuchsia.update.installer/progress.fidl

State of an update attempt.

OrdinalNameTypeDescription
1 state State

The current state of the update. Always present.

2 percent_complete uint8

When not present, progress is not yet known. When present, must be less than or equal to PERCENT_MAX.

3 download_size uint64

The number of bytes that must be downloaded to apply this update. Populated during State.PREPARE.

4 bytes_downloaded uint64

The number of bytes downloaded during this update attempt. Less than or equal to download_size.

UpdateResult

Defined in fuchsia.update.installer/installer.fidl

Metadata about a prior update attempt.

OrdinalNameTypeDescription
1 attempt_id string

UUID for this specific update attempt. Always present.

2 source_version string

Source version of this update attempt. Always present.

3 target_version string

Target version of this update attempt, if known.

4 options Options

Configuration options for this update attempt. Always present.

5 state State

Terminal state of this update attempt. Always present.

6 when zx/time

When this update attempt started. Always present.

CONSTANTS

NameValueTypeDescription
PERCENT_MAX 100 uint8

Fixed precision decimal representing 100%.