Configuration backup manipulation

Overview

// global functions

te_errno cfg_create_backup(char** name);
te_errno cfg_verify_backup(const char* name);
te_errno cfg_restore_backup(const char* name);
te_errno cfg_restore_backup_ta(const char* ta, const char* name);
te_errno cfg_restore_backup_nohistory(const char* name);
te_errno cfg_release_backup(char** name);
te_errno cfg_create_config(const char* name, bool history);
te_errno cfg_process_history(const char* filename, const te_kvpair_h* expand_vars);

Detailed Documentation

Global Functions

te_errno cfg_create_backup(char** name)

Create a backup.

Parameters:

name

OUT: location for backup file name

Returns:

Status code (see te_errno.h)

te_errno cfg_verify_backup(const char* name)

Verify the backup.

Parameters:

name

name returned by cfg_create_backup

0

current configuration is equal to backup

TE_EBACKUP

current configuration differs from backup

Returns:

Status code (see te_errno.h)

te_errno cfg_restore_backup(const char* name)

Restore the backup.

Parameters:

name

name returned by cfg_create_backup

Returns:

Status code (see te_errno.h)

te_errno cfg_restore_backup_ta(const char* ta, const char* name)

Restore the TA backup.

Parameters:

ta

Test Agent name

name

name returned by cfg_create_backup()

Returns:

Status code (see te_errno.h)

te_errno cfg_restore_backup_nohistory(const char* name)

Restore the backup w/o processing history.

Parameters:

name

name returned by cfg_create_backup

Returns:

Status code (see te_errno.h)

te_errno cfg_release_backup(char** name)

Ask Configurator to forget about the backup, if known.

Parameters:

name

Location of name returned by cfg_create_backup (set to NULL on success)

Returns:

Status code

te_errno cfg_create_config(const char* name, bool history)

Create a configuration file.

Parameters:

name

configuration file name

history

if true “history” configuration file is created; otherwise “backup” configuration file is created

Returns:

Status code (see te_errno.h)

te_errno cfg_process_history(const char* filename, const te_kvpair_h* expand_vars)

Process a history configuration file.

Parameters:

filename

history configuration file name

expand_vars

List of key-value pairs for expansion in file, NULL if environment variables are used for substitutions

Returns:

Status code (see te_errno.h)