Previous Topic: Integrating with Arcserve Backup: add_bab_credentials()Next Topic: Removing Scenarios: remove_scenario()


Updating Scenario Properties: update_scenario()

The update_scenario API function lets you update scenario data at run time.

Arguments

The update_scenario 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 update.

scenario_data_str

ref string

The data about the scenario. When the operation completes successfully, the new scenario data is provided.

why_not_reason

ref string

Contains the reason for failure when this API fails.

Return Values

The return values provide the data for the scenario in xml format.

Example

public bool update_scenario_example()
        {
            try
            {
                uint scenario_id = _scenario_id;
                string why_not_reason = "";
                string scenario_data_str = get_mng().get_scenario_data(scenario_id);
                //do some changes for  the scenario.
                return get_mng().update_scenario(_session_id, scenario_id, ref scenario_data_str, out why_not_reason);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return false;
        }