org.opensuse.tukit.Transaction

org.opensuse.tukit.Transaction — Transaction interface

Methods

ExecuteWithOpts  (in  's'     base,
                  in  's'     command,
                  in  'a{sv}' options,
                  out 's'     snapshot)
ExecuteAndReboot (in  's'     base,
                  in  's'     command,
                  in  's'     rebootmethod,
                  out 's'     snapshot)
Execute          (in  's'     base,
                  in  's'     command,
                  out 's'     snapshot)
OpenWithOpts     (in  's'     base,
                  in  'a{sv}' options,
                  out 's'     snapshot)
Open             (in  's'     base,
                  out 's'     snapshot)
Call             (in  's'     transaction,
                  in  's'     command)
CallExt          (in  's'     transaction,
                  in  's'     command)
CallWithOpts     (in  's'     transaction,
                  in  's'     command,
                  in  'a{sv}' options)
CloseWithOpts    (in  's'     transaction,
                  in  'a{sv}' options)
Close            (in  's'     transaction)
AbortWithOpts    (in  's'     transaction,
                  in  'a{sv}' options)
Abort            (in  's'     transaction)

Signals

TransactionOpened ('s' snapshot)
CommandExecuted   ('s' snapshot,
                   'i' returncode,
                   's' output)
Error             ('s' snapshot,
                   'i' returncode,
                   's' output)

Implemented Interfaces

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

Description

Details

ExecuteWithOpts ()

ExecuteWithOpts (in  's'     base,
                 in  's'     command,
                 in  'a{sv}' options,
                 out 's'     snapshot)

Creates a new snapshot and executes the given command. If execution was successful the snapshot will be set as the new snapshot, if the command returned with an error code the snapshot will be discarded.

This command combines the Open, Call and Close / Abort calls in one method. For more fine-grained control, e.g. to execute several commands in one snapshot or to control snapshot deletion use the individual commands.

As it can take a long time until a command is executed the command is executed asynchronously. The actual result is returned either via a CommandExecuted signal on success or an Error signal if the command returned with an error code. Additionally the TransactionOpened signal is sent as soon as the new snapshot has been created.

base:

The snapshot id to use as a base for the new snapshot. Can be active to base the snapshot on the currently running system, default to use the current default snapshot as a base (which may or may not be identical to active) or any specific existing snapshot id.

command:

The command to execute. To execute several commands at once a syntax such as bash -c 'command1; command2' may be used.

options:

Accepts the following options:

  • Description: Sets a custom description for the snapshot. The description in the variant value has to be of type string.
  • Reboot: Indicate the reboot method to use; see the transactional-update.conf man page for supported reboot methods. The variant value containing the reboot method has to be of type string.
  • Options from tukit.conf: Allows overwriting the options defined in tukit.conf, e.g. to force a different snapshot manager or specifing an image source. See the tukit.conf man page for a complete list. The variant value containing the reboot method has to be of type string.

snapshot:

The id of the new snapshot. Returns as soon the snapshot has been created.

Errors

org.opensuse.tukit.Error:

if an error occured before the snapshot could be created - errors after that point will be communicated via the Error signal.


ExecuteAndReboot ()

ExecuteAndReboot (in  's' base,
                  in  's' command,
                  in  's' rebootmethod,
                  out 's' snapshot)
Identical to ExecuteWithOpts, but does not allow setting any options except for the Reboot option.

base:

See ExecuteWithOpts.

command:

See ExecuteWithOpts.

rebootmethod:

Sets the Reboot option, for possible values see the corresponding option in ExecuteWithOpts.

snapshot:

See ExecuteWithOpts.

Errors

org.opensuse.tukit.Error:

See ExecuteWithOpts.


Execute ()

Execute (in  's' base,
         in  's' command,
         out 's' snapshot)

Identical to ExecuteWithOpts, but doesn't allow setting any options.

base:

See ExecuteWithOpts.

command:

See ExecuteWithOpts.

snapshot:

See ExecuteWithOpts.

Errors

org.opensuse.tukit.Error:

See ExecuteWithOpts.


OpenWithOpts ()

OpenWithOpts (in  's'     base,
              in  'a{sv}' options,
              out 's'     snapshot)

Creates a new snapshot using the default snapshot manager. The new snapshot id is returned both as a return value and announced via the TransactionOpened signal.

base:

The snapshot id to use as a base for the new snapshot. Can be active to base the snapshot on the currently running system, default to use the current default snapshot as a base (which may or may not be identical to active) or any specific existing snapshot id.

options:

Accepts the following options:

  • Description: Sets a custom description for the snapshot. The description in the variant value has to be of type string.
  • Options from tukit.conf: Allows overwriting the options defined in tukit.conf, e.g. to force a different snapshot manager or specifing an image source. See the tukit.conf man page for a complete list. The variant value containing the reboot method has to be of type string.

snapshot:

The id of the new snapshot.

Errors

org.opensuse.tukit.Error:

if an error occured.

Open ()

Open (in  's' base,
      out 's' snapshot)

Identical to OpenWithOpts, but doesn't allow setting any options.

base:

See OpenWithOpts.

snapshot:

See OpenWithOpts.

Errors

org.opensuse.tukit.Error:

if an error occured.

Call ()

Call (in  's' transaction,
      in  's' command)

Execute the given command in the specified snapshot. The snapshot will not automatically be discarded if the command should return with error.

As it can take a long time until a command returns the command is executed asynchronously. The actual result and output is returned either via a CommandExecuted signal on success or an Error signal if the command returned with an error code.

transaction:

The snapshot id. The snapshot must still be in open state, i.e. it must not have been finalized with Close yet.

command:

The command to execute.

Errors

org.opensuse.tukit.Error:

if an error occured before the snapshot could be resumed - errors after that point will be communicated via the Error signal.

CallExt ()

CallExt (in  's' transaction,
         in  's' command)

Replace any standalone occurrence of {} in command parameter with the snapshot's mount directory and execute the given command outside of the snapshot in the running system, but while the update environment is mounted. This may be useful if the command needs access to the current environment, e.g. to copy a file from a directory not accessible from within the chroot environment.

As it can take a long time until a command returns the command is executed asynchronously. The actual result and output is returned either via a CommandExecuted signal on success or an Error signal if the command returned with an error code.

transaction:

The snapshot id. The snapshot must still be in open state, i.e. it must not have been finalized with Close yet.

command:

The command to execute. Any occurence of {} will be replaced with the (writable) directory of the snapshot.

Errors

org.opensuse.tukit.Error:

if an error occured before the snapshot could be resumed - errors after that point will be communicated via the Error signal.

CallWithOpts ()

CallWithOpts (in  's'     transaction,
              in  's'     command,
              in  'a{sv}' options)

If called with the CallExt argument see CallExt, otherwise see Call. In contrast to these two methods it's possible to specify additional options here to overwrite settings from tukit.conf.

transaction:

The snapshot id. The snapshot must still be in open state, i.e. it must not have been finalized with Close yet.

command:

The command to execute. If called with the CallExt option any occurence of {} will be replaced with the (writable) directory of the snapshot.

options:

Accepts the following options:

  • CallExt: When unset or set to 0 the command will be executed as described in the Call method, when set to 1 it will be executed as described in the CallExt method. The variant value containing the reboot method has to be of type integer.
  • Options from tukit.conf: Allows overwriting the options defined in tukit.conf, e.g. to force a different snapshot manager or specifing an image source. See the tukit.conf man page for a complete list. The variant value containing the reboot method has to be of type string.

Errors

org.opensuse.tukit.Error:

if an error occured before the snapshot could be resumed - errors after that point will be communicated via the Error signal.

CloseWithOpts ()

CloseWithOpts (in  's'     transaction,
               in  'a{sv}' options)

Sets the snapshot as the new default snapshot and prevents any further modification.

transaction:

The snapshot id.

options:

Accepts the following options:

  • Options from tukit.conf: Allows overwriting the options defined in tukit.conf, e.g. to force a different snapshot manager or specifing an image source. See the tukit.conf man page for a complete list. The variant value containing the reboot method has to be of type string.

Errors

org.opensuse.tukit.Error:

if an error occured.

Close ()

Close (in  's' transaction)

Identical to OpenWithOpts, but doesn't allow setting any options.

transaction:

See CloseWithOpts.

Errors

org.opensuse.tukit.Error:

if an error occured.

AbortWithOpts ()

AbortWithOpts (in  's'     transaction,
               in  'a{sv}' options)

Discards the snapshot completely.

transaction:

The snapshot id. The snapshot must still be in open state, i.e. it must not have been finalized with Close yet.

options:

Accepts the following options:

  • Options from tukit.conf: Allows overwriting the options defined in tukit.conf, e.g. to force a different snapshot manager or specifing an image source. See the tukit.conf man page for a complete list. The variant value containing the reboot method has to be of type string.

Errors

org.opensuse.tukit.Error:

if an error occured.

Abort ()

Abort (in  's' transaction)

Discards the snapshot completely.

transaction:

The snapshot id. The snapshot must still be in open state, i.e. it must not have been finalized with Close yet.

Errors

org.opensuse.tukit.Error:

if an error occured.

Signal Details

The TransactionOpened signal

TransactionOpened ('s' snapshot)

Sent when a new snapshot was created with the D-Bus interface. Snapshots created via the command line or API will not trigger this event.

snapshot:

The snapshot id.

The CommandExecuted signal

CommandExecuted ('s' snapshot,
                 'i' returncode,
                 's' output)

Sent when the anyncronously executed commands initiated by the Execute... or Call... methods return.

snapshot:

The snapshot id the command was executed in.

returncode:

The exit code of the command.

output:

The output (stdout and stderr) of the command while it was executed.

The Error signal

Error ('s' snapshot,
       'i' returncode,
       's' output)

Any error occuring during the asyncronous execution of commands initiated with the Execute... or Call... methods after the method returned is signalled via this signal. The exit code of the command itself is returned via the CommandExecuted signal (if the error didn't occur before the execution).

snapshot:

The snapshot id the error happened in.

returncode:

The return code of the failing function.

output:

The error message of the failed function.