Skip to content

Commit

Permalink
add the CreateKubernetesPool method to map the new POST /v2/kubernete…
Browse files Browse the repository at this point in the history
…s/clusters/{cluster_id}/pools
  • Loading branch information
alessandroargentieri committed Sep 19, 2023
1 parent 49d3099 commit d36bc6d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ type KubernetesClusterConfig struct {

// KubernetesClusterPoolConfig is used to create a new cluster pool
type KubernetesClusterPoolConfig struct {
Region string `json:"region,omitempty"`
ID string `json:"id,omitempty"`
Count int `json:"count,omitempty"`
Size string `json:"size,omitempty"`
Expand Down Expand Up @@ -284,6 +285,16 @@ func (c *Client) UpdateKubernetesCluster(id string, i *KubernetesClusterConfig)
return kubernetes, nil
}

// CreateKubernetesPool update a single kubernetes cluster by its full ID
func (c *Client) CreateKubernetesPool(id string, i *KubernetesClusterPoolConfig) (*KubernetesCluster, error) {
i.Region = c.Region
if _, err := c.SendPostRequest(fmt.Sprintf("/v2/kubernetes/clusters/%s/pools", id), i); err != nil {
return nil, decodeError(err)
}

return c.FindKubernetesCluster(id)
}

// ListKubernetesMarketplaceApplications returns all application inside marketplace
func (c *Client) ListKubernetesMarketplaceApplications() ([]KubernetesMarketplaceApplication, error) {
resp, err := c.SendGetRequest("/v2/kubernetes/applications")
Expand Down

0 comments on commit d36bc6d

Please sign in to comment.