Skip to content

Commit

Permalink
Merge pull request #166 from civo/create-pool
Browse files Browse the repository at this point in the history
add the CreateKubernetesPool method to map the new POST /v2/kubernete…
  • Loading branch information
alessandroargentieri authored Sep 19, 2023
2 parents 49d3099 + d36bc6d commit 69e1668
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 69e1668

Please sign in to comment.