Previous Topic: Starting Scenarios: run()Next Topic: Pausing Data Replication: suspend_replication()


Stopping Scenarios: stop()

The stop API function lets you stop running scenarios.

Arguments

The stop 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 to be stopped.

execute_sync

bool

Regulates whether to call this API synchronously or asynchronously. When you set this argument to true, the API function will not return a value until the scenario is stopped. Otherwise, the function return a value immediately.

why_not_reason

out string

Contains a detailed description of the error 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 returned in the why_not_reason argument to determine why the API failed.

Example

public bool stop_example()
        {
            try
            {
                uint scenario_id = _scenario_id;
                string why_not_reason = "";
                bool execute_sync = true;
                return get_mng().stop(_session_id, scenario_id, execute_sync, out why_not_reason);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return false;
        }