Configure Virtual Lab Using JSON

This section describes how to configure a virtual lab using a JSON file.

When you create a virtual lab using Designer, a default .json configuration file is created automatically for the virtualization project and is accessible from the Virtualization Explorer.

If you are using one of the demos, you need to load the configuration file. For example, in the Hello World demo, you load the lab configuration from the main/resources/LabConfig.json file.

The configuration file is divided into the following sections:

virtualLab

In the virtualLab section, you define where all of the services will run and you pick the application model to use, for example:

"virtualLab": [
  {
    "id": "virtual-lab:30000",
    "displayName": "Hello Lab",
    "applicationModelId": "HelloApplicationModel"
  }
],

connector

In the connector section, you create an HTTP connector to provide connectivity for the REST virtual service that you want to simulate.

"connector": [
  {
    "id": "connector",
    "connectorType": "httpGateway",
    "properties": {
      "bindPort": 30000
    }
  }
],

virtualServiceInstance

In the virtualServiceInstance section, you create a service instance specifying the virtual endpoint path, including where it will be exposed, and you set the SIMULATE_SERVICE simulation mode.

"virtualServiceInstance": [
  {
    "virtualServiceId": "HelloServiceModel.RestServiceInterface",
    "serviceMode": "SIMULATE_SERVICE",
    "endpoints": [
      {
        "properties": {
          "httpVirtualPath": "/"
        },
        "requestConnectorId": "connector",
        "responseConnectorId": "connector",
        "realRequestConnectorId": "connector",
        "realResponseConnectorId": "connector"
      }
    ]
  }
]

 

Back to top

Next steps:

See also: