Eggplant Network Command-Line Scripting Requirements

The Eggplant Network Emulator can be scripted in one of two ways:

  • Use the supplied sample Python command-line script, You can download this script from the Eggplant downloads page for Eggplant Network.
    Note: This method requires an installed Python interpreter.
  • Use an application that creates a TCP socket and connects directly to the Emulator over TCP port 7292 using SSL.

When using the command-line script or API, there are certain requirements that must be met in order to get a successful outcome. Whether used from the API or from the command-line interface (CLI), all of the command options are prefixed with '--' (two dashes) to help them stand out. Where there is an argument, the argument should be quoted to avoid problems with spaces. Also, a valid username and password must be supplied for the Emulator.

For example, from Windows (assuming the script is available in the local folder and a Python interpreter is installed in the PATH environment variable), you could issue the following command:

C:\Users\Lara>python --host --user admin -password admin --getemulationsbyportpair

Some commands require more than one parameter. When that is the case, you still use only one argument and the parameters follow it, separated by a semicolon.

The script sends all of the commands (except for --host) directly to the Emulator and echo’s any responses direct to the terminal (stdout). Responses from the Emulator are also in the form of commands and values. For commands that do not have a specific response, the command --ok is returned. If there is an error when executing the command, it returns --error "<Message>".

Below are some examples along with their return values:

C:\Users\Lara>python --host --user admin -password admin --getlicense ports

--license "ports;4;"

C:\Users\Lara>python --host --user admin -password admin --notACommand

--error "Option [--notACommand] Unknown"

For full information on how to use the command line and also the sockets API, see Issuing Eggplant Network Emulator Commands.


This topic was last updated on August 19, 2021, at 03:30:51 PM.

Eggplant icon | Documentation Home | User Forums | Support | Copyright © 2021 Eggplant