org.opensuse.tukit.Snapshot

org.opensuse.tukit.Snapshot — Snapshot interface

Methods

List       (in  's'      columns,
            out 'aa{ss}' list)
Delete     (in  's'      snapshot)
Cleanup    ()
RollbackTo (in  's'      snapshot,
            out 's'      snapshot)

Implemented Interfaces

Objects implementing org.opensuse.tukit.Snapshot also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties

Description

Details

List ()

List (in  's'      columns,
      out 'aa{ss}' list)

Retrieve a list of snapshots present on the system, including their properties. For performance reasons only the properties explicity requested via the columns arg are queried.

Request several common fields:

busctl call org.opensuse.tukit /org/opensuse/tukit/Snapshot org.opensuse.tukit.Snapshot List "s" "number,description,default,active,userdata,cleanup,date,user"

Example output on bus:

‣ Type=method_return  Endian=l  Flags=1  Version=1 Cookie=7  ReplyCookie=2  Timestamp="Tue 2022-08-02 11:28:14.651537 UTC"
  Sender=:1.6222  Destination=:1.7658
  UniqueName=:1.6222
  MESSAGE "aa{ss}" {
          ARRAY "a{ss}" {
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "number";
                                  STRING "0";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "description";
                                  STRING "current";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "default";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "active";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "userdata";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "cleanup";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "date";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "user";
                                  STRING "root";
                          };
                  };
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "number";
                                  STRING "2264";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "description";
                                  STRING "Snapshot Update of #2263";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "default";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "active";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "userdata";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "cleanup";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "date";
                                  STRING "2022-07-11 17:00:12";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "user";
                                  STRING "root";
                          };
                  };
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "number";
                                  STRING "2304";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "description";
                                  STRING "Snapshot Update of #2300";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "default";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "active";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "userdata";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "cleanup";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "date";
                                  STRING "2022-07-14 13:52:15";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "user";
                                  STRING "root";
                          };
                  };
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "number";
                                  STRING "2305";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "description";
                                  STRING "Open";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "default";
                                  STRING "yes";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "active";
                                  STRING "yes";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "userdata";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "cleanup";
                                  STRING "";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "date";
                                  STRING "2022-07-14 14:08:54";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "user";
                                  STRING "root";
                          };
                  };
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "number";
                                  STRING "2310";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "description";
                                  STRING "zypp(zypper)";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "default";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "active";
                                  STRING "no";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "userdata";
                                  STRING "important=yes";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "cleanup";
                                  STRING "number";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "date";
                                  STRING "2022-07-28 13:45:52";
                          };
                          DICT_ENTRY "ss" {
                                  STRING "user";
                                  STRING "root";
                          };
                  };
          };
  };
      

columns:

A comma separated list of fields to query, such as the snapshot id, the description or whether it is the default snapshot. The accepted field names currently match the accepted fields of the "snapper list" command. If the list is empty, an empty map array will be returned; this can be used to query the number of snapshots.

list:

An array of maps of property - value pairs, with the properties being the requested fields. The map arrays are grouped together in an outer array, separating the snapshots.

Errors

org.opensuse.tukit.Error:

if an error occured.

Delete ()

Delete (in  's' snapshot)

Deletes the given snapshot.

Deletion may fail if the snapshot is still in use, e.g. if it is the currently running or the default snapshot; use List with the active and default columns to check beforehand.

Example:

busctl call org.opensuse.tukit /org/opensuse/tukit/Snapshot org.opensuse.tukit.Snapshot Delete "s" "420"

snapshot:

The id of the snapshot to delete.

Errors

org.opensuse.tukit.Error:

if an error occured.

Cleanup ()

Cleanup ()

Marks unused snapshots created by tukit for deletion, i.e. all snapshots except for the currently used snapshot and the default snapshot.

Note that some snapshot implementations such as the snapper backend will not delete the snapshots immediately, but will delete the snapshots at a later time according to their own ruleset. Snapshots not created by tukit will not be touched.

Example:

busctl call org.opensuse.tukit /org/opensuse/tukit/Snapshot org.opensuse.tukit.Snapshot Cleanup

Errors

org.opensuse.tukit.Error:

if an error occured.

RollbackTo ()

RollbackTo (in  's' snapshot,
            out 's' snapshot)

Sets the given snapshot as the new default snapshot, i.e. the system will boot into that snapshot on next reboot.

On some systems (e.g. snapper with a read-write root file system) the snapshot may be a new copy of the snapshot to be rolled back to, so the new default snapshot number may differ from the given one.

Example:

busctl call org.opensuse.tukit /org/opensuse/tukit/Snapshot org.opensuse.tukit.Snapshot RollbackTo "s" "420"

snapshot:

Requires the id of the snapshot to roll back to.

snapshot:

Returns the id of the new default snapshot; this may differ from the given snapshot id, see the description above.

Errors

org.opensuse.tukit.Error:

if an error occured.