JobExecutionApi

JobExecutionApi

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.

getJobExecutionStatus

JobExecutionStatus getJobExecutionStatus(jobId)

Gets the job execution status.

This API retrieves the current Job execution status.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.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();
}

Parameters

Name Type Description Notes
jobId String

Return type

JobExecutionStatus

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/xml

startAsyncJobExecution

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".

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.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();
}

Parameters

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

Return type

JobDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

startSyncJobExecution

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.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.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();
}

Parameters

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

Return type

JobSolution

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

stopJobExecution

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.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.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();
}

Parameters

Name Type Description Notes
jobId String

Return type

JobExecutionStatus

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/xml