Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.github.jobservice.client.api;
import com.github.jobservice.job.client.ApiException;
import com.github.jobservice.job.client.ApiClient;
import com.github.jobservice.job.client.ApiResponse;
import com.github.jobservice.job.client.Configuration;
import com.github.jobservice.job.client.Pair;
import jakarta.ws.rs.core.GenericType;
import com.github.jobservice.client.model.CancelJobs200Response;
import com.github.jobservice.client.model.DeleteJobs200Response;
import com.github.jobservice.client.model.Job;
import com.github.jobservice.client.model.JobStatus;
import com.github.jobservice.client.model.NewJob;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-20T20:37:34.533041584Z[Etc/UTC]")
public class JobsApi {
private ApiClient apiClient;
public JobsApi() {
this(Configuration.getDefaultApiClient());
}
public JobsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Cancels the job.
* Cancels the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The cancellation has been accepted.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public void cancelJob(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
cancelJobWithHttpInfo(partitionId, jobId, caFCorrelationId);
}
/**
* Cancels the job.
* Cancels the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The cancellation has been accepted.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse cancelJobWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling cancelJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling cancelJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}/cancel"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType();
return apiClient.invokeAPI("JobsApi.cancelJob", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
/**
* Cancels multiple jobs that meet the criteria of provided parameters.
* Cancels multiple jobs that meet the criteria of provided parameters.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be cancelled (optional)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return CancelJobs200Response
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the number of jobs that were successfully cancelled.
-
400
The request could not be processed because one or more arguments are invalid.
-
503
The request failed due to a database connection error.
-
*/
public CancelJobs200Response cancelJobs(String partitionId, String caFCorrelationId, String jobIdStartsWith, String labelExist, String filter) throws ApiException {
return cancelJobsWithHttpInfo(partitionId, caFCorrelationId, jobIdStartsWith, labelExist, filter).getData();
}
/**
* Cancels multiple jobs that meet the criteria of provided parameters.
* Cancels multiple jobs that meet the criteria of provided parameters.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be cancelled (optional)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return ApiResponse<CancelJobs200Response>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the number of jobs that were successfully cancelled.
-
400
The request could not be processed because one or more arguments are invalid.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse cancelJobsWithHttpInfo(String partitionId, String caFCorrelationId, String jobIdStartsWith, String labelExist, String filter) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling cancelJobs");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs:cancel"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId));
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "jobIdStartsWith", jobIdStartsWith)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "labelExist", labelExist));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.cancelJobs", localVarPath, "POST", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Adds a new job.
* Creates the specified job using the job definition included in the http body.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param newJob The definition of the job to create (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Indicates that the job was successfully created.
-
204
Indicates that the job was successfully updated.
-
400
The `jobId` parameter contains invalid characters.
-
503
The request failed due to a database connection error.
-
*/
public void createOrUpdateJob(String partitionId, String jobId, NewJob newJob, String caFCorrelationId) throws ApiException {
createOrUpdateJobWithHttpInfo(partitionId, jobId, newJob, caFCorrelationId);
}
/**
* Adds a new job.
* Creates the specified job using the job definition included in the http body.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param newJob The definition of the job to create (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Indicates that the job was successfully created.
-
204
Indicates that the job was successfully updated.
-
400
The `jobId` parameter contains invalid characters.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse createOrUpdateJobWithHttpInfo(String partitionId, String jobId, NewJob newJob, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling createOrUpdateJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling createOrUpdateJob");
}
if (newJob == null) {
throw new ApiException(400, "Missing the required parameter 'newJob' when calling createOrUpdateJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType("application/json");
return apiClient.invokeAPI("JobsApi.createOrUpdateJob", localVarPath, "PUT", new ArrayList<>(), newJob,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
/**
* Deletes the specified job.
* Deletes the specified job from the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
Indicates that the job was successfully deleted.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public void deleteJob(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
deleteJobWithHttpInfo(partitionId, jobId, caFCorrelationId);
}
/**
* Deletes the specified job.
* Deletes the specified job from the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
Indicates that the job was successfully deleted.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse deleteJobWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling deleteJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling deleteJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType();
return apiClient.invokeAPI("JobsApi.deleteJob", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
/**
* Deletes multiple jobs that meet the criteria of provided parameters.
* Deletes multiple jobs that meet the criteria of provided parameters.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be deleted (optional)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return DeleteJobs200Response
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the number of jobs that were successfully deleted.
-
400
The request could not be processed because one or more arguments are invalid.
-
503
The request failed due to a database connection error.
-
*/
public DeleteJobs200Response deleteJobs(String partitionId, String caFCorrelationId, String jobIdStartsWith, String labelExist, String filter) throws ApiException {
return deleteJobsWithHttpInfo(partitionId, caFCorrelationId, jobIdStartsWith, labelExist, filter).getData();
}
/**
* Deletes multiple jobs that meet the criteria of provided parameters.
* Deletes multiple jobs that meet the criteria of provided parameters.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be deleted (optional)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return ApiResponse<DeleteJobs200Response>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the number of jobs that were successfully deleted.
-
400
The request could not be processed because one or more arguments are invalid.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse deleteJobsWithHttpInfo(String partitionId, String caFCorrelationId, String jobIdStartsWith, String labelExist, String filter) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling deleteJobs");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs:delete"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId));
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "jobIdStartsWith", jobIdStartsWith)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "labelExist", labelExist));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.deleteJobs", localVarPath, "POST", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Gets the specified job.
* Retrieves information about the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return Job
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the job data.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public Job getJob(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
return getJobWithHttpInfo(partitionId, jobId, caFCorrelationId).getData();
}
/**
* Gets the specified job.
* Retrieves information about the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return ApiResponse<Job>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the job data.
-
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse getJobWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling getJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling getJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.getJob", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Checks whether the job is active.
* Checks whether the specified job is active.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return Boolean
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns whether the job is active.
* CacheableJobStatus - A response that includes this header with the value ‘true’ is eligible for caching in a cache specific to job status responses.
400
The `jobId` parameter contains invalid characters.
-
503
The request failed due to a database connection error.
-
*/
public Boolean getJobActive(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
return getJobActiveWithHttpInfo(partitionId, jobId, caFCorrelationId).getData();
}
/**
* Checks whether the job is active.
* Checks whether the specified job is active.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return ApiResponse<Boolean>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns whether the job is active.
* CacheableJobStatus - A response that includes this header with the value ‘true’ is eligible for caching in a cache specific to job status responses.
400
The `jobId` parameter contains invalid characters.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse getJobActiveWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling getJobActive");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling getJobActive");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}/isActive"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.getJobActive", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Gets the status of the job
* Gets the status of the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return JobStatus
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the status of the job.
* CacheableJobStatus - A response that includes this header with the value ‘true’ is eligible for caching in a cache specific to job status responses.
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public JobStatus getJobStatus(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
return getJobStatusWithHttpInfo(partitionId, jobId, caFCorrelationId).getData();
}
/**
* Gets the status of the job
* Gets the status of the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @return ApiResponse<JobStatus>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the status of the job.
* CacheableJobStatus - A response that includes this header with the value ‘true’ is eligible for caching in a cache specific to job status responses.
400
The `jobId` parameter contains invalid characters.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse getJobStatusWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling getJobStatus");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling getJobStatus");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}/status"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.getJobStatus", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Gets the list of jobs
* Returns the list of job definitions defined in the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be returned (optional)
* @param statusType All - no status filter is applied (Default); NotCompleted - only those results with statuses other than Completed will be returned; Completed - only those results with Completed status will be returned; Inactive - only those results with inactive statuses (i.e. Completed, Failed, Cancelled) will be returned; NotFinished - only those results with unfinished statuses (ie. Active, Paused, Waiting) will be returned. (optional)
* @param status Active - only those with active status will be returned; Cancelled - only those with cancelled status will be returned; Completed - only those results with completed status will be returned; Failed - only those results with failed status will be returned; Paused - only those results with paused status will be returned, Waiting - only those results with waiting status will be returned. (optional)
* @param limit The maximum results to return (i.e. page size) (optional)
* @param offset The starting position from which to return results (useful for paging) (optional)
* @param sort Used to specify the sort order, in the format `<field>:<direction>`. Results can also be ordered by label by using `labels.<label-key>` as the field name. The direction can be `asc` or `desc`. (optional, default to createTime:desc)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return List<Job>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the list of jobs.
-
503
The request failed due to a database connection error.
-
*/
public List getJobs(String partitionId, String caFCorrelationId, String jobIdStartsWith, String statusType, String status, Integer limit, Integer offset, String sort, String labelExist, String filter) throws ApiException {
return getJobsWithHttpInfo(partitionId, caFCorrelationId, jobIdStartsWith, statusType, status, limit, offset, sort, labelExist, filter).getData();
}
/**
* Gets the list of jobs
* Returns the list of job definitions defined in the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be returned (optional)
* @param statusType All - no status filter is applied (Default); NotCompleted - only those results with statuses other than Completed will be returned; Completed - only those results with Completed status will be returned; Inactive - only those results with inactive statuses (i.e. Completed, Failed, Cancelled) will be returned; NotFinished - only those results with unfinished statuses (ie. Active, Paused, Waiting) will be returned. (optional)
* @param status Active - only those with active status will be returned; Cancelled - only those with cancelled status will be returned; Completed - only those results with completed status will be returned; Failed - only those results with failed status will be returned; Paused - only those results with paused status will be returned, Waiting - only those results with waiting status will be returned. (optional)
* @param limit The maximum results to return (i.e. page size) (optional)
* @param offset The starting position from which to return results (useful for paging) (optional)
* @param sort Used to specify the sort order, in the format `<field>:<direction>`. Results can also be ordered by label by using `labels.<label-key>` as the field name. The direction can be `asc` or `desc`. (optional, default to createTime:desc)
* @param labelExist Filter to jobs with the specified labels, in the format label=<labelName>,<labelName> (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return ApiResponse<List<Job>>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the list of jobs.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse> getJobsWithHttpInfo(String partitionId, String caFCorrelationId, String jobIdStartsWith, String statusType, String status, Integer limit, Integer offset, String sort, String labelExist, String filter) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling getJobs");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId));
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "jobIdStartsWith", jobIdStartsWith)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "statusType", statusType));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "labelExist", labelExist));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType> localVarReturnType = new GenericType>() {};
return apiClient.invokeAPI("JobsApi.getJobs", localVarPath, "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Gets the count of jobs
* Returns the count of job definitions defined in the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be returned (optional)
* @param statusType All - no status filter is applied (Default); NotCompleted - only those results with statuses other than Completed will be returned; Completed - only those results with Completed status will be returned; Inactive - only those results with inactive statuses (i.e. Completed, Failed, Cancelled) will be returned; NotFinished - only those results with unfinished statuses (ie. Active, Paused, Waiting) will be returned. (optional)
* @param status Active - only those with active status will be returned; Cancelled - only those with cancelled status will be returned; Completed - only those results with completed status will be returned; Failed - only those results with failed status will be returned; Paused - only those results with paused status will be returned, Waiting - only those results with waiting status will be returned. (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return Long
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the count of jobs.
-
503
The request failed due to a database connection error.
-
*/
public Long getJobsCount(String partitionId, String caFCorrelationId, String jobIdStartsWith, String statusType, String status, String filter) throws ApiException {
return getJobsCountWithHttpInfo(partitionId, caFCorrelationId, jobIdStartsWith, statusType, status, filter).getData();
}
/**
* Gets the count of jobs
* Returns the count of job definitions defined in the system.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param caFCorrelationId An identifier that correlates events across different services. (optional)
* @param jobIdStartsWith Only those results whose job id starts with this value will be returned (optional)
* @param statusType All - no status filter is applied (Default); NotCompleted - only those results with statuses other than Completed will be returned; Completed - only those results with Completed status will be returned; Inactive - only those results with inactive statuses (i.e. Completed, Failed, Cancelled) will be returned; NotFinished - only those results with unfinished statuses (ie. Active, Paused, Waiting) will be returned. (optional)
* @param status Active - only those with active status will be returned; Cancelled - only those with cancelled status will be returned; Completed - only those results with completed status will be returned; Failed - only those results with failed status will be returned; Paused - only those results with paused status will be returned, Waiting - only those results with waiting status will be returned. (optional)
* @param filter Filter jobs with the specified criteria, in the format `labels.<label-key> == <label-value>` or `id == 1` (optional)
* @return ApiResponse<Long>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Returns the count of jobs.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse getJobsCountWithHttpInfo(String partitionId, String caFCorrelationId, String jobIdStartsWith, String statusType, String status, String filter) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling getJobsCount");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobStats/count"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId));
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "jobIdStartsWith", jobIdStartsWith)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "statusType", statusType));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("JobsApi.getJobsCount", localVarPath, "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, localVarReturnType, false);
}
/**
* Pauses the job.
* Pauses the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The pause request has been accepted.
-
400
The request could not be processed because one or more arguments are invalid.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public void pauseJob(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
pauseJobWithHttpInfo(partitionId, jobId, caFCorrelationId);
}
/**
* Pauses the job.
* Pauses the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The pause request has been accepted.
-
400
The request could not be processed because one or more arguments are invalid.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse pauseJobWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling pauseJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling pauseJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}/pause"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType();
return apiClient.invokeAPI("JobsApi.pauseJob", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
/**
* Ping Service
* Ping Service
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful Ping
-
500
The request failed due to an internal server error.
-
*/
public void ping() throws ApiException {
pingWithHttpInfo();
}
/**
* Ping Service
* Ping Service
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful Ping
-
500
The request failed due to an internal server error.
-
*/
public ApiResponse pingWithHttpInfo() throws ApiException {
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType();
return apiClient.invokeAPI("JobsApi.ping", "/ping", "GET", new ArrayList<>(), null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
/**
* Resumes the job.
* Resumes the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The resume request has been accepted.
-
400
The request could not be processed because one or more arguments are invalid.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public void resumeJob(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
resumeJobWithHttpInfo(partitionId, jobId, caFCorrelationId);
}
/**
* Resumes the job.
* Resumes the specified job.
* @param partitionId Only allow access to jobs in the container with this identifier (required)
* @param jobId The identifier of the job (required)
* @param caFCorrelationId An identifier that correlates events across different CAF services (optional)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
The resume request has been accepted.
-
400
The request could not be processed because one or more arguments are invalid.
-
404
The specified job is not found.
-
503
The request failed due to a database connection error.
-
*/
public ApiResponse resumeJobWithHttpInfo(String partitionId, String jobId, String caFCorrelationId) throws ApiException {
// Check required parameters
if (partitionId == null) {
throw new ApiException(400, "Missing the required parameter 'partitionId' when calling resumeJob");
}
if (jobId == null) {
throw new ApiException(400, "Missing the required parameter 'jobId' when calling resumeJob");
}
// Path parameters
String localVarPath = "/partitions/{partitionId}/jobs/{jobId}/resume"
.replaceAll("\\{partitionId}", apiClient.escapeString(partitionId))
.replaceAll("\\{jobId}", apiClient.escapeString(jobId));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (caFCorrelationId != null) {
localVarHeaderParams.put("CAF-Correlation-Id", apiClient.parameterToString(caFCorrelationId));
}
String localVarAccept = apiClient.selectHeaderAccept();
String localVarContentType = apiClient.selectHeaderContentType();
return apiClient.invokeAPI("JobsApi.resumeJob", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
null, null, false);
}
}