JobApi

All URIs are relative to the master’s API URL

Method HTTP request Description
createJob POST /jobs Creates a new asyncron Job (without starting it), and returns its ID for later use.
deleteJob DELETE /jobs/{jobId} Deletes this job and cleans all related data.
getJobDefinition GET /jobs/{jobId} Returns a job definition.
getJobs GET /jobs Returns all current job definitions.

createJob

JobDefinition createJob(jobCreation)

Creates a new asyncron Job (without starting it), and returns its ID for later use.

This API creates a new asyncron Job. The returned ID must be used for further requests like register events/submit/stop/delete the job.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.api.JobApi;


JobApi apiInstance = new JobApi();
JobCreation jobCreation = new JobCreation(); // JobCreation | 
try {
    JobDefinition result = apiInstance.createJob(jobCreation);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling JobApi#createJob");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobCreation JobCreation

Return type

JobDefinition

Authorization

No authorization required

HTTP request headers

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

deleteJob

String deleteJob(jobId)

Deletes this job and cleans all related data.

This API is to be called when your application is finished with this job. This will delete all related data like process, input data, response, etc.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.api.JobApi;


JobApi apiInstance = new JobApi();
String jobId = "jobId_example"; // String | 
try {
    String result = apiInstance.deleteJob(jobId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling JobApi#deleteJob");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobId String

Return type

String

Authorization

No authorization required

HTTP request headers

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

getJobDefinition

JobDefinition getJobDefinition(jobId)

Returns a job definition.

This API allows you to retrieve a job definition.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.api.JobApi;


JobApi apiInstance = new JobApi();
String jobId = "jobId_example"; // String | 
try {
    JobDefinition result = apiInstance.getJobDefinition(jobId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling JobApi#getJobDefinition");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
jobId String

Return type

JobDefinition

Authorization

No authorization required

HTTP request headers

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

getJobs

List<JobDefinition> getJobs()

Returns all current job definitions.

This API allows you to retrieve all current jobs from the system.

Example

// Import classes:
//import com.decisionbrain.optimserver.client.java.jersey2.ApiException;
//import com.decisionbrain.optimserver.client.java.jersey2.api.JobApi;


JobApi apiInstance = new JobApi();
try {
    List<JobDefinition> result = apiInstance.getJobs();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling JobApi#getJobs");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<JobDefinition>

Authorization

No authorization required

HTTP request headers

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