Class JobApi

  • All Implemented Interfaces:
    org.gitlab4j.models.Constants

    public class JobApi
    extends AbstractApi
    implements org.gitlab4j.models.Constants
    This class provides an entry point to all the GitLab API job calls.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants

        org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
    • Field Summary

      • Fields inherited from interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • Constructor Summary

      Constructors 
      Constructor Description
      JobApi​(GitLabApi gitLabApi)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.gitlab4j.api.models.Job cancelJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Cancel specified job in a project.
      org.gitlab4j.api.models.Job cancleJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Deprecated.
      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.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.Long jobId, org.gitlab4j.api.models.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, org.gitlab4j.api.models.ArtifactsFile artifactsFile, java.io.File directory)
      Download a single artifact file from within the job's artifacts archive.
      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.lang.String 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.lang.String artifactPath, java.io.File directory)
      Download a single artifact file from within the job's artifacts archive.
      org.gitlab4j.api.models.Job eraseJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Erase specified job in a project.
      org.gitlab4j.api.models.Job getJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Get single job in a project.
      java.util.List<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath)
      Get a list of jobs in a project.
      Pager<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath, int itemsPerPage)
      Get a Pager of jobs in a project.
      java.util.List<org.gitlab4j.api.models.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<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath, org.gitlab4j.models.Constants.JobScope scope)
      Get a list of jobs in a project.
      Pager<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath, org.gitlab4j.models.Constants.JobScope scope, int itemsPerPage)
      Get a list of jobs in a project.
      java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId)
      Get a list of jobs in a pipeline.
      Pager<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId, int itemsPerPage)
      Get a Pager of jobs in a pipeline.
      Pager<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId, int itemsPerPage, java.lang.Boolean includeRetried)
      Get a Pager of jobs in a pipeline.
      java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId, java.lang.Boolean includeRetried)
      Get a list of jobs in a pipeline.
      java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId, org.gitlab4j.models.Constants.JobScope scope)
      Get a list of jobs in a pipeline.
      java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath, long pipelineId, org.gitlab4j.models.Constants.JobScope scope, java.lang.Boolean includeRetried)
      Get a list of jobs in a pipeline.
      java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath)
      Get a Stream of jobs in a project.
      java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath, long pipelineId)
      Get a Stream of jobs in a pipeline.
      java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath, long pipelineId, java.lang.Boolean includeRetried)
      Get a Stream of jobs in a pipeline.
      java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath, org.gitlab4j.models.Constants.JobScope scope)
      Get a Stream of jobs in a project.
      java.util.Optional<org.gitlab4j.api.models.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
      org.gitlab4j.api.models.Job keepArtifacts​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Prevents artifacts from being deleted when expiration is set.
      org.gitlab4j.api.models.Job playJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Play specified job in a project.
      org.gitlab4j.api.models.Job playJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId, org.gitlab4j.api.models.JobAttributes jobAttributes)
      Play specified job with parameters in a project.
      org.gitlab4j.api.models.Job retryJob​(java.lang.Object projectIdOrPath, java.lang.Long jobId)
      Retry specified job in a project.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JobApi

        public JobApi​(GitLabApi gitLabApi)
    • Method Detail

      • getJobs

        public java.util.List<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath)
                                                            throws GitLabApiException
        Get a list of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a list containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobs

        public java.util.List<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath,
                                                                   int page,
                                                                   int perPage)
                                                            throws GitLabApiException
        Get a list of jobs in a project in the specified page range.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the jobs for
        page - the page to get
        perPage - the number of Job instances per page
        Returns:
        a list containing the jobs for the specified project ID in the specified page range
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobs

        public Pager<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath,
                                                          int itemsPerPage)
                                                   throws GitLabApiException
        Get a Pager of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the jobs for
        itemsPerPage - the number of Job instances that will be fetched per page
        Returns:
        a Pager containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath)
                                                                           throws GitLabApiException
        Get a Stream of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Stream containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobs

        public java.util.List<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath,
                                                                   org.gitlab4j.models.Constants.JobScope scope)
                                                            throws GitLabApiException
        Get a list of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the jobs for
        scope - the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL
        Returns:
        a list containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobs

        public Pager<org.gitlab4j.api.models.Job> getJobs​(java.lang.Object projectIdOrPath,
                                                          org.gitlab4j.models.Constants.JobScope scope,
                                                          int itemsPerPage)
                                                   throws GitLabApiException
        Get a list of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the jobs for
        scope - the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL
        itemsPerPage - the number of Job instances that will be fetched per page
        Returns:
        a list containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath,
                                                                                  org.gitlab4j.models.Constants.JobScope scope)
                                                                           throws GitLabApiException
        Get a Stream of jobs in a project.
        GitLab Endpoint: GET /projects/:id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the jobs for
        scope - the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL
        Returns:
        a Stream containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                              long pipelineId)
                                                                       throws GitLabApiException
        Get a list of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                              long pipelineId,
                                                                              java.lang.Boolean includeRetried)
                                                                       throws GitLabApiException
        Get a list of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        includeRetried - Include retried jobs in the response
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                              long pipelineId,
                                                                              org.gitlab4j.models.Constants.JobScope scope)
                                                                       throws GitLabApiException
        Get a list of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        scope - the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public java.util.List<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                              long pipelineId,
                                                                              org.gitlab4j.models.Constants.JobScope scope,
                                                                              java.lang.Boolean includeRetried)
                                                                       throws GitLabApiException
        Get a list of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        scope - the scope of jobs, one of: CREATED, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL
        includeRetried - Include retried jobs in the response
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public Pager<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                     long pipelineId,
                                                                     int itemsPerPage)
                                                              throws GitLabApiException
        Get a Pager of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        itemsPerPage - the number of Job instances that will be fetched per page
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsForPipeline

        public Pager<org.gitlab4j.api.models.Job> getJobsForPipeline​(java.lang.Object projectIdOrPath,
                                                                     long pipelineId,
                                                                     int itemsPerPage,
                                                                     java.lang.Boolean includeRetried)
                                                              throws GitLabApiException
        Get a Pager of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
        pipelineId - the pipeline ID to get the list of jobs for
        itemsPerPage - the number of Job instances that will be fetched per page
        includeRetried - Include retried jobs in the response
        Returns:
        a list containing the jobs for the specified project ID and pipeline ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath,
                                                                                  long pipelineId)
                                                                           throws GitLabApiException
        Get a Stream of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        pipelineId - the pipeline ID to get the list of jobs for
        Returns:
        a Stream containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJobsStream

        public java.util.stream.Stream<org.gitlab4j.api.models.Job> getJobsStream​(java.lang.Object projectIdOrPath,
                                                                                  long pipelineId,
                                                                                  java.lang.Boolean includeRetried)
                                                                           throws GitLabApiException
        Get a Stream of jobs in a pipeline.
        GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        pipelineId - the pipeline ID to get the list of jobs for
        includeRetried - Include retried jobs in the response
        Returns:
        a Stream containing the jobs for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getJob

        public org.gitlab4j.api.models.Job getJob​(java.lang.Object projectIdOrPath,
                                                  java.lang.Long jobId)
                                           throws GitLabApiException
        Get single job in a project.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the job for
        jobId - the job ID to get
        Returns:
        a single job for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getOptionalJob

        public java.util.Optional<org.gitlab4j.api.models.Job> getOptionalJob​(java.lang.Object projectIdOrPath,
                                                                              java.lang.Long jobId)
        Get single job in a project as an Optional instance.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the job for
        jobId - the job ID to get
        Returns:
        a single job for the specified project ID as an Optional intance
      • downloadArtifactsFile

        public java.io.File downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                  java.lang.String ref,
                                                  java.lang.String jobName,
                                                  java.io.File directory)
                                           throws GitLabApiException
        Download the artifacts file from the given reference name and job provided the job finished successfully. The file will be saved to the specified directory. If the file already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/jobs/artifacts/:ref_name/download?job=name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        ref - the ref from a repository
        jobName - the name of the job to download the artifacts for
        directory - the File instance of the directory to save the file to, if null will use "java.io.tmpdir"
        Returns:
        a File instance pointing to the download of the specified artifacts file
        Throws:
        GitLabApiException - if any exception occurs
      • downloadArtifactsFile

        public java.io.InputStream downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                         java.lang.String ref,
                                                         java.lang.String jobName)
                                                  throws GitLabApiException
        Get an InputStream pointing to the artifacts file from the given reference name and job provided the job finished successfully. The file will be saved to the specified directory. If the file already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/jobs/artifacts/:ref_name/download?job=name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        ref - the ref from a repository
        jobName - the name of the job to download the artifacts for
        Returns:
        an InputStream to read the specified artifacts file from
        Throws:
        GitLabApiException - if any exception occurs
      • downloadArtifactsFile

        public java.io.File downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                  java.lang.Long jobId,
                                                  java.io.File directory)
                                           throws GitLabApiException
        Download the job artifacts file for the specified job ID. The artifacts file will be saved in the specified directory with the following name pattern: job-{jobid}-artifacts.zip. If the file already exists in the directory it will be overwritten.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the job ID to get the artifacts for
        directory - the File instance of the directory to save the file to, if null will use "java.io.tmpdir"
        Returns:
        a File instance pointing to the download of the specified job artifacts file
        Throws:
        GitLabApiException - if any exception occurs
      • downloadArtifactsFile

        public java.io.InputStream downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                         java.lang.Long jobId)
                                                  throws GitLabApiException
        Get an InputStream pointing to the job artifacts file for the specified job ID.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the job ID to get the artifacts for
        Returns:
        an InputStream to read the specified job artifacts file
        Throws:
        GitLabApiException - if any exception occurs
      • downloadArtifactsFile

        public java.io.File downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                  java.lang.Long jobId,
                                                  org.gitlab4j.api.models.ArtifactsFile artifactsFile,
                                                  java.io.File directory)
                                           throws GitLabApiException
        Download a single artifact file from within the job's artifacts archive. Only a single file is going to be extracted from the archive and streamed to a client.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the unique job identifier
        artifactsFile - an ArtifactsFile instance for the artifact to download
        directory - the File instance of the directory to save the file to, if null will use "java.io.tmpdir"
        Returns:
        a File instance pointing to the download of the specified artifacts file
        Throws:
        GitLabApiException - if any exception occurs
      • downloadArtifactsFile

        public java.io.InputStream downloadArtifactsFile​(java.lang.Object projectIdOrPath,
                                                         java.lang.Long jobId,
                                                         org.gitlab4j.api.models.ArtifactsFile artifactsFile)
                                                  throws GitLabApiException
        Download a single artifact file from within the job's artifacts archive. Only a single file is going to be extracted from the archive and streamed to a client.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the unique job identifier
        artifactsFile - an ArtifactsFile instance for the artifact to download
        Returns:
        an InputStream to read the specified artifacts file from
        Throws:
        GitLabApiException - if any exception occurs
      • downloadSingleArtifactsFile

        public java.io.File downloadSingleArtifactsFile​(java.lang.Object projectIdOrPath,
                                                        java.lang.Long jobId,
                                                        java.lang.String artifactPath,
                                                        java.io.File directory)
                                                 throws GitLabApiException
        Download a single artifact file from within the job's artifacts archive. Only a single file is going to be extracted from the archive and streamed to a client.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the unique job identifier
        artifactPath - the Path to a file inside the artifacts archive
        directory - the File instance of the directory to save the file to, if null will use "java.io.tmpdir"
        Returns:
        a File instance pointing to the download of the specified artifacts file
        Throws:
        GitLabApiException - if any exception occurs
      • downloadSingleArtifactsFile

        public java.io.InputStream downloadSingleArtifactsFile​(java.lang.Object projectIdOrPath,
                                                               java.lang.Long jobId,
                                                               java.lang.String artifactPath)
                                                        throws GitLabApiException
        Download a single artifact file from within the job's artifacts archive. Only a single file is going to be extracted from the archive and streamed to a client.
        GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the unique job identifier
        artifactPath - the Path to a file inside the artifacts archive
        Returns:
        an InputStream to read the specified artifacts file from
        Throws:
        GitLabApiException - if any exception occurs
      • getTrace

        public java.lang.String getTrace​(java.lang.Object projectIdOrPath,
                                         java.lang.Long jobId)
                                  throws GitLabApiException
        Get a trace of a specific job of a project
        GitLab Endpoint: GET /projects/:id/jobs/:id/trace
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path to get the specified job's trace for
        jobId - the job ID to get the trace for
        Returns:
        a String containing the specified job's trace
        Throws:
        GitLabApiException - if any exception occurs during execution
      • cancleJob

        @Deprecated
        public org.gitlab4j.api.models.Job cancleJob​(java.lang.Object projectIdOrPath,
                                                     java.lang.Long jobId)
                                              throws GitLabApiException
        Deprecated.
        Cancel specified job in a project.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/cancel
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to cancel job
        Returns:
        job instance which just canceled
        Throws:
        GitLabApiException - if any exception occurs during execution
      • cancelJob

        public org.gitlab4j.api.models.Job cancelJob​(java.lang.Object projectIdOrPath,
                                                     java.lang.Long jobId)
                                              throws GitLabApiException
        Cancel specified job in a project.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/cancel
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to cancel job
        Returns:
        job instance which just canceled
        Throws:
        GitLabApiException - if any exception occurs during execution
      • retryJob

        public org.gitlab4j.api.models.Job retryJob​(java.lang.Object projectIdOrPath,
                                                    java.lang.Long jobId)
                                             throws GitLabApiException
        Retry specified job in a project.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/retry
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to retry job
        Returns:
        job instance which just retried
        Throws:
        GitLabApiException - if any exception occurs during execution
      • eraseJob

        public org.gitlab4j.api.models.Job eraseJob​(java.lang.Object projectIdOrPath,
                                                    java.lang.Long jobId)
                                             throws GitLabApiException
        Erase specified job in a project.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/erase
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to erase job
        Returns:
        job instance which just erased
        Throws:
        GitLabApiException - if any exception occurs during execution
      • playJob

        public org.gitlab4j.api.models.Job playJob​(java.lang.Object projectIdOrPath,
                                                   java.lang.Long jobId)
                                            throws GitLabApiException
        Play specified job in a project.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/play
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to play job
        Returns:
        job instance which just played
        Throws:
        GitLabApiException - if any exception occurs during execution
      • playJob

        public org.gitlab4j.api.models.Job playJob​(java.lang.Object projectIdOrPath,
                                                   java.lang.Long jobId,
                                                   org.gitlab4j.api.models.JobAttributes jobAttributes)
                                            throws GitLabApiException
        Play specified job with parameters in a project.
         GitLab Endpoint: POST /projects/:id/jobs/:job_id/play
         
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to play job
        jobAttributes - attributes for the played job
        Returns:
        job instance which just played
        Throws:
        GitLabApiException - if any exception occurs during execution
      • keepArtifacts

        public org.gitlab4j.api.models.Job keepArtifacts​(java.lang.Object projectIdOrPath,
                                                         java.lang.Long jobId)
                                                  throws GitLabApiException
        Prevents artifacts from being deleted when expiration is set.
        GitLab Endpoint: POST /projects/:id/jobs/:job_id/keep
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to keep artifacts for
        Returns:
        the Job instance that was just modified
        Throws:
        GitLabApiException - if any exception occurs during execution
      • deleteArtifacts

        public void deleteArtifacts​(java.lang.Object projectIdOrPath,
                                    java.lang.Long jobId)
                             throws GitLabApiException
        Delete artifacts of a job.
        GitLab Endpoint: DELETE /projects/:id/jobs/:job_id/artifacts
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        jobId - the ID to delete artifacts for
        Throws:
        GitLabApiException - if any exception occurs during execution