module Gitlab::Client::ProjectClusters

def add_project_cluster(project, name, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Information about the added project cluster.

Options Hash: (**options)
  • :platform_kubernetes_attributes (Hash) -- A customizable set of Kubernetes platform attributes
  • :enabled(optional) (Boolean) -- Determines if cluster is active or not, defaults to true

Parameters:
  • options (Hash) -- A customizable set of options.
  • name (String) -- The name of the existing cluster.
  • project (Integer, String) -- The ID or name of a project.
def add_project_cluster(project, name, options = {})
  body = { name: name }.merge(options)
  post("/projects/#{url_encode project}/clusters/user", body: body)
end

def delete_project_cluster(project, cluster_id)

Returns:
  • (nil) - This API call returns an empty response body.

Parameters:
  • cluster_id (Integer) -- The ID of the cluster.
  • project (Integer, String) -- The ID or name of a project.
def delete_project_cluster(project, cluster_id)
  delete("/projects/#{url_encode project}/clusters/#{cluster_id}")
end

def edit_project_cluster(project, cluster_id, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Information about the updated project cluster.

Options Hash: (**options)
  • :platform_kubernetes_attributes (Hash) -- A customizable set of Kubernetes platform attributes
  • :name(optional) (String) -- The name of the cluster

Parameters:
  • options (Hash) -- A customizable set of options.
  • cluster_id (Integer) -- The ID of the cluster.
  • project (Integer, String) -- The ID or name of a project.
def edit_project_cluster(project, cluster_id, options = {})
  put("/projects/#{url_encode project}/clusters/#{cluster_id}", body: options)
end

def project_cluster(project, cluster_id)

Returns:
  • (Gitlab::ObjectifiedHash) - Information about the requested cluster

Parameters:
  • cluster_id (Integer) -- The ID of the cluster.
  • project (Integer, String) -- The ID or name of a project.
def project_cluster(project, cluster_id)
  get("/projects/#{url_encode project}/clusters/#{cluster_id}")
end

def project_clusters(project)

Returns:
  • (Array) - List of all clusters of a project

Parameters:
  • project (Integer, String) -- The ID or name of a project.
def project_clusters(project)
  get("/projects/#{url_encode project}/clusters")
end