All URIs are relative to https://dbos
Method | HTTP request | Description |
---|---|---|
getJobExecutionStatus | GET /jobs/{jobId}/execution | Gets the job execution status. |
startAsyncJobExecution | POST /jobs/{jobId}/execution | Schedule an already created job for an asyncronous execution. |
startSyncJobExecution | POST /jobs/execution | Schedule a syncron job execution. |
stopJobExecution | DELETE /jobs/{jobId}/execution | Request this job to stop its execution. |
JobExecutionStatus getJobExecutionStatus(jobId)
Gets the job execution status.
This API retrieves the current Job execution status.
// Import classes:
//import com.decisionbrain.optimserver.client.java.resttemplate.ApiException;
//import com.decisionbrain.optimserver.client.java.resttemplate.api.JobExecutionApi;
JobExecutionApi apiInstance = new JobExecutionApi();
String jobId = "jobId_example"; // String |
try {
JobExecutionStatus result = apiInstance.getJobExecutionStatus(jobId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobExecutionApi#getJobExecutionStatus");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
jobId | String |
No authorization required
JobDefinition startAsyncJobExecution(jobId, timeout)
Schedule an already created job for an asyncronous execution.
This API will ask the optim Server to schedule an asyncron job for being executed on a worker. The execution status of the job is expected to become "SCHEDULED".
// Import classes:
//import com.decisionbrain.optimserver.client.java.resttemplate.ApiException;
//import com.decisionbrain.optimserver.client.java.resttemplate.api.JobExecutionApi;
JobExecutionApi apiInstance = new JobExecutionApi();
String jobId = "jobId_example"; // String |
Long timeout = 56L; // Long | Execution timeout after which the job will be abandoned, if it has not been started yet (in ms).
try {
JobDefinition result = apiInstance.startAsyncJobExecution(jobId, timeout);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobExecutionApi#startAsyncJobExecution");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
jobId | String | ||
timeout | Long | Execution timeout after which the job will be abandoned, if it has not been started yet (in ms). | optional |
No authorization required
JobSolution startSyncJobExecution(timeout, jobCreation)
Schedule a syncron job execution.
This API will ask the Optimization Server to schedule a syncronous job for being executed on a worker. The solution will be returned in the response. Set the timeout query parameter to provide a time limit on job execution. Please note that the synchronous job feature should not be used in High Availability mode with multiple masters.
// Import classes:
//import com.decisionbrain.optimserver.client.java.resttemplate.ApiException;
//import com.decisionbrain.optimserver.client.java.resttemplate.api.JobExecutionApi;
JobExecutionApi apiInstance = new JobExecutionApi();
Long timeout = 56L; // Long | Execution timeout after which the job will be abandoned, even if it was started (in ms).
JobCreation jobCreation = new JobCreation(); // JobCreation |
try {
JobSolution result = apiInstance.startSyncJobExecution(timeout, jobCreation);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobExecutionApi#startSyncJobExecution");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
timeout | Long | Execution timeout after which the job will be abandoned, even if it was started (in ms). | optional |
jobCreation | JobCreation | optional |
No authorization required
JobExecutionStatus stopJobExecution(jobId)
Request this job to stop its execution.
This API allows you to stop the execution of a running job. Notice that stopping a job is an asynchronous operation so the job might not stop immediately after the server responds to this request.
// Import classes:
//import com.decisionbrain.optimserver.client.java.resttemplate.ApiException;
//import com.decisionbrain.optimserver.client.java.resttemplate.api.JobExecutionApi;
JobExecutionApi apiInstance = new JobExecutionApi();
String jobId = "jobId_example"; // String |
try {
JobExecutionStatus result = apiInstance.stopJobExecution(jobId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobExecutionApi#stopJobExecution");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
jobId | String |
No authorization required