Module: Gitlab::Client::PipelineTriggers
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/pipeline_triggers.rb
Overview
Defines methods related to pipelines.
Instance Method Summary collapse
-
#create_trigger(project, description) ⇒ Gitlab::ObjectifiedHash
Create a pipeline trigger for a project.
-
#remove_trigger(project, trigger_id) ⇒ void
(also: #delete_trigger)
Remove a project’s pipeline trigger.
-
#run_trigger(project, token, ref, variables = {}) ⇒ Gitlab::ObjectifiedHash
Run the given project pipeline trigger.
-
#trigger(project, trigger_id) ⇒ Gitlab::ObjectifiedHash
Gets details of project’s pipeline trigger.
-
#trigger_take_ownership(project, trigger_id) ⇒ Gitlab::ObjectifiedHash
Take ownership of a project trigger.
-
#triggers(project) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of the project’s pipeline triggers.
-
#update_trigger(project, trigger_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update a project trigger.
Instance Method Details
#create_trigger(project, description) ⇒ Gitlab::ObjectifiedHash
Create a pipeline trigger for a project.
39 40 41 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 39 def create_trigger(project, description) post("/projects/#{url_encode project}/triggers", body: { description: description }) end |
#remove_trigger(project, trigger_id) ⇒ void Also known as: delete_trigger
This method returns an undefined value.
Remove a project’s pipeline trigger.
77 78 79 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 77 def remove_trigger(project, trigger_id) delete("/projects/#{url_encode project}/triggers/#{trigger_id}") end |
#run_trigger(project, token, ref, variables = {}) ⇒ Gitlab::ObjectifiedHash
Run the given project pipeline trigger.
95 96 97 98 99 100 101 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 95 def run_trigger(project, token, ref, variables = {}) post("/projects/#{url_encode project}/trigger/pipeline", unauthenticated: true, body: { token: token, ref: ref, variables: variables }) end |
#trigger(project, trigger_id) ⇒ Gitlab::ObjectifiedHash
Gets details of project’s pipeline trigger.
27 28 29 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 27 def trigger(project, trigger_id) get("/projects/#{url_encode project}/triggers/#{trigger_id}") end |
#trigger_take_ownership(project, trigger_id) ⇒ Gitlab::ObjectifiedHash
Take ownership of a project trigger
65 66 67 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 65 def trigger_take_ownership(project, trigger_id) post("/projects/#{url_encode project}/triggers/#{trigger_id}/take_ownership") end |
#triggers(project) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of the project’s pipeline triggers
15 16 17 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 15 def triggers(project) get("/projects/#{url_encode project}/triggers") end |
#update_trigger(project, trigger_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update a project trigger
53 54 55 |
# File 'lib/gitlab/client/pipeline_triggers.rb', line 53 def update_trigger(project, trigger_id, = {}) put("/projects/#{url_encode project}/triggers/#{trigger_id}", body: ) end |