Available methods
StartTest
The StartTest method sends a request to start a NeoLoad test.
Parameters:
-
ScenarioName (required): The name of the scenario to launch.
-
TestResultName (optional): The name of the test result.
-
Description (optional): The description of the test result.
-
Debug (optional): Default value is "false". If set to "true", the test result is launch in debug mode.
-
NLWeb (optional): Default value is "false". If set to "true", the test results are sent to NeoLoad web.
-
NLWebToken (optional): The NeoLoad Web token.
-
Variables (optional): A map allowing to update or create NeoLoad variables.
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/StartTest HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
Connection: keepalive
{
"d":
{
"ScenarioName": "WANImpact Local",
"TestResultName": "Test Report",
"Description": "Testing the prod",
"NLWeb": true,
"Variables": "{\"URL\"=\"prod-app.com\"}"
}
}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.ExecutionContext;
import com.neotys.rest.runtime.model.StartTestParams;
public class StartTestExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
client.startTest(new StartTestParams.StartTestBuilder("WANImpact Local")
.testResultName("Test Report")
.description("Testing the prod")
.nlweb(true)
.executionContext(ExecutionContext.newBuilder()
.variable("URL", "prod-app.com")
.build())
.build());
}
}

using Neotys.RuntimeAPI.Client;
using Neotys.RuntimeAPI.Model;
namespace TestRuntimeAPI
{
class StartTest
{
public static void Main(string[] args)
{
string url = "http://localhost:7400/Design/v1/Service.svc/";
IRuntimeAPIClient client = RuntimeAPIClientFactory.NewClient(url);
client.StartTest(new StartTestParamsBuilder("WANImpact Local")
.testResultName("Test Report")
.description("Testing the prod")
.nlWeb(true)
.executionContext(new ExecutionContextBuilder()
.variable("URL", "prod-app.com").Build())
.Build());
}
}
}
StopTest
The StopTest method sends a request to stop a NeoLoad test.
Parameters:
-
ForceStop (optional): Default value is "false". If set to "true", the test is forced to stop.
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.
-
QualityStatus (optional): To force the Quality Status of a test result. Possible values are "PASSED" and "FAILED".

POST http://localhost:7400/Runtime/v1/Service.svc/StopTest HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
Connection: keepalive
{
"d":
{
}
}

POST http://localhost:7400/Runtime/v1/Service.svc/StopTest HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
Connection: keepalive
{
"d":
{
"QualityStatus": "FAILED"
}
}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.StopTestParams;
public class StartTestExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
client.stopTest(StopTestParams.newBuilder().build());
}
}

using Neotys.RuntimeAPI.Client;
using Neotys.RuntimeAPI.Model;
namespace TestRuntimeAPI
{
class StopTest
{
public static void Main(string[] args)
{
string url = "http://localhost:7400/Design/v1/Service.svc/";
IRuntimeAPIClient client = RuntimeAPIClientFactory.NewClient(url);
client.StopTest(new StopTestParamsBuilder().Build());
}
}
}
GetStatus
The GetStatus method provides the current status of NeoLoad:
-
NEOLOAD_INITIALIZING: NeoLoad is starting up.
-
NO_PROJECT: No project is opened.
-
PROJECT_INITIALIZING: A project is getting opened.
-
READY: Project is opened, NeoLoad is ready to start a test.
-
BUSY: NeoLoad is busy (a recording is in progress or stopping or there is a blocking window), a test cannot be started.
-
TEST_LOADING: The test is getting started.
-
TEST_RUNNING: The test is running.
-
TEST_STOPPING: The test is getting stopped.
Parameters:
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/GetStatus HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{"d": {
}}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.Status;
public class GetStatusExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
final Status status = client.getStatus();
System.out.println(status);
}
}

using Neotys.RuntimeAPI.Client;
using Neotys.RuntimeAPI.Model;
using System;
namespace TestRuntimeAPI
{
class GetStatus
{
public static void Main(string[] args)
{
string url = "http://localhost:7400/Design/v1/Service.svc/";
IRuntimeAPIClient client = RuntimeAPIClientFactory.NewClient(url);
Status status = client.getStatus();
Console.WriteLine(status);
}
}
}
AddVirtualUsers
The AddVirtualUsers method sends a request to add Virtual Users to a given population.
Parameters:
-
PopulationName (required): The name of the population.
-
VirtualUserCount (required): The number of Virtual Users to add.
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/AddVirtualUsers HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{
"d":
{
"PopulationName" : "MyPopulationBigCities",
"VirtualUserCount" : 20
}
}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.AddVirtualUsersParams;
public class Main {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
client.addVirtualUsers(AddVirtualUsersParams.newBuilder("MyPopulationBigCities", 20).build());
}
}

using Neotys.RuntimeAPI.Client;
using Neotys.RuntimeAPI.Model;
namespace TestRuntimeAPI
{
class AddVirtualUsers
{
public static void Main(string[] args)
{
string url = "http://localhost:7400/Design/v1/Service.svc/";
IRuntimeAPIClient client = RuntimeAPIClientFactory.NewClient(url);
client.AddVirtualUsers(new AddVirtualUsersParamsBuilder("MyPopulationBigCities", 20).Build());
}
}
}
StopVirtualUsers
The StopVirtualUsers method sends a request to stop Virtual Users to a given population.
Parameters:
-
PopulationName (required): The name of the population.
-
VirtualUserCount (required): The number of Virtual Users to add.
-
StopPolicy (required): The policy applied when stopping Virtual Users. Possibles values are "APPLY_DEFINED" and "STOP_IMMEDIATELY", default value is "APPLY_DEFINED".
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/StopVirtualUsers HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{
"d":
{
"PopulationName" : "MyPopulationBigCities",
"VirtualUserCount" : 20
}
}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.StopVirtualUsersParams;
public class Main {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
client.stopVirtualUsers(StopVirtualUsersParams.newBuilder("MyPopulationBigCities", 20).build());
}
}

using Neotys.RuntimeAPI.Client;
using Neotys.RuntimeAPI.Model;
namespace TestRuntimeAPI
{
class StopVirtualUsers
{
public static void Main(string[] args)
{
string url = "http://localhost:7400/Design/v1/Service.svc/";
IRuntimeAPIClient client = RuntimeAPIClientFactory.NewClient(url);
client.StopVirtualUsers(new StopVirtualUsersParamsBuilder("MyPopulationBigCities", 20).Build());
}
}
}
StartInfrastructures
The StartInfrastructures method sends a request to start infrastructures.
Parameters:
-
Infrastructures (required): The YAML or JSON file describing the infrastructure to use. For more information, see "Infrastructure definition".
-
NCPLogin (optional): Connects to NeoLoad Cloud Platform using the specified login and password. The password hash command line utility must be used to hash the password before using this command. This command is necessary when using NeoLoad Cloud Platform to launch a load test with a Cloud Load Generator or Virtual User session. The format must be as follows: "<login>:<hashed password>" or "<token>". For example: "loginUser:VyVmg==".
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/StartInfrastructures HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{
"d":
{
"Infrastructures": "---\ninfrastructures:\n - name: My Cloud infrastructure\n type: NEOTYS_CLOUD_LOAD_GENERATOR\n workgroup: test\n architecture: MEDIUM\n duration: 1h\n zones:\n - id: us-east-1\n count: 1\n - id: us-west-4\n count: 1",
"NCPLogin": "loginUser:VyVmg=="
}
}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.StartInfrastructuresParams.StartInfrastructuresBuilder;
public class StartInfrastructuresExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
final String infrastructuresContent = "infrastructures:\n" +
" - name: My Cloud infrastructure\n" +
" type: NEOTYS_CLOUD_LOAD_GENERATOR\n" +
" workgroup: <My Neotys Workgroup Name>\n" +
" architecture: MEDIUM\n" +
" duration: 1h\n" +
" zones:\n" +
" - id: us-east-1\n" +
" count: 1\n" +
" - id: us-west-4\n" +
" count: 1";
client.startInfrastructures(new StartInfrastructuresBuilder(infrastructuresContent)
.ncpLogin("loginUser:VyVmg==")
.build());
}
}
StopInfrastructures
The StopInfrastructures method sends a request to stop infrastructures.
Parameters:
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/StopInfrastructures HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{"d": {
}}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
public class StartTestExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
client.stopInfrastructures();
}
}
GetInfrastructuresStatus
The GetInfrastructuresStatus method provides the current status of infrastructures. An Infrastructure Status is composed of an Infrastructure State (STOPPED or RUNNING) and two Infrastructure Transitions (the current one and the last one).
A Transition is composed of a name (STARTING or STOPPING) and a Step (NONE, LOADING, VALIDATING, PROVISIONING or DEPROVISIONING) or a Result (NONE, SUCCEEDED or FAILED).
Parameters:
-
ApiKey (optional): To authenticate the command. Required if enabled on the Controller.

POST http://localhost:7400/Runtime/v1/Service.svc/GetInfrastructuresStatus HTTP/1.1
Accept: application/json
Content-Type: application/json
Cache-Control: nocache
Pragma: nocache
{"d": {
}}

import com.neotys.rest.runtime.client.RuntimeAPIClient;
import com.neotys.rest.runtime.client.RuntimeAPIClientFactory;
import com.neotys.rest.runtime.model.InfrastructuresStatus;
public class StartTestExample {
public static void main(String[] args) throws Exception {
final RuntimeAPIClient client = RuntimeAPIClientFactory
.newClient("http://localhost:7400/Runtime/v1/Service.svc/");
InfrastructuresStatus status = client.getInfrastructuresStatus();
System.out.println(status);
}
}