Public Member Functions | |
SCPM (int options=0, ostream &info_out=cout, ostream &hash_out=cout, string root="") | |
~SCPM () | |
Destructor. | |
bool | Enable (bool force=false) |
Makes SCPM ready for use. | |
bool | Disable () |
Completely disables SCPM. | |
bool | Active (string &profile) |
query for active profile | |
bool | List (vector< string > &profiles) |
lists all profiles | |
bool | Add (string profile, bool auto_switch=true) |
Adds a new profile. | |
bool | Copy (string source_profile, string profile) |
Adds a new profile. | |
bool | Create (string profile, string source_profile) |
Adds a new profile. | |
bool | Delete (string profile) |
Deletes a profile. | |
bool | Rename (string profile, string newprofile) |
Renames a profile. | |
bool | Reload () |
Reloads the current profile. | |
bool | PrepareSwitch (string profile, switch_info_t &switch_info) |
Prepares the switch to profile profile. | |
bool | Switch (switch_info_t &switch_info) |
Perform prepared switch. | |
bool | Save (switch_info_t &switch_info) |
Save modified resources. | |
bool | Modify (string profile, string action) |
Perform a profile modify action. | |
bool | Set (string command, string argument, string profile="") |
Set profile options. | |
bool | Get (string command, string &result, string profile="") |
Get profile options. | |
bool | Status (scpm_status_t &status) |
Query some status information. | |
bool | ShowChanges (ostream &output, string resource_type, string resource_name) |
Shows changes of given resource. | |
bool | SetResourceSet (string set) |
Sets a resource set for use. | |
bool | GetResourceSet (string &set) |
Gets the active resource set. | |
bool | ListResourceSets (vector< string > &predefined, vector< string > &individual) |
Gets all defined resource sets. | |
bool | CopyResourceSet (string set, string newset) |
Copies a resource set. | |
bool | DeleteResourceSet (string set) |
Deletes an individual resource set. | |
bool | ListResourceGroups (vector< resource_group_t > &groups) |
Generates a list of all installed resource groups. | |
bool | GetResourceGroup (const string &name, vector< resource_entry_t > &group) |
Queries resource group information. | |
bool | GetResourceGroup (const string &name, vector< resource_entry_t > &group, string &description) |
Queries resource group information. | |
bool | SetResourceGroup (const string &name, const vector< resource_entry_t > &group, const string &description) |
Modifies or creates a resource group. | |
bool | DeleteResourceGroup (const string &group) |
Removes a resource group. | |
bool | RenameResourceGroup (const string &group, const string &newgroup) |
Renames a resource group. | |
bool | SetActiveResourceGroups (const vector< string > &groups) |
Sets active resource groups. | |
bool | GetActiveResourceGroups (vector< string > &groups) |
Lists active resource groups. | |
bool | ActivateResourceGroup (const string &group, bool auto_add=false) |
Activates a resource group. | |
bool | DeactivateResourceGroup (const string &group, bool auto_remove=false) |
Deactivates a resource group. | |
bool | ResetResourceGroup (const string &group) |
Resets defaults of a resource group. | |
bool | ResetAllGroups () |
Resets all resource groups. | |
bool | RebuildDB () |
Performs a rebuild of the database. | |
bool | SetConfigOption (const string &option, const string &value) |
Sets a configuartion option. | |
bool | GetConfigOption (const string &option, string &value) |
Sets a configuartion option. | |
bool | Update (const string &scriptname, vector< pair< string, string > > resources) |
bool | UpdateResources () |
bool | Backup (const string &command, const vector< pair< string, string > > &resources, const string &profile, vector< backup_info_t > *reslist=NULL) |
Most of the member functions return a bool
variable. This indicates the success of the operation. In case anything went wrong you get back false. The global variable scpm_error
holds the apropriate error message.
|
Destructor, it saves the SCDB and cleans up stuff. Make sure you don't suppress calling it (e.g. by using |
|
Sets SCPM into enabled status. In case you call SCPM::Enable() the first time (that means, no database is there) the SCPM system gets initialized. This can take a while. You can force re-enabling by setting force to |
|
Disables SCPM, that means, you can not use it anymore. Nothing gets deleted by calling this function. |
|
This determines the currently active profile. |
|
Generates a list of string with all defined profiles. |
|
Creates a new profile from the current configuration. In case the optional auto_switch variable is set to true, the added profile gets automatically the active one. All possible changes to the old profile get dropped, but you have them in the new active one, of course. It returns true on success, false otherwise. |
|
Creates a new profile by using source_profile as template. It returns true on success, false otherwise. |
|
Creates a new profile by using source_profile as template. It returns true on success, false otherwise. |
|
Erases the given profile from the database and removes its data from the harddisk. |
|
Renames a profile. You cannot rename the active or the default profile. |
|
Does a reload of the active profile. This function is an alias for Switch( active_profile ). FIXME: This is actually broken. The cli frontend implements this actually by calling SCPM::PrepareSwitch and afterwards SCPM::Switch with the current profile as argument. This is basically the same. |
|
This function performs the preparation of the switch to another profile. You need to give an initialized |
|
Performs the prepared switch to the new profile. That means, it stops services, restores resources from the new profile, and starts resources accordingly. |
|
Saves all modified resource listed in the switch_info_t struct that have the save flag set. In case the save_mode element of the struct is set to |
|
NOT YET IMPLEMENTED |
|
Actually the Set command offers the possibility to set profile descriptions and profile switch scripts. The description is set by passing |
|
With the Get command you can query that stuff you can set using the SCPM::Set command. Look there to find out what you can set/get. |
|
The Status function collects some status information and writes them in the passed scpm_status_t object. Look at the struct members for details. |
|
With ShowChanges you can let SCPM determine the changes of a Resource between its current state and its state saved in the active profile. The changes will be written on the passed stream object. |
|
This function sets the resource set |
|
This function determines the active resource set (if any) and writes its name into the passed |
|
ListResourceSets determines all defined resource sets and writes them into the passed string vectors. The predefined resource sets come from the SCPM package itself, the individual resource sets are user defined ones. It is possible to have predefined and individual resource sets with the same name. In that case the individual one is used. |
|
This copies a resource set. The newly created resource set |
|
Deletes the given resource set. This has to be an individual one, you cannot remove predefined resource sets. |
|
This function determines all installed resource groups and writes them into the group refernence vector. |
|
This command looks up the resource group called |
|
This is a variant of SCPM::GetResourceGroup which also returns the description. |
|
Using SetResourceGroup you can modify an existing group or create new ones. You need to create a vecor of resource_entry_t variables defining the resources the group should have. In case the resource group exists and you supply exactly the resources the original group that came with the SCPM installation, the group gets the |
|
This removes a user defined or user modified resource group. Original resource groups won't get deleted from the system. |
|
This renames a user defined resource group. In case the group was active, the active group list gets updated, too. |
|
This function marks the groups listed in |
|
This generates a list of active resource groups and writes them into |
|
This adds the wanted resource group to the active groups list. The group must exists, of course, adding an already active group does not harm (it generates a warning, though). In case {auto_add} is set, the resources of this group get automatically added to the database and all profiles. |
|
This removes the given resource group from the active groups list. The group must exists, of course, deactivating an already deactive group does not harm (it generates a warning, though). In case {auto_add} is set, the resources of this group get automatically removed from the database and all profiles. |
|
Resets a resource group to its factory defaults. This does not work with user defined groups. |
|
Resets all resource groups to its defaults, removes user defined resource groups, and restores original active groups list. |
|
This brings your SCDB up to date. More detailed that means all resources, that do not exist in your system but in the database get removed, and new resources which are not listed in the database get added. The current state of all new resources get saved to all profiles. You may want to call this function after a resource set change, otherwise you will get a quite long list of modified resources on the next switch. Please note: this may daramtically modify your existing database! It may even remove data! |
|
option can be one of DEBUG VERBOSE BOOTMODE SWITCHMODE. Valid values are yes or no for DEBUG and VERBOSE, and skip, force, or normal for BOOTMODE and SWITCHMODE. |
|
option can be one of DEBUG VERBOSE BOOTMODE SWITCHMODE. Depending on the settings value becomes yes or no for DEBUG and VERBOSE, and skip, force, or normal for BOOTMODE and SWITCHMODE. |