public class JobApi extends AbstractApi implements Constants
Constants.ActionType, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Modifier and Type | Method and Description |
---|---|
Job |
cancleJob(int projectId,
int jobId)
Cancel specified job in a project.
|
InputStream |
downloadArtifactsFile(Integer projectId,
String ref,
String jobName)
Get an InputStream pointing to the artifacts file from the given reference name and job
provided the job finished successfully.
|
File |
downloadArtifactsFile(Integer projectId,
String ref,
String jobName,
File directory)
Download the artifacts file from the given reference name and job provided the job finished successfully.
|
Job |
eraseJob(int projectId,
int jobId)
Erase specified job in a project.
|
Job |
getJob(int projectId,
int jobId)
Get single job in a project.
|
List<Job> |
getJobs(int projectId)
Get a list of jobs in a project.
|
List<Job> |
getJobs(int projectId,
Constants.JobScope scope)
Get a list of jobs in a project.
|
Pager<Job> |
getJobs(int projectId,
int itemsPerPage)
Get a Pager of jobs in a project.
|
List<Job> |
getJobs(int projectId,
int page,
int perPage)
Get a list of jobs in a project in the specified page range.
|
List<Job> |
getJobsForPipeline(int projectId,
int pipelineId)
Get a list of jobs in a pipeline.
|
List<Job> |
getJobsForPipeline(int projectId,
int pipelineId,
Constants.JobScope scope)
Get a list of jobs in a pipeline.
|
Job |
playJob(int projectId,
int jobId)
Play specified job in a project.
|
Job |
retryJob(int projectId,
int jobId)
Retry specified job in a project.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getPageQueryParams, getWithAccepts, handle, isApiVersion, post, post, post, put, put, putWithFormData, urlEncode, validate
public JobApi(GitLabApi gitLabApi)
public List<Job> getJobs(int projectId) throws GitLabApiException
projectId
- the project ID to get the list of jobs forGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobs(int projectId, int page, int perPage) throws GitLabApiException
projectId
- the project ID to get the list of jobs forpage
- the page to getperPage
- the number of Job instances per pageGitLabApiException
- if any exception occurs during executionpublic Pager<Job> getJobs(int projectId, int itemsPerPage) throws GitLabApiException
projectId
- the project ID to get the list of jobs foritemsPerPage
- the number of Job instances that will be fetched per pageGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobs(int projectId, Constants.JobScope scope) throws GitLabApiException
projectId
- the project ID to get the list of jobs forscope
- the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUALGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobsForPipeline(int projectId, int pipelineId) throws GitLabApiException
projectId
- the project ID to get the list of pipeline forpipelineId
- the pipeline ID to get the list of jobs forGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobsForPipeline(int projectId, int pipelineId, Constants.JobScope scope) throws GitLabApiException
projectId
- the project ID to get the list of pipeline forpipelineId
- the pipeline ID to get the list of jobs forscope
- the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUALGitLabApiException
- if any exception occurs during executionpublic Job getJob(int projectId, int jobId) throws GitLabApiException
projectId
- the project ID to get the specified job forjobId
- the job ID to getGitLabApiException
- if any exception occurs during executionpublic File downloadArtifactsFile(Integer projectId, String ref, String jobName, File directory) throws GitLabApiException
projectId
- the ID of the projectref
- the ref from a repositoryjobName
- the name of the job to download the artifacts fordirectory
- the File instance of the directory to save the file to, if null will use "java.io.tmpdir"GitLabApiException
- if any exception occurspublic InputStream downloadArtifactsFile(Integer projectId, String ref, String jobName) throws GitLabApiException
projectId
- the ID of the projectref
- the ref from a repositoryjobName
- the name of the job to download the artifacts forGitLabApiException
- if any exception occurspublic Job cancleJob(int projectId, int jobId) throws GitLabApiException
projectId
- the project ID to cancel specified jobjobId
- the ID to cancel jobGitLabApiException
- if any exception occurs during executionpublic Job retryJob(int projectId, int jobId) throws GitLabApiException
projectId
- the project ID to retry speficied jobjobId
- the ID to retry jobGitLabApiException
- if any exception occurs during executionpublic Job eraseJob(int projectId, int jobId) throws GitLabApiException
projectId
- the project ID to erase specified jobjobId
- the ID to erase jobGitLabApiException
- if any exception occurs during executionpublic Job playJob(int projectId, int jobId) throws GitLabApiException
projectId
- the project ID to play specified jobjobId
- the ID to play jobGitLabApiException
- if any exception occurs during executionCopyright © 2017. All rights reserved.