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
44 45 46 |
# File 'lib/gitlab/client/jobs.rb', line 44 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
57 58 59 60 61 62 |
# File 'lib/gitlab/client/jobs.rb', line 57 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
74 75 76 77 78 79 |
# File 'lib/gitlab/client/jobs.rb', line 74 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.
160 161 162 |
# File 'lib/gitlab/client/jobs.rb', line 160 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
106 107 108 |
# File 'lib/gitlab/client/jobs.rb', line 106 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
132 133 134 |
# File 'lib/gitlab/client/jobs.rb', line 132 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.
146 147 148 |
# File 'lib/gitlab/client/jobs.rb', line 146 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
119 120 121 |
# File 'lib/gitlab/client/jobs.rb', line 119 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
90 91 92 93 94 95 |
# File 'lib/gitlab/client/jobs.rb', line 90 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
17 18 19 |
# File 'lib/gitlab/client/jobs.rb', line 17 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
32 33 34 |
# File 'lib/gitlab/client/jobs.rb', line 32 def pipeline_jobs(project_id, pipeline_id, = {}) get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: ) end |