Manage virtual services from the command line

This task describes how to manage virtual services deployed on a Service Virtualization Server using the SVConfigurator command line interface.

Notes and Guidelines

  • Log file: When you run SVConfigurator, a log file is created in your Windows user profile directory.
  • Parameter values may not include spaces. If a value includes spaces, you must put it in quotation marks. For example, the path "C:\Users\Default\Documents\Service Virtualization\Projects\ShoppingCart Virtualization Project\ShoppingCart Virtualization Project\ShoppingCart Virtualization Project.vproj".
  • Some Service Virtualization configurations may deploy individual services on multiple Service Virtualization Servers. If you have defined the servers.properties file for virtual service deployment on multiple servers, you can use some of the SVConfigurator commands to simultaneously perform actions on all of the virtual services, using the --servers parameter. For details on multiple server deployment, see Deploy a virtual service on multiple Service Virtualization servers.

Back to top

Prerequisites

To work with an encrypted project, you may need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction. Select one of the following, based on the Java version with which you are working:

  • OpenJDK (included with JCE)

  • JDK 6

  • JDK 7

Back to top

Deploy services

Deploy or undeploy a virtualization project, or a single service from the project to the Service Virtualization Server.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd DEPLOYPROJECT [parameters] <project file> at the command line, using the following options:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description
    Required parameters  
    <project file>

    Path to a project file (.vproj or .vproja) whose services you want to deploy on the server.

    Optional parameters  

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

    -f or

    --force

    Force mode. If the service to be deployed is locked, the command automatically unlocks it. It is then automatically locked by SVConfigurator. Use caution with this option as you can delete another user’s data.

    -u or

    --undeploy

    Undeploys the project or service from the server.

    -s or

    --service <arg>

    Deploys only the specified service. You can specify a service by its name or ID.

    Tip: Use the List or View commands to find a service ID.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Used to deploy the project or service on multiple Service Virtualization Servers.

    Tip: You can also use the --use-server parameter to indicate an individual Service Virtualization Server on which to deploy the project or services.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

    --first-agent-fallback Automatically uses the first compatible agent if it cannot find the exact agent specified in the virtual service.
    -remap <vprojAgentID=serverAgentID>

    Switches the agent currently used in the project for the same type of agent on a different server.

    Use the parameter once for each agent in the project that you want to switch.

Back to top

Change service mode

Change the runtime mode of a service on the Service Virtualization Server to Learning, Simulating, or StandBy mode.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd CHANGEMODE [parameters] <service ident> <service mode> at the command line, using the following options:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description
    Required parameters  
    <service ident>

    Identification of the service you want to view. You can use either the name or ID of the service.

    If there is more than one service with the same name on the server, you have to either specify the project file where the service is located (using the optional –p parameter below), or identify the service by its ID.

    Tip: Use the List command to find a service ID.

    <service mode>

    The mode you want to switch the service to.

    Available options: SIMULATING, STAND_BY, LEARNING

    Service mode values are not case sensitive. The StandBy value corresponds to the STAND_BY option, maintaining compatibility with the List command.

    Optional parameters  

    -f or

    --force

    Force mode. If the service to be deployed is locked, the command will automatically unlock it. It is then automatically locked by SVConfigurator. Use caution with this option as you can delete another user’s data.

    -dm <arg> or

    --data-model <arg>

     

    -dm-default (for Simulation only)

    The data model to be used, specified by its name or ID.

    • When switching to Learning mode, you must specify one data model, one performance model, or both.
    • When switching to Simulation mode, this parameter is optional.

      • If you use -dm-default. the first data model according to an alphabetical listing is used.
      • Do not define this parameter if you want to Simulate performance only.

    Tip: Use the View command to find the service's data models.

    -pm <arg> or

    --perf-model <arg>

     

    -pm-default (for Simulation only)

    The performance model to use, specified by its name or ID.

    • When switching to Learning mode, you must specify one data model, one performance model, or both.

      Note: You may not use the Offline performance model.

    • When switching to Simulation mode, this parameter is optional.

      • If you use -pm-default. the first performance model according to an alphabetical listing is used.
      • When a performance model is not specified, no performance model is used.

    Tip: Use the View command to see the service's performance models.

    -p <source_path> or

    --project <source_path>

    Project file (.vproj or .vproja). Specify the project file in order to differentiate the services on the server. If there is more than one service with the same name but in different projects, and you want to identify the service by name, you must specify the project file.

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Used to change the mode of the virtual service on all Service Virtualization Servers on which is it deployed.

    Tip: You can also use the --use-server parameter to indicate an individual Service Virtualization Server on which to perform the action.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

Back to top

Export

Export all projects and services, or a single service, deployed on a Service Virtualization Server.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd EXPORT [parameters] at the command line, using the following options:

    Parameter Description
    Required parameters  

    -d or

    --directory <arg>

    The output folder. Specify a location for the exported services.

    Optional parameters  

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Note: You must also use the --use-server parameter to indicate the Service Virtualization Server from which to export.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

    -s or

    --service <arg>

    Exports only the specified service. You specify a service by its ID.

    Tip: Use the List or View commands to find a service ID.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -a or

    --archive <arg>

    Store output as a project archive (.vproja) instead of in the directory structure.

    -f or

    --continue-on-error

    Continue exporting other services, even if the export of one or more services has failed.

Back to top

Switch performance models during simulation

Select a different performance model when the virtual service is in Simulating mode, without redeploying virtual service data and restarting simulation. For more details on hotswap, see Virtual Service Editor.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd HOTSWAP [parameters] <service ident> at the command line, using the following options:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description
    Required parameters  
    <service ident> Identification of the service whose performance model you want to change.

    You can use either the name or ID of the service.

    If there is more than one service with the same name on the server, you have to either specify the project file where the service is located (using the optional –p parameter below), or identify the service by its ID.

    Tip: Use the List command to find a service ID.

    Optional parameters  

    -f or

    --force

    Force mode. If the service to be deployed is locked, the command will automatically unlock it. It is then automatically locked by SVConfigurator. Use caution with this option as you can delete another user’s data.

    -pm or

    --perf-model <arg>

    The performance model to use, specified by its name or ID.

    You must specify this parameter for Learning and Simulation modes.

    Tip: Use the View command to see the service's performance models.

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Used to change the performance model for the virtual service on all Service Virtualization Servers on which it is deployed.

    Note: You can also use the --use-server parameter to indicate an individual Service Virtualization Server on which to perform the action.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

Back to top

View service details

View information about a service deployed on the Service Virtualization Server, such as service name, ID, mode, deployment state, and data and performance models.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd VIEW [parameters] <service> at the command line, using the following options:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description
    Required parameters  
    <service>

    Identification of the service you want to view. You can use either the name or ID of the service.

    If there is more than one service with the same name on the server, you have to either specify the project file where the service is located (using the optional –p parameter below), or identify the service by its ID.

    Tip: Use the List command to find a service ID.

    Optional parameters  
    -r

    or

    --report

    Displays the runtime report for the service.

    -p <source_path> or

    --project <source_path>

    Project file (.vproj or .vproja). Specify the project file in order to differentiate the services on the server. If there is more than one service with the same name but in different projects, and you want to identify the service by name, you must specify the project file.

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Tip: You must also use the --use-server parameter to indicate the Service Virtualization Server on which the service is deployed.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

Back to top

List deployed services

List the services deployed on the Service Virtualization Server, and view basic service information, such as service name, mode (learning, simulating, standby, offline), and ID.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd LIST [parameters] at the command line, using the following optional parameters:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description

    -p <source_path>

    or

    --project <source_path>

    Project file (.vproj or .vproja). Specify the project file in order to list only the deployed services in the specified project.

    -pwd

    or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Note: You must also use the --use-server parameter to indicate the Service Virtualization Server on which to perform the List action.

    --use-server<arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

Back to top

List services in a project

List the services in a project file.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd LISTPROJECT [parameters] <project file> at the command line, using the following optional parameters:

    Note: For Linux, use SVConfigurator.sh.

    Parameter Description
    Required parameters  
    <project file>

    Path to a project file (.vproj or .vproja) whose contents you want to view.

    Optional parameters  

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

Back to top

Unlock services

Unlock a service deployed on the Service Virtualization Server that is locked by another user. You can then lock it by your client.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd UNLOCK [parameters] <service_identification> at the command line, using the following options:

    Parameter Description
    Required parameters  
    <service>

    Identification of the service you want to unlock. You can use either the name or ID of the service.

    If there is more than one service with the same name on the server, you have to either specify the project file where the service is located (using the optional –p parameter below), or identify the service by its ID.

    Tip: Use the List or View commands to find a service ID.

    Optional parameters  

    -p <source_path>

    or

    --project <source_path>

    Project file (.vproj or .vproja). Specify the project file in order to differentiate the services on the server. If there is more than one service with the same name but in different projects, and you want to identify the service by name, you must specify the project file.

    -l or

    --lock

    Locks the service by your client lock immediately after unlocking.

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint.

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Used to unlock the virtual service on all Service Virtualization Servers on which it is deployed.

    Tip: You can also use the --use-server parameter to indicate an individual Service Virtualization Server on which to perform the action.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

Back to top

Update a service

Download learned data from the Service Virtualization Server to update the data model, performance model, and service description of a specified service.

Note: The UPDATE command is not supported for service call activity.

For an example of how to automate this process, see Automation example.

  1. Do one of the following:

    • On the Service Virtualization Server, open a command prompt. Navigate to the \bin folder under the Service Virtualization Server installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Server\Tools\SVConfigurator\bin\.
    • On the Service Virtualization Designer machine, open a command prompt. Navigate to the \bin folder under the Designer installation folder. By default, C:\Program Files\Micro Focus\Service Virtualization Designer\Tools\SVConfigurator\bin\.
  2. Run SVConfigurator.cmd UPDATE [parameters] <project_file> at the command line, using the following optional parameters:

    Parameter Description
    Required parameters  
    project_file The project file (.vproj) that you want to update.
    Optional parameters  

    -pwd or

    --password <arg>

    Password for the server’s management endpoint.
    --servers <arg>

    The path to the servers.properties file containing a list of Service Virtualization Servers and their properties - management URL, username, and password.

    Note: You must also use the --use-server parameter to indicate the Service Virtualization Server from which to download the learned data.

    --use-server <arg>

    Selected server ID from the list of servers in the servers.properties file. Only the specified server will be used.

    Must be used together with the --servers parameter.

    -s or

    --service <arg>

    The service that you want to update. You can specify the service by its name or ID.

    Tip: Use the List or View commands to find a service ID.

    -url or

    --mgmt-url <arg>

    URL of the server’s management endpoint.
    --trust-everyone SVConfigurator validates SSL certificate when connecting to URL of the server’s management endpoint. This flag turns this behavior off.

    -usr or

    --username <arg>

    Username for the server’s management endpoint connection.

    -w or

    --project-password <arg>

    If the project is encrypted, specifies a password to decrypt the project content.

See also: