Create a Job
/job
Request
There are no request parameters for this operation.
Back to TopResponse
201 Response
Examples
The following example shows how to create a new job by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Use cURL".
The -d option specifies the file to attach as the request body.
curl -X POST "hostname:port/job" -H "accept: */*" -H "Content-Type: application/json" -d @file.json
where:
- file.json is the JSON file the job details to create.
Example of Request Body
The following is an example of the contents of file.json sent as the request body:
{
"tag": [
"TODO-job"
],
"scenarioCount": 1,
"name": "TODO-job",
"description": "TODO-job",
"type": "0",
"executionConfig": {
"group": [
{
"scenarios": [
"6409a9db6102f60f98d476ec"
],
"name": "",
"execution": ""
}
],
"name": "",
"execution": "serial",
"environment_id": 1
}
}
Example of Response Body
If successful, the response code 201 is returned along with a header. For example:
{
"_id": 15,
"tag": [
"TODO-job"
],
"name": "TODO-job",
"type": "0",
"description": "TODO-job",
"scenarioCount": 1,
"executionConfig": {
"name": "",
"group": [
{
"name": "",
"execution": "",
"scenarios": [
"6409a9db6102f60f98d476ec"
]
}
],
"execution": "serial",
"environment_id": 1
}
}
If the request fails, the response includes the appropriate HTTP code. For a 4xx/5xx code, the message body also contains a ProblemDetails structure with the cause attribute set to the appropriate application error.