Command-Line Interface Utility

Applies to VirtServer 3.24.0, last modified on December 20, 2024

You can deploy and modify virtual services (virtual APIs) on VirtServer from the command line. For this purpose, you use the command-line interface utility provided with VirtServer and ReadyAPI installation.

Starting from the 1.12.0 version (shipped with VirtServer 3.10.0), the utility returns only two exit codes: 0 (success) and 1 (error). If your automation relies on them, you may need to modify it when you move to the new version of the utility.

About the VirtServer command-line interface utility

The VirtServer command-line utility is typically used to work with virtual services on VirtServer from client machines that do not have access to ReadyAPI. You can deploy and update services from it without stopping VirtServer, or integrate a command into your development environment. You can also start virtual services during your builds by using Maven integration or the Jenkins plugin.

Tip: If you do not automate your virtual service startup, you can also use the VirtServer Web UI to work with virtual services from your browser.

Requirements and limitations

  • To interact with VirtServer, you need a user on it. Use the VirtServer web interface or the VirtServer application command line to add a user.

  • The VirtServer command-line interface does not support working with JMS virtual services that use HermesJMS. Use the direct connection from ReadyAPI to deploy the services from the command line.

Get the command line interface utility

The command-line interface is included in VirtServer and ReadyAPI installations. It includes:

  • Executable file: virtserver-cli.bat/.sh file (.bat on Windows, .sh on Linux and MacOS). You can find it in the ReadyAPI/bin or VirtServer/bin folder.

  • Library: virtserver-cli-<library-version>.jar. You can find it in the ReadyAPI/tools or VirtServer/tools folder.

    Tip: The library is also available in the ReadyAPI Download Center.

Syntax

The general command line syntax is as follows:

<path>/virtserver-cli -s IP:port [more-options]

Argument Description
-s IP:port, or
‑‑server IP:port

Required at least once. The IP address and port of the VirtServer instance to which you are sending the command. For example, ‑s 192.168.1.12:9090.

Once you specify the VirtServer address, you can omit the argument. In this case, the command-line utility will use the address specified in the previous command. When you need to change the address, specify the -s (‑‑server) argument again.

See Also

Managing Virts with the CLI
Administering VirtServer CLI
Connect With ReadyAPI
VirtServer Tutorial
VirtServer Command-Line Arguments

Highlight search results