Previous Topic: Importing Scenarios: import_scenario()Next Topic: Resuming Replication: resume_replication()


Synchronizing Running Scenarios: synchronize()

The synchronize API function lets you synchronize the data for scenarios.

Arguments

The synchronize API function includes the arguments described in the following table:

Name

Type

Description

session_id

uint

The session ID that was returned by calling the create_session API.

scenario_id

uint

The scenario ID that you want to synchronize.

sync_method

uint

The synchronization method, which can be one of the following options:

0 - File synchronization

1 - Block synchronization

2 - Volume synchronization (for only FullSystem scenario.)

ignore_same_files

bool

Ignore the same size/time files.

execute_sync

bool

Regulates whether to call this API synchronously or asynchronously.

message

out string

Contains the reason for failure when this API fails.

Return Values

The return type is Boolean. When the return value is true, the API completed successfully. When the return value is false, the API did not complete successfully. If the return value is false, review the message to determine the reason the API failed.

Example

public bool synchronize_example()
        {
            try
            {
                uint scenario_id = _scenario_id;
                string message = "";
                bool execute_sync = true;
                uint sync_method = 1;
                bool ignore_same_files = false;
                return get_mng().synchronize(_session_id, scenario_id, sync_method, ignore_same_files, execute_sync, out message);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return false;
        }