module Gitlab::Client::Jobs

def job(project_id, job_id)

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job(project_id, job_id)
  get("/projects/#{url_encode project_id}/jobs/#{job_id}")
end

def job_artifacts(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_artifacts(project_id, job_id)
  get("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts",
      format: nil,
      headers: { Accept: 'text/plain' },
      parser: ::Gitlab::Request::Parser)
end

def job_artifacts_download(project_id, ref_name, job_name)

Returns:
  • (Array) -

Parameters:
  • job, (String) -- jobname
  • ref, (String) -- Ref Name
  • id, (Integer, String) -- The ID or name of a project.
def job_artifacts_download(project_id, ref_name, job_name)
  get("/projects/#{url_encode project_id}/jobs/artifacts/#{ref_name}/download", query: { job: job_name },
                                                                                format: nil,
                                                                                headers: { Accept: 'text/plain' },
                                                                                parser: ::Gitlab::Request::Parser)
end

def job_artifacts_keep(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_artifacts_keep(project_id, job_id)
  post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep")
end

def job_cancel(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_cancel(project_id, job_id)
  post("/projects/#{url_encode project_id}/jobs/#{job_id}/cancel")
end

def job_erase(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_erase(project_id, job_id)
  post("/projects/#{url_encode project_id}/jobs/#{job_id}/erase")
end

def job_play(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_play(project_id, job_id)
  post("/projects/#{url_encode project_id}/jobs/#{job_id}/play")
end

def job_retry(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_retry(project_id, job_id)
  post("/projects/#{url_encode project_id}/jobs/#{job_id}/retry")
end

def job_trace(project_id, job_id)

Returns:
  • (Array) -

Parameters:
  • the (Integer) -- id of the job
  • The (Integer, String) -- ID or name of a project.
def job_trace(project_id, job_id)
  get("/projects/#{url_encode project_id}/jobs/#{job_id}/trace",
      format: nil,
      headers: { Accept: 'text/plain' },
      parser: ::Gitlab::Request::Parser)
end

def jobs(project_id, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :per_page (Integer) -- The number of results per page.
  • :page (Integer) -- The page number.
  • :scope (Array) -- The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer, String) -- The ID or name of a project.
def jobs(project_id, options = {})
  get("/projects/#{url_encode project_id}/jobs", query: options)
end

def pipeline_jobs(project_id, pipeline_id, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :scope (Array) -- The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.

Parameters:
  • options (Hash) -- A customizable set of options.
  • the (Integer) -- id of the pipeline
  • The (Integer, String) -- ID or name of a project.
def pipeline_jobs(project_id, pipeline_id, options = {})
  get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: options)
end