Previous Topic: Setting Scenario Properties: set_scenario_data()Next Topic: Starting Scenarios: run()


Setting Host Properties: set_host_data()

The set_host_data API function lets you edit the host property. Most of the properties of the host can be updated by this API.

Arguments

The set_host_data 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 function API.

host_index

uint

The index of the host.

scenario_id

uint

The ID of the scenario.

property_name

string

The property name of the host. Each property has a unique name.

property_value

string

The value of the property.

Return Values

This function returns a value of true when the API call completes successfully. Otherwise, this function returns a value of false.

Example: Set host properties

//set the host name and IP address for the host
get_mng().set_host_data(_session_id, scenario_id, master_host_index, "Scenario.ReplicationTree.ReplNode.CommonHostProps.Host", "master");

get_mng().set_host_data(_session_id, scenario_id, master_host_index, "Scenario.ReplicationTree.ReplNode.CommonHostProps.IP", "155.35.78.187");

The following table lists common master host property names.

Property Name

Description

Scenario.ReplicationTree.ReplNode.CommonHostProps.Host

Master host name

Scenario.ReplicationTree.ReplNode.CommonHostProps.IP

Master host IP

Scenario.ReplicationTree.ReplNode.CommonHostProps.Data_IP

Master replication IP address

Scenario.ReplicationTree.ReplNode.CommonHostProps.Port

Master host connection port number

Scenario.ReplicationTree.ReplNode.CommonHostProps.SyncScriptBefore

Run script before synchronization

Scenario.ReplicationTree.ReplNode.CommonHostProps.SyncScriptBefore.Path

The script path

ReplicationTree.ReplNode.CommonHostProps.SyncScriptBefore.Args

The script arguments