public class JobApi extends AbstractApi implements Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.ContributorOrderBy, Constants.DefaultBranchProtectionLevel, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PackageOrderBy, Constants.PackageStatus, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectAccessTokenScope, Constants.ProjectCreationLevel, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.SubgroupCreationLevel, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
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 |
cancelJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Cancel specified job in a project.
|
Job |
cancleJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Deprecated.
replaced by
cancelJob(Object, Long) |
void |
deleteArtifacts(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Delete artifacts of a job.
|
java.io.InputStream |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Get an InputStream pointing to the job artifacts file for the specified job ID.
|
java.io.InputStream |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
ArtifactsFile artifactsFile)
Download a single artifact file from within the job's artifacts archive.
|
java.io.File |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
ArtifactsFile artifactsFile,
java.io.File directory)
Download a single artifact file from within the job's artifacts archive.
|
java.io.File |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
java.io.File directory)
Download the job artifacts file for the specified job ID.
|
java.io.InputStream |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.String ref,
java.lang.String jobName)
Get an InputStream pointing to the artifacts file from the given reference name and job
provided the job finished successfully.
|
java.io.File |
downloadArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.String ref,
java.lang.String jobName,
java.io.File directory)
Download the artifacts file from the given reference name and job provided the job finished successfully.
|
java.io.InputStream |
downloadSingleArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
java.nio.file.Path artifactPath)
Download a single artifact file from within the job's artifacts archive.
|
java.io.File |
downloadSingleArtifactsFile(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
java.nio.file.Path artifactPath,
java.io.File directory)
Download a single artifact file from within the job's artifacts archive.
|
Job |
eraseJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Erase specified job in a project.
|
Job |
getJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Get single job in a project.
|
java.util.List<Job> |
getJobs(java.lang.Object projectIdOrPath)
Get a list of jobs in a project.
|
java.util.List<Job> |
getJobs(java.lang.Object projectIdOrPath,
Constants.JobScope scope)
Get a list of jobs in a project.
|
Pager<Job> |
getJobs(java.lang.Object projectIdOrPath,
Constants.JobScope scope,
int itemsPerPage)
Get a list of jobs in a project.
|
Pager<Job> |
getJobs(java.lang.Object projectIdOrPath,
int itemsPerPage)
Get a Pager of jobs in a project.
|
java.util.List<Job> |
getJobs(java.lang.Object projectIdOrPath,
int page,
int perPage)
Get a list of jobs in a project in the specified page range.
|
java.util.List<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId)
Get a list of jobs in a pipeline.
|
java.util.List<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId,
java.lang.Boolean includeRetried)
Get a list of jobs in a pipeline.
|
java.util.List<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId,
Constants.JobScope scope)
Get a list of jobs in a pipeline.
|
java.util.List<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId,
Constants.JobScope scope,
java.lang.Boolean includeRetried)
Get a list of jobs in a pipeline.
|
Pager<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId,
int itemsPerPage)
Get a Pager of jobs in a pipeline.
|
Pager<Job> |
getJobsForPipeline(java.lang.Object projectIdOrPath,
long pipelineId,
int itemsPerPage,
java.lang.Boolean includeRetried)
Get a Pager of jobs in a pipeline.
|
java.util.stream.Stream<Job> |
getJobsStream(java.lang.Object projectIdOrPath)
Get a Stream of jobs in a project.
|
java.util.stream.Stream<Job> |
getJobsStream(java.lang.Object projectIdOrPath,
Constants.JobScope scope)
Get a Stream of jobs in a project.
|
java.util.stream.Stream<Job> |
getJobsStream(java.lang.Object projectIdOrPath,
long pipelineId)
Get a Stream of jobs in a pipeline.
|
java.util.stream.Stream<Job> |
getJobsStream(java.lang.Object projectIdOrPath,
long pipelineId,
java.lang.Boolean includeRetried)
Get a Stream of jobs in a pipeline.
|
java.util.Optional<Job> |
getOptionalJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Get single job in a project as an Optional instance.
|
java.lang.String |
getTrace(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Get a trace of a specific job of a project
|
Job |
keepArtifacts(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Prevents artifacts from being deleted when expiration is set.
|
Job |
playJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Play specified job in a project.
|
Job |
playJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId,
JobAttributes jobAttributes)
Play specified job with parameters in a project.
|
Job |
retryJob(java.lang.Object projectIdOrPath,
java.lang.Long jobId)
Retry specified job in a project.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, upload, urlEncode, validate
public JobApi(GitLabApi gitLabApi)
public java.util.List<Job> getJobs(java.lang.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 java.util.List<Job> getJobs(java.lang.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(java.lang.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 java.util.stream.Stream<Job> getJobsStream(java.lang.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 java.util.List<Job> getJobs(java.lang.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(java.lang.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 java.util.stream.Stream<Job> getJobsStream(java.lang.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 java.util.List<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long 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 java.util.List<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long pipelineId, java.lang.Boolean includeRetried) 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 forincludeRetried
- Include retried jobs in the responseGitLabApiException
- if any exception occurs during executionpublic java.util.List<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long 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 java.util.List<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long pipelineId, Constants.JobScope scope, java.lang.Boolean includeRetried) 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, MANUALincludeRetried
- Include retried jobs in the responseGitLabApiException
- if any exception occurs during executionpublic Pager<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long pipelineId, int itemsPerPage) 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 foritemsPerPage
- the number of Job instances that will be fetched per pageGitLabApiException
- if any exception occurs during executionpublic Pager<Job> getJobsForPipeline(java.lang.Object projectIdOrPath, long pipelineId, int itemsPerPage, java.lang.Boolean includeRetried) 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 foritemsPerPage
- the number of Job instances that will be fetched per pageincludeRetried
- Include retried jobs in the responseGitLabApiException
- if any exception occurs during executionpublic java.util.stream.Stream<Job> getJobsStream(java.lang.Object projectIdOrPath, long 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 pathpipelineId
- the pipeline ID to get the list of jobs forGitLabApiException
- if any exception occurs during executionpublic java.util.stream.Stream<Job> getJobsStream(java.lang.Object projectIdOrPath, long pipelineId, java.lang.Boolean includeRetried) 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 pathpipelineId
- the pipeline ID to get the list of jobs forincludeRetried
- Include retried jobs in the responseGitLabApiException
- if any exception occurs during executionpublic Job getJob(java.lang.Object projectIdOrPath, java.lang.Long 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 java.util.Optional<Job> getOptionalJob(java.lang.Object projectIdOrPath, java.lang.Long 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 java.io.File downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.String ref, java.lang.String jobName, java.io.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 java.io.InputStream downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.String ref, java.lang.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 java.io.File downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long jobId, java.io.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 java.io.InputStream downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long 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 java.io.File downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long jobId, ArtifactsFile artifactsFile, java.io.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 java.io.InputStream downloadArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long 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 java.io.File downloadSingleArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long jobId, java.nio.file.Path artifactPath, java.io.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 java.io.InputStream downloadSingleArtifactsFile(java.lang.Object projectIdOrPath, java.lang.Long jobId, java.nio.file.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 java.lang.String getTrace(java.lang.Object projectIdOrPath, java.lang.Long 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 execution@Deprecated public Job cancleJob(java.lang.Object projectIdOrPath, java.lang.Long jobId) throws GitLabApiException
cancelJob(Object, Long)
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 cancelJob(java.lang.Object projectIdOrPath, java.lang.Long 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(java.lang.Object projectIdOrPath, java.lang.Long 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(java.lang.Object projectIdOrPath, java.lang.Long 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(java.lang.Object projectIdOrPath, java.lang.Long 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 executionpublic Job playJob(java.lang.Object projectIdOrPath, java.lang.Long jobId, JobAttributes jobAttributes) 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 jobjobAttributes
- attributes for the played jobGitLabApiException
- if any exception occurs during executionpublic Job keepArtifacts(java.lang.Object projectIdOrPath, java.lang.Long jobId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/jobs/:job_id/keep
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to keep artifacts forGitLabApiException
- if any exception occurs during executionpublic void deleteArtifacts(java.lang.Object projectIdOrPath, java.lang.Long jobId) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/jobs/:job_id/artifacts
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathjobId
- the ID to delete artifacts forGitLabApiException
- if any exception occurs during execution