public class JobApi extends AbstractApi implements Constants
Constants.ActionType, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, 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(Object projectIdOrPath,
int jobId)
Cancel specified job in a project.
|
InputStream |
downloadArtifactsFile(Object projectIdOrPath,
Integer jobId)
Get an InputStream pointing to the job artifacts file for the specified job ID.
|
InputStream |
downloadArtifactsFile(Object projectIdOrPath,
Integer jobId,
ArtifactsFile artifactsFile)
Download a single artifact file from within the job's artifacts archive.
|
File |
downloadArtifactsFile(Object projectIdOrPath,
Integer jobId,
ArtifactsFile artifactsFile,
File directory)
Download a single artifact file from within the job's artifacts archive.
|
File |
downloadArtifactsFile(Object projectIdOrPath,
Integer jobId,
File directory)
Download the job artifacts file for the specified job ID.
|
InputStream |
downloadArtifactsFile(Object projectIdOrPath,
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(Object projectIdOrPath,
String ref,
String jobName,
File directory)
Download the artifacts file from the given reference name and job provided the job finished successfully.
|
InputStream |
downloadSingleArtifactsFile(Object projectIdOrPath,
Integer jobId,
Path artifactPath)
Download a single artifact file from within the job's artifacts archive.
|
File |
downloadSingleArtifactsFile(Object projectIdOrPath,
Integer jobId,
Path artifactPath,
File directory)
Download a single artifact file from within the job's artifacts archive.
|
Job |
eraseJob(Object projectIdOrPath,
int jobId)
Erase specified job in a project.
|
Job |
getJob(Object projectIdOrPath,
int jobId)
Get single job in a project.
|
List<Job> |
getJobs(Object projectIdOrPath)
Get a list of jobs in a project.
|
List<Job> |
getJobs(Object projectIdOrPath,
Constants.JobScope scope)
Get a list of jobs in a project.
|
Pager<Job> |
getJobs(Object projectIdOrPath,
Constants.JobScope scope,
int itemsPerPage)
Get a list of jobs in a project.
|
Pager<Job> |
getJobs(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of jobs in a project.
|
List<Job> |
getJobs(Object projectIdOrPath,
int page,
int perPage)
Get a list of jobs in a project in the specified page range.
|
List<Job> |
getJobsForPipeline(Object projectIdOrPath,
int pipelineId)
Get a list of jobs in a pipeline.
|
List<Job> |
getJobsForPipeline(Object projectIdOrPath,
int pipelineId,
Constants.JobScope scope)
Get a list of jobs in a pipeline.
|
Stream<Job> |
getJobsStream(Object projectIdOrPath)
Get a Stream of jobs in a project.
|
Stream<Job> |
getJobsStream(Object projectIdOrPath,
Constants.JobScope scope)
Get a Stream of jobs in a project.
|
Optional<Job> |
getOptionalJob(Object projectIdOrPath,
int jobId)
Get single job in a project as an Optional instance.
|
String |
getTrace(Object projectIdOrPath,
int jobId)
Get a trace of a specific job of a project
|
Job |
playJob(Object projectIdOrPath,
int jobId)
Play specified job in a project.
|
Job |
retryJob(Object projectIdOrPath,
int jobId)
Retry specified job in a project.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public JobApi(GitLabApi gitLabApi)
public List<Job> getJobs(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobs(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the jobs forpage
- the page to getperPage
- the number of Job instances per pageGitLabApiException
- if any exception occurs during executionpublic Pager<Job> getJobs(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the jobs foritemsPerPage
- the number of Job instances that will be fetched per pageGitLabApiException
- if any exception occurs during executionpublic Stream<Job> getJobsStream(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobs(Object projectIdOrPath, Constants.JobScope scope) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the jobs forscope
- the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUALGitLabApiException
- if any exception occurs during executionpublic Pager<Job> getJobs(Object projectIdOrPath, Constants.JobScope scope, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the jobs forscope
- the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUALitemsPerPage
- the number of Job instances that will be fetched per pageGitLabApiException
- if any exception occurs during executionpublic Stream<Job> getJobsStream(Object projectIdOrPath, Constants.JobScope scope) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the 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(Object projectIdOrPath, int pipelineId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the pipelines forpipelineId
- the pipeline ID to get the list of jobs forGitLabApiException
- if any exception occurs during executionpublic List<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, Constants.JobScope scope) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the pipelines 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(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the job forjobId
- the job ID to getGitLabApiException
- if any exception occurs during executionpublic Optional<Job> getOptionalJob(Object projectIdOrPath, int jobId)
GitLab Endpoint: GET /projects/:id/jobs/:job_id
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path to get the job forjobId
- the job ID to getpublic File downloadArtifactsFile(Object projectIdOrPath, String ref, String jobName, File directory) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/artifacts/:ref_name/download?job=name
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathref
- 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(Object projectIdOrPath, String ref, String jobName) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/artifacts/:ref_name/download?job=name
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathref
- the ref from a repositoryjobName
- the name of the job to download the artifacts forGitLabApiException
- if any exception occurspublic File downloadArtifactsFile(Object projectIdOrPath, Integer jobId, File directory) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the job ID to get 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(Object projectIdOrPath, Integer jobId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the job ID to get the artifacts forGitLabApiException
- if any exception occurspublic File downloadArtifactsFile(Object projectIdOrPath, Integer jobId, ArtifactsFile artifactsFile, File directory) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the unique job identifierartifactsFile
- an ArtifactsFile instance for the artifact to downloaddirectory
- 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(Object projectIdOrPath, Integer jobId, ArtifactsFile artifactsFile) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the unique job identifierartifactsFile
- an ArtifactsFile instance for the artifact to downloadGitLabApiException
- if any exception occurspublic File downloadSingleArtifactsFile(Object projectIdOrPath, Integer jobId, Path artifactPath, File directory) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the unique job identifierartifactPath
- the Path to a file inside the artifacts archivedirectory
- the File instance of the directory to save the file to, if null will use "java.io.tmpdir"GitLabApiException
- if any exception occurspublic InputStream downloadSingleArtifactsFile(Object projectIdOrPath, Integer jobId, Path artifactPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the unique job identifierartifactPath
- the Path to a file inside the artifacts archiveGitLabApiException
- if any exception occurspublic String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/jobs/:id/trace
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path
to get the specified job's trace forjobId
- the job ID to get the trace forGitLabApiException
- if any exception occurs during executionpublic Job cancleJob(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/jobs/:job_id/cancel
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to cancel jobGitLabApiException
- if any exception occurs during executionpublic Job retryJob(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/jobs/:job_id/retry
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to retry jobGitLabApiException
- if any exception occurs during executionpublic Job eraseJob(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/jobs/:job_id/erase
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to erase jobGitLabApiException
- if any exception occurs during executionpublic Job playJob(Object projectIdOrPath, int jobId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/jobs/:job_id/play
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to play jobGitLabApiException
- if any exception occurs during executionCopyright © 2019. All rights reserved.