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.
44 45 46 47 |
# File 'lib/gitlab/client/environments.rb', line 44 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.
73 74 75 |
# File 'lib/gitlab/client/environments.rb', line 73 def delete_environment(project, id) delete("/projects/#{url_encode project}/environments/#{id}") end |
#edit_environment(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update an environment.
61 62 63 |
# File 'lib/gitlab/client/environments.rb', line 61 def edit_environment(project, id, = {}) put("/projects/#{url_encode project}/environments/#{id}", body: ) end |
#environment(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single environment.
30 31 32 |
# File 'lib/gitlab/client/environments.rb', line 30 def environment(project, id) get("/projects/#{url_encode project}/environments/#{id}") end |
#environments(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project environments.
18 19 20 |
# File 'lib/gitlab/client/environments.rb', line 18 def environments(project, = {}) get("/projects/#{url_encode project}/environments", query: ) end |
#stop_environment(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Stop an environment.
85 86 87 |
# File 'lib/gitlab/client/environments.rb', line 85 def stop_environment(project, id) post("/projects/#{url_encode project}/environments/#{id}/stop") end |