|
The CLI script API methods are added to the ScriptInterface to perform operations such as getScriptFile, add parameters, get parameter value, delete parameters, etc. from a JPython script. The SNMP script API methods can also be used within the Jython scripts to implement the IOS commands.
The CLI and SNMP script API methods are provided under <simulator home>/examples/javadocs directory. The name of the Script API file is CLI_SimScrIntf.html
a. getScriptFile method
This method returns the script file for the given command.
|
public void getScriptFile(String command, String modeis)
|
where
command - IOS command
modeis - The mode in which the IOS Command is
present
b. updateScripFile method
This method updates the script file for a particular command.
|
public void updateScriptFile (String command, String scriptfile, String modeis)
|
where ,
command -
IOS command
scriptfile - The new script file to be replaced for the command
modeis - The mode in which the command is
present .
c. getCurrentCommand method
This method returns the command which is now being executed .
|
public String getCurrentCommand( ) |
d. getCurrentLevel method
This method returns the level (Integer values for mode ) at which the command
is executed.
|
public int getCurrentLevel( ) |
Note : The modes supported are represented by Integer values. User mode - 5 , Enable mode - 6 , Config mode - 7 , Config interface mode - 9
e. getMode
method
This method returns the mode in which the command is executed.
|
public String getMode ( )
|
f. changeMode method
This method changes the mode of the client to the specified one
, when the mode is enable and greater.
|
public void changeMode(int mode)
|
where ,
mode - Integer value of the mode .
g. getCmdWord method
This method returns the respective command word for the specified index
of the currently executing command.
|
public String getCmdWord(int index)
|
h. updateHost method
This method is used to update the hostname of the client with the given
name.
|
public void updateHost(String name)
|
where
name - refers to the new Host name
i. getInterfaceStatus method
This method gives what is the interface being configured.
|
public String getInterfaceStatus( )
|
j. addParameters method
|
public void addParameters(String paramKey,String paramValue)
|
|
public String getParamValue(String paramKey)
|
|
public void deleteParameters(String paramKey);
|
|
public Vector getParamListValues(String paramKey);
|
|
public String executeScript(String scriptFile)
|
|
public Vector getParamKeyList(String paramKey)
|
|
public void setConnectionTime (int time )
|
|
public void showHistory()
|
|
public void updateIPAddress(String ipAddress)
|
|
public void setEnablePassword(String password)
|
|
public String getEnablePassword()
|
|
public boolean isInterfaceUp(String ipAddress)
|
|
public int getRoundTripTime()
|
|
public int getMaxRoundTripTime();
|
|
public int getMinRoundTripTime();
|
|
public void setPassword(String password);
|
|
public String getPassword();
|
|