Module: Gitlab::Client::Environments
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/environments.rb
Overview
Defines methods related to environments.
Instance Method Summary collapse
-
#create_environment(project, env_name, options = {}) ⇒ Gitlab::ObjectifiedHash
Create an environment.
-
#delete_environment(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes an environment.
-
#edit_environment(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update an environment.
-
#environment(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single environment.
-
#environments(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project environments.
-
#stop_environment(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Stop an environment.
Instance Method Details
#create_environment(project, env_name, options = {}) ⇒ Gitlab::ObjectifiedHash
Create an environment.
42 43 44 45 |
# File 'lib/gitlab/client/environments.rb', line 42 def create_environment(project, env_name, = {}) body = {name: env_name}.merge() post("/projects/#{url_encode project}/environments", body: body) end |
#delete_environment(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes an environment.
71 72 73 |
# File 'lib/gitlab/client/environments.rb', line 71 def delete_environment(project, id) delete("/projects/#{url_encode project}/environments/#{id}") end |
#edit_environment(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update an environment.
59 60 61 |
# File 'lib/gitlab/client/environments.rb', line 59 def edit_environment(project, id, ={}) put("/projects/#{url_encode project}/environments/#{id}", body: ) end |
#environment(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single environment.
28 29 30 |
# File 'lib/gitlab/client/environments.rb', line 28 def environment(project, id) get("/projects/#{url_encode project}/environments/#{id}") end |
#environments(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project environments.
16 17 18 |
# File 'lib/gitlab/client/environments.rb', line 16 def environments(project, ={}) get("/projects/#{url_encode project}/environments", query: ) end |
#stop_environment(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Stop an environment.
83 84 85 |
# File 'lib/gitlab/client/environments.rb', line 83 def stop_environment(project, id) post("/projects/#{url_encode project}/environments/#{id}/stop") end |