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
47 48 49 |
# File 'lib/gitlab/client/jobs.rb', line 47 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
60 61 62 63 64 65 |
# File 'lib/gitlab/client/jobs.rb', line 60 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
77 78 79 80 81 82 |
# File 'lib/gitlab/client/jobs.rb', line 77 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.
163 164 165 |
# File 'lib/gitlab/client/jobs.rb', line 163 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
109 110 111 |
# File 'lib/gitlab/client/jobs.rb', line 109 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
135 136 137 |
# File 'lib/gitlab/client/jobs.rb', line 135 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.
149 150 151 |
# File 'lib/gitlab/client/jobs.rb', line 149 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
122 123 124 |
# File 'lib/gitlab/client/jobs.rb', line 122 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
93 94 95 96 97 98 |
# File 'lib/gitlab/client/jobs.rb', line 93 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
20 21 22 |
# File 'lib/gitlab/client/jobs.rb', line 20 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
35 36 37 |
# File 'lib/gitlab/client/jobs.rb', line 35 def pipeline_jobs(project_id, pipeline_id, = {}) get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: ) end |