yast2-snapper
|
An interface class between YaST2 and Snapper Agent. More...
#include <SnapperAgent.h>
Public Member Functions | |
SnapperAgent () | |
virtual | ~SnapperAgent () |
virtual YCPValue | Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull()) |
virtual YCPBoolean | Write (const YCPPath &path, const YCPValue &arg, const YCPValue &arg2=YCPNull()) |
virtual YCPValue | Execute (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &arg2=YCPNull()) |
virtual YCPList | Dir (const YCPPath &path) |
virtual YCPValue | otherCommand (const YCPTerm &term) |
Private Member Functions | |
string | getValue (const YCPMap &map, const YCPString &key, const string &deflt) |
int | getIntValue (const YCPMap &map, const YCPString &key, const int deflt) |
YCPList | getListValue (const YCPMap &map, const YCPString &key) |
YCPMap | getMapValue (const YCPMap &map, const YCPString &key) |
Private Attributes | |
snapper::Snapper * | sh |
bool | snapper_initialized |
string | snapper_error |
An interface class between YaST2 and Snapper Agent.
SnapperAgent::SnapperAgent | ( | ) |
Default constructor.
Constructor
References log_do(), log_query(), sh, snapper_error, and snapper_initialized.
|
virtual |
|
virtual |
Provides SCR Execute ().
Execute
Execute (.snapper) call: Initialize snapper object
Execute(.snapper.delete_config, $[ "config_name" : name $] -> deletes given configuration
Rollback the list of given files from snapshot num1 to num2 (system by default)
References btrfs_ioctl_call(), getIntValue(), getListValue(), getMapValue(), getValue(), YCPMap::hasKey(), PC, sh, YCPList::size(), snapper_error, snapper_initialized, YCPList::value(), y2debug, y2error, y2milestone, and ycpmap2stringmap().
|
private |
Search the map for value of given key
map | YCP Map to look in |
key | key we are looking for |
deflt | the default value to be returned if key is not found |
References YCPMap::value().
Search the map for value of given key; key is string and value is YCPList
References YCPMap::value().
Referenced by Execute().
Search the map for value of given key; key is string and value is YCPMap
References YCPMap::value().
Referenced by Execute().
|
private |
search the map for value of given key; both key and value have to be strings when key is not present, default value is returned
References YCPMap::value().
Referenced by Execute().
|
virtual |
Provides SCR Read ().
path | Path that should be read. |
arg | Additional parameter. |
Read
Read (.snapper.is_subvolume, "path/to/dir") -> returns true if given directory is a subvolume
Read (.snapper.error) -> returns last error message
Read (.snapper.path, $[ "num" : num]) -> returns the path to directory with given snapshot
Read(.snapper.snapshots) -> return list of snapshot description maps
Read(.snapper.diff_list) -> show difference between snapnots num1 and num2 as list.
Read(.snapper.diff_index) -> show difference between snapnots num1 and num2 as one-level map: (mapping each file to its changes)
Read(.snapper.diff_tree) -> show difference between snapnots num1 and num2 as tree.
Implements SCRAgent.
References YCPList::add(), YCPMap::add(), getIntValue(), make_ycpmap(), map2ycpmap(), PC, sh, snapper_error, snapper_initialized, Tree::trees, y2debug, and y2error.
|
virtual |
|
private |
Agent private variables and methods
Referenced by Execute(), Read(), SnapperAgent(), and ~SnapperAgent().
|
private |
Referenced by Execute(), Read(), and SnapperAgent().
|
private |
Referenced by Execute(), Read(), and SnapperAgent().