Run a Model Method
To run a model, you must provide an Authorization header containing access token in the and also a Content-Type header with the value application/x-www-form-urlencoded.
The run endpoint accepts a POST request with parameters in the body of the request to control how the run is executed. The only required fields are the model name and your group name, which is assigned at account creation and defaults to your email address. If you run with only these two parameters, the model runs without connecting to any Eggplant Functional scripts and only generates a path through the model.
If you want to connect to an Eggplant Functional suite, you must use the agent to establish that connection. This allows the Eggplant AI engine to connect to your Eggplant Functional scripts and to execute them. Use the alias you provided in the agent as the agentName parameter in your REST API run request, and enter the path to your Eggplant Functional suite in the suiteLocation parameter. These two parameters are required to connect to Eggplant Functional. Other options allow you to modify things like the number of iterations, logfile name, log directory, seed number, maximum number of actions, and replay flag. The directedTest parameter can be used to run specific test cases.
Method
Headers
Name | Value |
---|---|
Authorization | bearer <access_token> |
Content-Type | application/x-www-form-urlencoded |
Body Parameters
Name | Type | Required | Default Value |
---|---|---|---|
agentName | Text | No | |
bins | Integer | No | 100 |
coverdb | Text | No | ttdb |
covertarget | Integer | No | 1 |
directedTest | Text | No | |
execute | true/false | No | True |
group | Text | Yes | |
iterations | Integer | No | 1 |
logdir | Text | No | logs |
logfile | Text | No | modelname_seed_date.log |
maxActions | Integer | No | 10000 |
modelName | Text | Yes | |
onerror | Text (clean | continue | immediate | debug) | No | clean |
path | Text | No | |
replay | Integer | No | |
seed | Integer | No | Random (1-999999) |
suiteLocation | Text | No | |
verbosity | Text | No | 0x6b00 |
Possible Responses
Name | Type | Description |
---|---|---|
200 | OK | |
400 | Bad request | The required parameters were not sent |
401 | Unauthorized | The access token was not valid. |
403 | Forbidden | Not enough available concurrent user licenses. |
403 | Forbidden | The current user doesn’t have access to the model requested. |
Response Body JSON
Typical response:
{
"processid": 605546960,
"id": "6632c840-c731-4535-9f3a-890e61f85b04",
"iterations": "1",
"agent": "DAI-Testing"
}
Name | Type | Description |
---|---|---|
processid | Integer | The ID of the running process. |
id | Text | The unique ID of the execution used for checking progress and aborting. |
iterations | Integer | The number of iterations for this run. |
agent | Text | The name of the connected agent. |