The REST API provides access to snapd’s state and many of its key functions, as listed below.
For general information on how to use the API, including how to access it, its requests and responses, results fields and error types, see Using the REST API.
As snapd development progresses, changes that are deemed backwards-compatible, such as adding methods or verbs, will not change an endpoint. Conversely, significant updates may necessitate a new endpoint being created.
The snapd REST API includes the following components:
aliases: get and modify app aliases | apps: list and modify apps and their attributes |
assertions: list and add assertion types | changes: return the state and abort changes |
connections: list all interface connections | find: find snaps in the store |
icons: retrieve the icon for an installed snap | interfaces: list interfaces and their metadata |
login: log user into the store | logout: logout user from the store |
logs: retrieve log contents | sections: request store sections |
snapctl: run the snapctl comment | snaps: list and manage installed snaps |
snapshots: import and export snapshots | system-info: return host configuration |
systems: list and activate recovery systems | users: create, remove and query accounts |
warnings: returns snapd warnings |
Reserved for human-readable content describing the service.
Example:
{
"snap":
{
"alias1":
{
"command": "snap.app",
"status": "auto",
"auto": "app"
},
"alias2":
{
"command": "foo",
"status": "manual",
"manual": "app1"
"manual": "app2"
}
}
}
The result dict is keyed by snap names. Each snap entry is a dict of aliases keyed by alias name:
"lxd": {
"lxc": {
"command": "lxd.lxc",
"status": "auto",
"auto": "lxc"
}
}
command
: The full command this alias runs.status
: Alias status, one of auto
, manual
or disabled
.auto
: the app the alias is for as assigned by an assertion (optional).manual
: the app the alias is for if status
is manual
(optional). Overrides auto
.Example:
{
"action": "alias",
"snap": "moon-buggy",
"alias": "foo"
}
action
: Either alias
, unalias
or prefer
.snap
: Snap name to modify (optional for unalias).app
: App to modify (optional).alias
: Alias to modify.select
Limit which apps are returned. One of:
service
: Return only services.names
Comma separated list of snaps to get apps for.
Example:
[
{
"snap": "spotify",
"name": "spotify",
"desktop-file": "/path/to/file.desktop",
},
{
"snap": "lxd",
"name": "daemon",
"daemon": "simple",
"enabled": true,
"activators": [
{
"Name": "unix",
"Type": "socket",
"Active": true,
"Enabled": true
}
]
}
]
snap
: the snap providing the app (optional)name
: the name of the app.desktop-file
: the desktop file for the app (optional).daemon
: the daemon type, if a service (optional).enabled
: true if an enabled service (optional).active
: true if an active service (optional).common-id
: common ID associated with this app (optional).Example:
{
"action": "stop",
"names": ["lxd"]
}
names
: a list of names of snaps (e.g. multipass
, meaning “all apps in this snap”) or apps (e.g. multipass.multipassd
) to operate on. Cannot be empty.action
: The action to perform. Must be one of stop
, start
, or restart
. As these actions only work for services, the names
given must resolve to at least one service.enable
: a boolean (optional, defaults to false
), when action
is start
, arranges to have the service start at system start.disable
: a boolean (optional, defaults to false
), when action
is stop
, arranges to no longer start the service at system start.reload
: a boolean (optional, defaults to false
), when action
is restart
, try to reload the service instead of restarting, if it supports it – otherwise, restart.Example:
{
"types": [
"account",
"account-key",
"account-key-request",
"base-declaration",
"device-session-request",
"model",
"repair",
"serial",
"serial-request",
"snap-build",
"snap-declaration",
"snap-developer",
"snap-revision",
"store",
"system-user",
"validation",
"validation-set"
]
}
The response is a stream of assertions separated by double newlines.
The X-Ubuntu-Assertions-Count header is set to the number of
returned assertions, 0 or more.
Assertions can be filtered on header values using parameters, e.g. GET /v2/assertions/account?username=canonical
will return all account assertions where type=account
and username=canonical
.
Example:
type: account
authority-id: canonical
account-id: canonical
display-name: Canonical
timestamp: 2016-04-01T00:00:00.0Z
username: canonical
validation: certified
sign-key-sha3-384: <key>
<signature>
Note, to determine the boundary between assertions, the headers need to be decoded to check if each assertion contains a body.
The body of the request provides the assertion to add. The assertion may also be a newer revision of a pre-existing assertion that it will replace.
To succeed the assertion must be valid, its signature verified with a known public key and the assertion consistent with and its prerequisite in the database.
Example:
POST /v2/assertions HTTP/1.1
Content-Type: application/x.ubuntu.assertion
<http-headers>
type: <type>
<assertion-headers>
sign-key-sha3-384: <key>
<signature>
Example:
{
"id": "123",
"kind": "make-lamington",
"summary": "Make a tasty Lamington",
"status": "Doing",
"tasks": [
{
"id": "1353",
"kind": "cut-cake",
"summary": "Cut cake into pieces",
"status": "Done",
"progress":
{
"label": "Cutting piece",
"done": 16,
"total": 16
},
"spawn-time": "2017-01-23T12:00:44.806931498+13:00",
"ready-time": "2017-01-23T12:00:45.001581654+13:00"
},
{
"id": "1354",
"kind": "dip",
"summary": "Dip cake into chocolate",
"status": "Doing",
"progress":
{
"label": "Dipping piece",
"done": 7,
"total": 16
},
"spawn-time": "2017-01-23T12:00:44.806931498+13:00",
},
{
"id": "1355",
"kind": "coat",
"summary": "Coating cake in desiccated coconut",
"status": "Do",
"progress":
{
"label": "Coating piece",
"done": 0,
"total": 16
},
"spawn-time": "2017-01-23T12:00:44.806931498+13:00",
},
],
"ready": false,
"spawn-time": "2017-01-23T12:00:44.806971766+13:00",
}
id
: A unique ID for this change.kind
: A code describing what type of change this is.summary
: Human readable description of the change.status
: Summary status of the current combined task statuses (see below).tasks
: array of objects describing tasks in this change (optional, see below).ready
: true if this change has completed.spawn-time
: the time this change started in in RFC3339 UTC format with µs precision.ready-time
: the time this change completed in RFC3339 UTC format with µs precision. (omitted if not completed).data
: result of the change (optional, omitted until completed).err
: Human readable error description if transaction has failed (optional, omitted until completed).id
: A unique ID for this task.kind
: A code describing what type of task this is.summary
: Human readable description of the task.status
: One of the following status codes:
"Do"
- Task ready to start."Doing"
- Task in progress."Done"
- Task is complete."Abort"
- Task has been aborted."Undo"
- Task needs to be undone."Undoing"
- Task is being undone."Hold"
- Task will not be run (probably due to failure of another task)."Error"
- Task completed with an error.progress
: object containing the current progress of this task. label
is a human readable description of the progress, done
and total
are numbers showing the progress of this task.spawn-time
: the time this task was created in RFC3339 UTC format with µs precision.ready-time
: the time this task completed in RFC3339 UTC format with µs precision (omitted if not completed).Example:
{
"action": "abort"
}
See return from GET.
Returns an array containing all the changes that have occurred. Changes are returned in the same form as GET /v2/change/[id]
.
select
Limit which changes are returned. One of:
all
: All changes returnedin-progress
: Only changes that are in progress are returned (default)ready
: Only changes that are readyfor
Optional snap name to limit results to.
snap
Limit results to a given snap name.
select
When set to all
, unconnected slots and plugs are included in the results. When unset or empty, the results include only those plugs and slots that are connected.
interface
Takes an interface name. When set, the results are limited to the selected interface.
{
"established": [
{
"slot": { "snap": "core", "slot": "home" },
"plug": { "snap": "foo", "plug": "home" },
"interface": "home",
},
{
"slot": { "snap": "core", "slot": "network-control" },
"plug": { "snap": "foo", "plug": "network-control" },
"interface": "network-control",
"manual": true
}
],
"undesired": [
{
"slot": { "snap": "core", "slot": "foo-data" },
"plug": { "snap": "foo", "plug": "foo-data" },
"interface": "content",
"manual": true
}
],
"plugs": [
{
"snap": "foo",
"slot": "home",
"interface": "home",
"connections": [
{ "snap": "core", "slot": "home" }
]
},
{
"snap": "foo",
"slot": "network-control",
"interface": "network-control",
"connections": [
{ "snap": "core", "slot": "network-control" }
]
}
],
"slots": [
{
"snap": "core",
"slot": "home",
"interface": "home",
"connections": [
{ "snap": "foo", "plug": "home" }
]
},
{
"snap": "core",
"slot": "network-control",
"interface": "network-control",
"connections": [
{ "snap": "foo", "plug": "network-control" }
]
}
]
}
established
: Array of connections made with slots and plugs.undesired
: Array of connections that have been manually disconnected. These connections would otherwise be automatically made.plugs
: Array of connected plugs.slots
: Array of connected slots.snap
: The snap this plug / slot is part of.plug
or slot
: The name of this plug / slot.interface
: The interface this plug / slot uses.attrs
: Dict containing attributes for the interface in use. Attributes values can be of any type, e.g. boolean, strings etc.label
: Human readable description of plug / slot.connections
: List of current slots / plugs that are connected to this. Each connection contains the name of the snap and the connected slot / plug.slot
: Snap and slot name connected.plug
: Plug and slot name connected.interface
: Name of interface in use.manual
: Set to true
if this interface was manually connected by a user.gadget
: Set to true
if this interface was connected by the gadget snap.slot-attrs
: Object of slot attributes for this connection.plug-attrs
: Object of plug attributes for this connection.name
Search for snaps whose name matches the given string. Can’t be used
together with q
. This is meant for things like autocompletion. The
match is exact (i.e. find would return 0 or 1 results) unless the
string ends in *
.
q
Search for snaps that match the given string. Spaces between words are treated as logical AND operators. This is a weighted broad search, meant as the main interface to searching for snaps.
scope
If set to wide
, the search results are broadened to include non-stable packages.
section
Section in the store to search. Use GET /v2/sections
to get the names of the sections.
select
Alter the collection searched:
refresh
: search refreshable snaps. Can’t be used with q
, nor name
.private
: search private snaps (by default, find only searchesname
, only q
(for now atsnap-id
Search for snaps using the snap-id (formally common ID) snap app attribute.
http://localhost/v2/find\?q\=libreoffice | jq
[
{
"id": "CpUkI0qPIIBVRsjy49adNq4D6Ra72y4v",
"title": "LibreOffice",
"summary": "LibreOffice is a powerful office suite including word processing and creation of spreadsheets, slideshows and databases",
"description": "LibreOffice is a powerful and free office suite, used by millions of people around the world. Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity. LibreOffice includes several applications that make it the most versatile Free and Open Source office suite on the market: Writer (word processing), Calc (spreadsheets), Impress (presentations), Draw (vector graphics and flowcharts), Base (databases), and Math (formula editing).",
"download-size": 436375552,
"icon": "https://dashboard.snapcraft.io/site_media/appmedia/2016/06/LibreOffice-Initial-Artwork-Logo.png",
"name": "libreoffice",
"publisher": {
"id": "canonical",
"username": "canonical",
"display-name": "Canonical",
"validation": "verified"
},
"store-url": "https://snapcraft.io/libreoffice",
"developer": "canonical",
"status": "available",
"type": "app",
"base": "core18",
"version": "6.4.4.2",
"channel": "stable",
"ignore-validation": false,
"revision": "180",
"confinement": "strict",
"private": false,
"devmode": false,
"jailmode": false,
"contact": "https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bugs?field.tag=snap",
"license": "MPL-2.0",
"common-ids": [
"libreoffice-draw.desktop",
"libreoffice-impress.desktop",
"libreoffice-writer.desktop",
"libreoffice-math.desktop",
"libreoffice-calc.desktop",
"libreoffice-base.desktop"
],
"website": "https://code.launchpad.net/~libreoffice/+git/libreoffice-snap",
"media": [
{
"type": "icon",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2016/06/LibreOffice-Initial-Artwork-Logo.png"
},
{
"type": "banner",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/12/LibreOffice-Banner_1IRAqHI.png",
"width": 2100,
"height": 700
},
{
"type": "screenshot",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/09/Screenshot-01-New-EN.png",
"width": 1082,
"height": 651
},
{
"type": "screenshot",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/09/Screenshot-04-New-EN.png",
"width": 1080,
"height": 648
},
{
"type": "screenshot",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/09/Screenshot-05-New-EN.png",
"width": 1080,
"height": 647
},
{
"type": "screenshot",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/09/Screenshot-06-New-EN.png",
"width": 1080,
"height": 647
},
{
"type": "screenshot",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/09/Screenshot-07-New-EN.png",
"width": 1081,
"height": 647
}
],
"install-date": "2020-06-02T17:25:50.864197657+01:00"
}
]
base
: the base snap this snap relies on (optional)channel
: the channel this snap is from.channels
: available channels to download. See below for fields. (only returned for searches with name parameter).common-ids
: common IDs used by the apps in this snap.confinement
: the confinement requested by the snap itself; one of strict
, classic
or devmode
.contact
: the method of contacting the developer.description
: snap description.developer
: developer who created the snap (deprecated, use username
from publisher
instead).download-size
: how big the download will be in bytes.epoch
: the epoch of the application release. See Snap epochs for details.icon
: a url to the snap icon, possibly relative to this server.id
: unique ID for this snap.license
: an SPDX license expression.name
: the snap name.private
: true if this snap is only available to its author.publisher
: publisher information, made up of an id
, username
and display-name
.released-at
: date when app was released.resource
: HTTP resource for this snap.revision
: a number representing the revision, as a base 10 string.media
: JSON array of media for this snap with each element consisting of a type
, url
and potentially a width
and height
for image media {
"type": "icon",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2016/06/LibreOffice-Initial-Artwork-Logo.png"
},
{
"type": "banner",
"url": "https://dashboard.snapcraft.io/site_media/appmedia/2019/12/LibreOffice-Banner_1IRAqHI.png",
"width": 2100,
"height": 700
}
channel
: the channel this snap is from.confinement
: the confinement requested by the snap itself; one of strict
, classic
or devmode
.epoch
: ?. Must be in the form of an integer.released-at
: date this revision was released into the channel in RFC3339 UTC format.revision
: a number representing the revision in this channel, as a base 10 string.size
: how big the download will be in bytes.version
: a string representing the version in this channel.Description: Get an icon from a snap installed on the system. The
response will be the raw contents of the icon file; the content-type
will be set accordingly and the Content-Disposition header will specify
the filename.
This fetches the icon from the snap itself.
Access: open
This is not a standard return type.
select
Set to all
to retrieve all interfaces, or connected
to only return connected interfaces (if this parameter is omitted then the call returns the legacy format that should be no longer used).
If true
, then slot information is returned.
If true
, then plug information is returned.
If true
then interface documentation is returned.
If given, then only interfaces that match the comma separated names are returned.
Example:
[
{
"name": "content",
"summary": "allows sharing code and data with other snaps"
"plugs": [
{ "snap": "foo", "plug": "foo-data" }
]
},
{
"name": "home",
"summary": "allows access to non-hidden files in the home directory",
"plugs": [
{ "snap": "foo", "plug": "home" }
]
},
{
"name": "network-control",
"summary": "allows configuring networking and network namespaces"
"plugs": [
{ "snap": "foo", "plug": "network-control" }
]
}
]
name
: Name of interface.summary
: Human-readable summary of interface (optional).doc-url
: URL to further documentation (optional).plugs
: Plugs using this interface (only if using plugs=true
).slots
: Plugs using this interface (only if using slots=true
).Example:
{
"action": "connect",
"slots": [{"snap": "canonical-pi2", "slot": "pin-13"}],
"plugs": [{"snap": "keyboard-lights", "plug": "capslock-led"}]
}
action
: Action to perform, either "connect"
or "disconnect"
.plugs
: Array of plugs to connect. Each plug is referred to by the snap
it is part of and the name of the plug
.slots
: Array of slots to connect to. Each slot is referred to by the snap
it is part of and the name of the slot
.Example:
{
"email": "foo@bar.com",
"password": "swordfish",
"otp": "123456"
}
email
: The email address being logged in with. This must be a valid email address (also supported with legacy username
field).password
: Password for this account.otp
: One time password for this account (optional). This field being wrong will generate the two-factor-required
or two-factor-failed
errors.Example:
{
"id": 1,
"username": "user1",
"email": "user1@example.com",
"macaroon": "serialized-store-macaroon",
"discharges": ["discharge-for-macaroon-authentication"]
}
id
: Unique ID for this user account.email
: Email address associated with this account.username
: Local username associated with this account (optional).macaroon
: Serialized macaroon to be passed back in the HTTP Authorization
header.discharges
: Array of serialized discharges to be passed back in the HTTP Authorization
header.n
Number of entries to return or all
for all entries. Defaults to 10 entries.
follow
If set then returns log entries as they occur.
Example:
HTTP/1.1 200 OK
Content-Type: application/json-seq
<http-headers>
<0x1E>{"timestamp":"2017-11-06T02:13:29.707407Z","message":"Thing occurred","sid":"service1","pid":"1000"}
<0x1E>{"timestamp":"2017-11-06T02:13:29.708319Z","message":"Other thing occurred","sid":"service1","pid":"1000"}
Example:
[
"featured",
"database",
"ops",
"messaging",
"media",
"internet-of-things"
]
Example:
{
"context-id": "ABCDEF",
"args": [ "get", "username" ]
}
context-id
: Context for this call.args
: Arguments to snapctl.Example:
{
"stdout": "username",
"stderr": ""
}
stdout
: Data written to stdout from snapctl command.stderr
: Data written to stderr from snapctl command./v2/find
.select
Filter snaps to return information about:
all
: show all snap revisions installed.enabled
: show only revisions of snaps that are active (default).snaps
Return only information for the given snaps. Snap names are separated by commas.
Example:
[{
"apps": [{"name": "moon-buggy"}]
"channel": "stable"
"confinement": "strict"
"description": "Moon-buggy is a simple character graphics game, where you drive some kind of car across the moon's surface. Unfortunately there are dangerous craters there. Fortunately your car can jump over them!\r\n",
"developer": "dholbach",
"devmode": false,
"icon": "",
"id": "2kkitQurgOkL3foImG4wDwn9CIANuHlt",
"install-date": "2016-05-17T09:36:53+12:00",
"installed-size": 90112,
"license": "GPL-2.0+",
"name": "moon-buggy",
"private": false,
"resource": "/v2/snaps/moon-buggy",
"revision": "11",
"status": "active",
"summary": "Drive a car across the moon",
"trymode": false,
"type": "app",
"version": "1.0.51.11"
}, {
"summary": "The ubuntu-core OS snap",
"description": "A secure, minimal transactional OS for devices and containers.",
"icon": "", // core might not have an icon
"installed-size": 67784704,
"install-date": "2016-03-08T11:29:21Z",
"name": "core",
"developer": "canonical",
"resource": "/v2/snaps/ubuntu-core",
"status": "active",
"type": "core",
"update-available": 247,
"version": "241",
"revision": 99,
"channel": "stable",
}]
In addition to the fields described in /v2/find
:
apps
: JSON array of apps the snap provides. See below for fields.broken
: a string describing if this snap is not working (optional).devmode
: true
if the snap is currently installed in development mode.installed-size
: how much space the snap itself (not its data) uses.install-date
: the date and time when the snap was installed in RFC3339 UTC format.jailmode
: true
if the app is currently installed in jail mode.mounted-from
: path the snap is mounted from, which is a .snap file for installed snaps and a directory for snaps in try mode.status
: can be either installed
or active
(i.e. is current).tracking-channel
: the channel updates will be installed from.trymode
: true
if the app was installed in try mode.furthermore, channels
, download-size
, screenshots
and tracks
cannot occur in the output of /v2/snaps
.
name
: Name of the app, i.e. the name of the executable.aliases
: A list of alias names for this app (optional).common-id
: A common ID associated with this app (optional).daemon
: The type of daemon this app is. One of “simple”, “forking”, “oneshot”, “dbus” or “notify” (optional, only applicable for daemons).desktop-file
: Path to desktop file for this app (optional).Example:
{
"action": "refresh",
"snaps": ["moon-buggy"]
}
action
: Either install
, refresh
, remove
, revert
, enable
, disable
or switch
.snaps
: Array of snap names to perform action on (optional, interpreted as all snaps if not present for a refresh).Snaps can be sideloaded by passing the snap content in a multipart/form-data
request with one file named “snap”.
Example:
POST /v2/snaps HTTP/1.1
Host:
Content-Type: multipart/form-data; boundary=foo
Content-Length: 20638
--foo
Content-Disposition: form-data; name="devmode"
true
--foo
Content-Disposition: form-data; name="snap"; filename="hello-world_27.snap"
<20480 bytes of snap file data>
--foo
The following fields are supported:
action
: The action to perform, either install
or try
(optional, defaults to install
).classic
: Put snap in classic mode and disable security confinement if true
(optional).dangerous
: Install the given snap file even if there are no pre-acknowledged signatures for it, meaning it was not verified and could be dangerous if true
(optional, implied by devmode
).devmode
: Put snap in development mode and disable security confinement if true
(optional).jailmode
: Put snap in enforced confinement mode if true
(optional).snap
: The contents of the snap file. Note that filename
is required to be set but the value is not used. Content-Type
is not required, but recommended. (optional, required if action
is install
)snap-path
: Directory to install in try mode (optional, required if action
is try
)./v2/snaps
).Example:
{
"action": "install",
"channel": "beta"
}
action
: Either install
, refresh
, remove
, revert
, enable
, disable
or switch
.channel
: From which channel to pull the new package (and track henceforth). Channels are a means to discern the maturity of a package or the software it contains, although the exact meaning is left to the application developer. One of edge
, beta
, candidate
, and stable
which is the default. (optional, only applicable when action
is install
or refresh
).classic
Put snap in classic mode and disable security confinement if true
(optional, only applicable with action
set to install
, refresh
, revert
).devmode
Put snap in development mode and disable security confinement if true
(optional, only applicable with action
set to install
, refresh
, revert
).ignore-validation
: Ignore validation by other snaps blocking the refresh if true
(optional, only applicable with action
set to refresh
).jailmode
: Put snap in enforced confinement mode if true
(optional, only applicable with action
set to install
, refresh
, revert
).revision
: Revision to install (optional, only applicable with action
set to install
, refresh
or revert
).purge
: Don’t save a snapshot with the snap’s data when removing if set to true
(optional, only applicable with action
set to remove
).keys
Request the configuration values corresponding to the specific keys
(comma-separated).
Example:
{
"conf-key1": "conf-value1",
"conf-key2": "conf-value2"
}
Returns an array containing all the snapshot metadata stored on the system.
Example:
{
"type": "sync",
"status-code": 200,
"status": "OK",
"result": [
{
"id": 40,
"snapshots": [
{
"set": 40,
"time": "2020-12-16T11:52:00.689328169Z",
"snap": "<snap-name>",
"revision": "x2",
"epoch": {
"read": [
0
],
"write": [
0
]
},
"summary": "",
"version": "6.0",
"sha3-384": {
"archive.tgz": "31fcc9cce5b5cdc68aeb38e3ef3866f00174dba158bce23870962b7dee12c1ec49a434346f6e8c7a1209858fb95e8020",
"user/<username>.tgz": "e19ab68a4aef50468667b873aefa83813919851b931b60782b0d8e4d6d12021402c757002ba3738855ed9e8da1268c50"
},
"size": 846235
}
]
}
]
}
The set-id is the snapshot identifier retrieved either from the ‘snap saved’ command or GET /v2/snapshots.
The response has Content-Type: application/x.snapd.snapshot
and Content-Length headers, plus the data stream which contains an uncompressed tar archive containing multiple zip files inside (one zip file for every snap included in the snapshot). The details of stream format might change, it is mainly intended for importing via POST /v2/snapshots
.
Content-Type: application/x.snapd.snapshot
Content-Length: <size of the imported snapshot> + the snapshot data (i.e. a tar archive of an exported snapshot).
Example:
{
"type": "sync",
"result": {
"set-id": 42,
"snaps": [
"foo",
"bar"
]
}
}
Example:
{
"series": "16",
"version": "2.0.17",
"os-release": {
"id": "ubuntu",
"version-id": "17.04"
},
"on-classic": true,
"managed": false,
"kernel-version": "4.10.0-15-generic"
"locations": {
"snap-mount-dir": "/snap",
"snap-bin-dir": "/snap/bin"
},
"refresh": {
"last": "2018-06-26T08:45:00+12:00",
"next": "2018-06-26T16:43:00+12:00",
"timer": "00:00~24:00/4"
},
"confinement": "strict",
"build-id": "efdd0b5e69b0742fa5e5bad0771df4d1df2459d1"
}
series
: The core series in use.version
: The version of snapd.os-release
: Object containing release information as sourced from /etc/os-release
. Contains id
which is a unique ID for each OS and version-id
which is a string describing the version of this OS.on-classic
: true if not running on a fully snap managed system.managed
: true if able to manage user accounts (?).kernel-version
: version of the kernel on this system.store
: the name of the store being used (optional, omitted if using the standard store).locations
: dict containing directory locations used by snapd (see below).refresh
: dict containing refresh times (optional, see below).confinement
: the level of confinement the system supports; either strict
or partial
.build-id
: a unique ID for this build of snapd.snap-mount-dir
: directory where snaps are mounted in.snap-bin-dir
: directory where snap apps are run from.last
: last time a refresh was performed (optional).next
: next time a refresh will be performed.hold
: time that refreshes will be applied (optional, if missing then applied immediately).timer
: times that updates are checked for.schedule
: schedule that updates are being checked with (legacy, replaced with timer
)."systems": [
{
"actions": [
{
"mode": "install",
"title": "Reinstall"
},
{
"mode": "recover",
"title": "Recover"
},
{
"mode": "run",
"title": "Run normally"
}
],
"brand": {
"display-name": "Canonical",
"id": "canonical",
"username": "canonical",
"validation": "verified"
},
"current": true,
"label": "20201124",
"model": {
"brand-id": "canonical",
"display-name": "ubuntu-core-20-amd64-dangerous",
"model": "ubuntu-core-20-amd64-dangerous"
}
}
]
current
: Current is true when the system running now was installed from this recovery system seed.label
: The label for this recovery system.model
: The model assertion information associated with this recovery system.brand
: The brand information associated with the model that this recovery system has.actions
: Actions available for this system.model
: The model name from the model assertion.brand-id
: The brand-id from the model assertion.display-name
: The display name of the model from the model assertion.username
: The username of the brand from the account assertion.id
: The account-id of the brand account assertion.display-name
: The display name of the brand from the account assertion.validation
: The validation status from the brand account assertion (see the brand account assertion docs for the valid values of this).mode
: The mode that the system transitions to when executing the given action.title
: A user presentable description of taking this action.Example response:
{
"action": "do",
"mode": "recover"
}
{
"action": "do",
"mode": "install",
}
{
"action": "reboot",
"mode": "run"
}
action
: Action to perform, which is either “reboot” or “do”. The “reboot” action will always reboot the device to the specified mode, even if the specified system and mode are the current system and mode. The “do” action is meant to consume fields of an action as provided in the actions list under the system in the response from a GET request to /v2/systems. Currently “mode” is the only such field, but there may be more fields added that correspond to additional details about the action that can be taken with the system. If the “do” action is provided for the current system and the current mode then no action is taken. For the current active recovery system, specifying a different mode from the current mode (and no other additional fields are specified with “do”), the actions “do” or “reboot” are equivalent.mode
: The mode to transition to. Modes “run” and “recover” are only available for the current active recovery system. The “install” mode is always available for all recovery systems and will trigger a full system install, deleting all user and system data for a clean installation as if from the factory.Example:
[
{
"email": "first-name.last-name@example.com",
"id": 1,
"username": "lp-username2"
},
{
"email": "other.name@example.com",
"id": 2,
"username": "user2"
},
]
email
: Email address associated with this account.id
: Unique ID for this user account.username
: Local username associated with this account (optional).Example:
{
"action": "create",
"email": "michael@example.com",
"sudoer": false
}
As a special case: if email is empty and known is set to true, the
command will create users for all system-user assertions that are
valid for this device.
Example:
[
{
"username": "mvo",
"ssh-keys": ["key1","key2"]
}
]
Example:
[
{
"message": "hello world",
"first-seen": "2017-01-23T12:00:44.806931498+13:00",
"last-seen": "2017-01-23T12:00:44.806931498+13:00"
},
{
"message": "hello again",
"first-seen": "2017-01-23T12:00:44.806931498+13:00",
"last-seen": "2017-01-23T12:00:44.806931498+13:00",
"delete-after": "1h30m"
},
]
message
: Message for this warning.first-seen
: The first time one of these messages was created in RFC3339 UTC format.last-seen
: The last time one of these messages was created in RFC3339 UTC format.last-shown
: The last time one of these messages was shown to the user in RFC3339 UTC format (optional).delete-after
: How much time since one of these was last seen should we drop the message (optional).repeat-after
: How much time since one of these was last shown should we repeat it (optional).The durations are in the form “72h3m0.5s” or “1us” or “1ns”.
Example:
{
"action": "okay",
"timestamp": "2017-01-23T12:00:44.806931498+13:00"
}
action
: Must be okay
.timestamp
: time to clear warnings before in RFC3339 UTC format.Last updated a month ago. Help improve this document in the forum.