Module: Gitlab::Client::Jobs
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/jobs.rb
Overview
Defines methods related to projects.
Instance Method Summary collapse
-
#job(project_id, job_id) ⇒ Object
Gets a single job.
-
#job_artifacts(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets artifacts from a job.
-
#job_artifacts_download(project_id, ref_name, job_name) ⇒ Array<Gitlab::ObjectifiedHash>
Download Job Artifact.
-
#job_artifacts_keep(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Keep Artifacts Prevents artifacts from being deleted when expiration is set.
-
#job_cancel(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Cancel a job.
-
#job_erase(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Erase Job.
-
#job_play(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Play a Job Triggers a manual action to start a job.
-
#job_retry(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Retry a job.
-
#job_trace(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Get Job Trace.
-
#jobs(project_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of Jobs for a Project.
-
#pipeline_jobs(project_id, pipeline_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of Jobs from a pipeline.
Instance Method Details
#job(project_id, job_id) ⇒ Object
Gets a single job
42 43 44 |
# File 'lib/gitlab/client/jobs.rb', line 42 def job(project_id, job_id) get("/projects/#{url_encode project_id}/jobs/#{job_id}") end |
#job_artifacts(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets artifacts from a job
55 56 57 58 59 60 |
# File 'lib/gitlab/client/jobs.rb', line 55 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 |
#job_artifacts_download(project_id, ref_name, job_name) ⇒ Array<Gitlab::ObjectifiedHash>
Download Job Artifact
72 73 74 75 76 77 |
# File 'lib/gitlab/client/jobs.rb', line 72 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 |
#job_artifacts_keep(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Keep Artifacts Prevents artifacts from being deleted when expiration is set.
158 159 160 |
# File 'lib/gitlab/client/jobs.rb', line 158 def job_artifacts_keep(project_id, job_id) post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep") end |
#job_cancel(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Cancel a job
104 105 106 |
# File 'lib/gitlab/client/jobs.rb', line 104 def job_cancel(project_id, job_id) post("/projects/#{url_encode project_id}/jobs/#{job_id}/cancel") end |
#job_erase(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Erase Job
130 131 132 |
# File 'lib/gitlab/client/jobs.rb', line 130 def job_erase(project_id, job_id) post("/projects/#{url_encode project_id}/jobs/#{job_id}/erase") end |
#job_play(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Play a Job Triggers a manual action to start a job.
144 145 146 |
# File 'lib/gitlab/client/jobs.rb', line 144 def job_play(project_id, job_id) post("/projects/#{url_encode project_id}/jobs/#{job_id}/play") end |
#job_retry(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Retry a job
117 118 119 |
# File 'lib/gitlab/client/jobs.rb', line 117 def job_retry(project_id, job_id) post("/projects/#{url_encode project_id}/jobs/#{job_id}/retry") end |
#job_trace(project_id, job_id) ⇒ Array<Gitlab::ObjectifiedHash>
Get Job Trace
88 89 90 91 92 93 |
# File 'lib/gitlab/client/jobs.rb', line 88 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 |
#jobs(project_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of Jobs for a Project
15 16 17 |
# File 'lib/gitlab/client/jobs.rb', line 15 def jobs(project_id, = {}) get("/projects/#{url_encode project_id}/jobs", query: ) end |
#pipeline_jobs(project_id, pipeline_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of Jobs from a pipeline
30 31 32 |
# File 'lib/gitlab/client/jobs.rb', line 30 def pipeline_jobs(project_id, pipeline_id, = {}) get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: ) end |