Module: Gitlab::Client::ProjectClusters
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/project_clusters.rb
Overview
Defines methods related to project clusters.
Instance Method Summary collapse
-
#add_project_cluster(project, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Adds an existing Kubernetes cluster to the project.
-
#delete_project_cluster(project, cluster_id) ⇒ nil
Deletes an existing project cluster.
-
#edit_project_cluster(project, cluster_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an existing project cluster.
-
#project_cluster(project, cluster_id) ⇒ Gitlab::ObjectifiedHash
Gets a single project cluster.
-
#project_clusters(project) ⇒ Array<Gitlab::ObjectifiedHash>
Returns a list of project clusters.
Instance Method Details
#add_project_cluster(project, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Adds an existing Kubernetes cluster to the project.
47 48 49 50 |
# File 'lib/gitlab/client/project_clusters.rb', line 47 def add_project_cluster(project, name, = {}) body = { name: name }.merge() post("/projects/#{url_encode project}/clusters/user", body: body) end |
#delete_project_cluster(project, cluster_id) ⇒ nil
Deletes an existing project cluster.
79 80 81 |
# File 'lib/gitlab/client/project_clusters.rb', line 79 def delete_project_cluster(project, cluster_id) delete("/projects/#{url_encode project}/clusters/#{cluster_id}") end |
#edit_project_cluster(project, cluster_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an existing project cluster.
67 68 69 |
# File 'lib/gitlab/client/project_clusters.rb', line 67 def edit_project_cluster(project, cluster_id, = {}) put("/projects/#{url_encode project}/clusters/#{cluster_id}", body: ) end |
#project_cluster(project, cluster_id) ⇒ Gitlab::ObjectifiedHash
Gets a single project cluster.
26 27 28 |
# File 'lib/gitlab/client/project_clusters.rb', line 26 def project_cluster(project, cluster_id) get("/projects/#{url_encode project}/clusters/#{cluster_id}") end |
#project_clusters(project) ⇒ Array<Gitlab::ObjectifiedHash>
Returns a list of project clusters.
14 15 16 |
# File 'lib/gitlab/client/project_clusters.rb', line 14 def project_clusters(project) get("/projects/#{url_encode project}/clusters") end |