Skip to content

feat(ske): add commands to trigger operations #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/stackit_ske_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ stackit ske cluster [flags]
### SEE ALSO

* [stackit ske](./stackit_ske.md) - Provides functionality for SKE
* [stackit ske cluster create](./stackit_ske_cluster_create.md) - Creates an SKE cluster
* [stackit ske cluster create](./stackit_ske_cluster_create.md) - Creates a SKE cluster
* [stackit ske cluster delete](./stackit_ske_cluster_delete.md) - Deletes a SKE cluster
* [stackit ske cluster describe](./stackit_ske_cluster_describe.md) - Shows details of a SKE cluster
* [stackit ske cluster describe](./stackit_ske_cluster_describe.md) - Shows details of a SKE cluster
* [stackit ske cluster generate-payload](./stackit_ske_cluster_generate-payload.md) - Generates a payload to create/update SKE clusters
* [stackit ske cluster hibernate](./stackit_ske_cluster_hibernate.md) - Trigger hibernate for a SKE cluster
* [stackit ske cluster list](./stackit_ske_cluster_list.md) - Lists all SKE clusters
* [stackit ske cluster update](./stackit_ske_cluster_update.md) - Updates an SKE cluster
* [stackit ske cluster maintenance](./stackit_ske_cluster_maintenance.md) - Trigger maintenance for a SKE cluster
* [stackit ske cluster reconcile](./stackit_ske_cluster_reconcile.md) - Trigger reconcile for a SKE cluster
* [stackit ske cluster update](./stackit_ske_cluster_update.md) - Updates a SKE cluster
* [stackit ske cluster wakeup](./stackit_ske_cluster_wakeup.md) - Trigger wakeup from hibernation for a SKE cluster

8 changes: 4 additions & 4 deletions docs/stackit_ske_cluster_create.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## stackit ske cluster create

Creates an SKE cluster
Creates a SKE cluster

### Synopsis

Expand All @@ -15,13 +15,13 @@ stackit ske cluster create CLUSTER_NAME [flags]
### Examples

```
Create an SKE cluster using default configuration
Create a SKE cluster using default configuration
$ stackit ske cluster create my-cluster

Create an SKE cluster using an API payload sourced from the file "./payload.json"
Create a SKE cluster using an API payload sourced from the file "./payload.json"
$ stackit ske cluster create my-cluster --payload @./payload.json

Create an SKE cluster using an API payload provided as a JSON string
Create a SKE cluster using an API payload provided as a JSON string
$ stackit ske cluster create my-cluster --payload "{...}"

Generate a payload with default values, and adapt it with custom values for the different configuration options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_ske_cluster_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ stackit ske cluster delete CLUSTER_NAME [flags]
### Examples

```
Delete an SKE cluster with name "my-cluster"
Delete a SKE cluster with name "my-cluster"
$ stackit ske cluster delete my-cluster
```

Expand Down
8 changes: 4 additions & 4 deletions docs/stackit_ske_cluster_describe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit ske cluster describe

Shows details of a SKE cluster
Shows details of a SKE cluster

### Synopsis

Shows details of a STACKIT Kubernetes Engine (SKE) cluster.
Shows details of a STACKIT Kubernetes Engine (SKE) cluster.

```
stackit ske cluster describe CLUSTER_NAME [flags]
Expand All @@ -13,10 +13,10 @@ stackit ske cluster describe CLUSTER_NAME [flags]
### Examples

```
Get details of an SKE cluster with name "my-cluster"
Get details of a SKE cluster with name "my-cluster"
$ stackit ske cluster describe my-cluster

Get details of an SKE cluster with name "my-cluster" in JSON format
Get details of a SKE cluster with name "my-cluster" in JSON format
$ stackit ske cluster describe my-cluster --output-format json
```

Expand Down
40 changes: 40 additions & 0 deletions docs/stackit_ske_cluster_hibernate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit ske cluster hibernate

Trigger hibernate for a SKE cluster

### Synopsis

Trigger hibernate for a STACKIT Kubernetes Engine (SKE) cluster.

```
stackit ske cluster hibernate CLUSTER_NAME [flags]
```

### Examples

```
Trigger hibernate for a SKE cluster with name "my-cluster"
$ stackit ske cluster hibernate my-cluster
```

### Options

```
-h, --help Help for "stackit ske cluster hibernate"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster

40 changes: 40 additions & 0 deletions docs/stackit_ske_cluster_maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit ske cluster maintenance

Trigger maintenance for a SKE cluster

### Synopsis

Trigger maintenance for a STACKIT Kubernetes Engine (SKE) cluster.

```
stackit ske cluster maintenance CLUSTER_NAME [flags]
```

### Examples

```
Trigger maintenance for a SKE cluster with name "my-cluster"
$ stackit ske cluster maintenance my-cluster
```

### Options

```
-h, --help Help for "stackit ske cluster maintenance"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster

40 changes: 40 additions & 0 deletions docs/stackit_ske_cluster_reconcile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit ske cluster reconcile

Trigger reconcile for a SKE cluster

### Synopsis

Trigger reconcile for a STACKIT Kubernetes Engine (SKE) cluster.

```
stackit ske cluster reconcile CLUSTER_NAME [flags]
```

### Examples

```
Trigger reconcile for a SKE cluster with name "my-cluster"
$ stackit ske cluster reconcile my-cluster
```

### Options

```
-h, --help Help for "stackit ske cluster reconcile"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster

6 changes: 3 additions & 3 deletions docs/stackit_ske_cluster_update.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## stackit ske cluster update

Updates an SKE cluster
Updates a SKE cluster

### Synopsis

Expand All @@ -15,10 +15,10 @@ stackit ske cluster update CLUSTER_NAME [flags]
### Examples

```
Update an SKE cluster using an API payload sourced from the file "./payload.json"
Update a SKE cluster using an API payload sourced from the file "./payload.json"
$ stackit ske cluster update my-cluster --payload @./payload.json

Update an SKE cluster using an API payload provided as a JSON string
Update a SKE cluster using an API payload provided as a JSON string
$ stackit ske cluster update my-cluster --payload "{...}"

Generate a payload with the current values of a cluster, and adapt it with custom values for the different configuration options
Expand Down
40 changes: 40 additions & 0 deletions docs/stackit_ske_cluster_wakeup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit ske cluster wakeup

Trigger wakeup from hibernation for a SKE cluster

### Synopsis

Trigger wakeup from hibernation for a STACKIT Kubernetes Engine (SKE) cluster.

```
stackit ske cluster wakeup CLUSTER_NAME [flags]
```

### Examples

```
Trigger wakeup from hibernation for a SKE cluster with name "my-cluster"
$ stackit ske cluster wakeup my-cluster
```

### Options

```
-h, --help Help for "stackit ske cluster wakeup"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster

2 changes: 1 addition & 1 deletion docs/stackit_ske_kubeconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ stackit ske kubeconfig [flags]
### SEE ALSO

* [stackit ske](./stackit_ske.md) - Provides functionality for SKE
* [stackit ske kubeconfig create](./stackit_ske_kubeconfig_create.md) - Creates or update a kubeconfig for an SKE cluster
* [stackit ske kubeconfig create](./stackit_ske_kubeconfig_create.md) - Creates or update a kubeconfig for a SKE cluster
* [stackit ske kubeconfig login](./stackit_ske_kubeconfig_login.md) - Login plugin for kubernetes clients

4 changes: 2 additions & 2 deletions docs/stackit_ske_kubeconfig_create.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit ske kubeconfig create

Creates or update a kubeconfig for an SKE cluster
Creates or update a kubeconfig for a SKE cluster

### Synopsis

Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exits in the kubeconfig file the information will be updated.
Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exists in the kubeconfig file the information will be updated.

By default, the kubeconfig information of the SKE cluster is merged into the default kubeconfig file of the current user. If the kubeconfig file doesn't exist, a new one will be created.
You can override this behavior by specifying a custom filepath with the --filepath flag.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.2.1
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.1
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.2
github.com/stackitcloud/stackit-sdk-go/services/ske v1.2.0
github.com/stackitcloud/stackit-sdk-go/services/ske v1.3.0
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.1
github.com/zalando/go-keyring v0.2.6
golang.org/x/mod v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.1 h1:6kEct2w
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.1/go.mod h1:dScCMWYbsf3B+c6a/5CFoVFcYLqHHkEEc622cHFtGGY=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.2 h1:s2iag/Gc4tuQH7x5I0n4mQWVhpfl/cj+SVNAFAB5ck0=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.2/go.mod h1:DFEamKVoOjm/rjMwzfZK0Zg/hwsSkXOibdA4HcC6swk=
github.com/stackitcloud/stackit-sdk-go/services/ske v1.2.0 h1:rNlTSWShnlkW4vbBuJ3a1NPwQfN5H1+mpdjngLqFRdo=
github.com/stackitcloud/stackit-sdk-go/services/ske v1.2.0/go.mod h1:UPPntEOhriZ4dZXEkjtfkGLFKvfA7Q/JAPG/zfwcoyc=
github.com/stackitcloud/stackit-sdk-go/services/ske v1.3.0 h1:hPCpRcWEzwzGONZJsKH+j2TjN1LRTH7Tp/q0TyzmL5M=
github.com/stackitcloud/stackit-sdk-go/services/ske v1.3.0/go.mod h1:jDYRbagjOwKEVsvkxdUErXIvvTOLw9WdBVjaXr5YOD8=
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.1 h1:r5808lRhtY8l5anft/UwgJEaef1XsoYObmwd3FVai48=
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.1/go.mod h1:+LYy2pB+tpF0lkkmCf524wvv2Sa49REgEaNh7JGzN6Y=
github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4=
Expand Down
8 changes: 8 additions & 0 deletions internal/cmd/ske/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import (
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/delete"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/describe"
generatepayload "github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/generate-payload"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/hibernate"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/list"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/maintenance"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/reconcile"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/update"
"github.com/stackitcloud/stackit-cli/internal/cmd/ske/cluster/wakeup"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

Expand All @@ -33,4 +37,8 @@ func addSubcommands(cmd *cobra.Command, params *params.CmdParams) {
cmd.AddCommand(describe.NewCmd(params))
cmd.AddCommand(list.NewCmd(params))
cmd.AddCommand(update.NewCmd(params))
cmd.AddCommand(hibernate.NewCmd(params))
cmd.AddCommand(maintenance.NewCmd(params))
cmd.AddCommand(reconcile.NewCmd(params))
cmd.AddCommand(wakeup.NewCmd(params))
}
8 changes: 4 additions & 4 deletions internal/cmd/ske/cluster/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type inputModel struct {
func NewCmd(params *params.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("create %s", clusterNameArg),
Short: "Creates an SKE cluster",
Short: "Creates a SKE cluster",
Long: fmt.Sprintf("%s\n%s\n%s",
"Creates a STACKIT Kubernetes Engine (SKE) cluster.",
"The payload can be provided as a JSON string or a file path prefixed with \"@\".",
Expand All @@ -49,13 +49,13 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
Args: args.SingleArg(clusterNameArg, nil),
Example: examples.Build(
examples.NewExample(
`Create an SKE cluster using default configuration`,
`Create a SKE cluster using default configuration`,
"$ stackit ske cluster create my-cluster"),
examples.NewExample(
`Create an SKE cluster using an API payload sourced from the file "./payload.json"`,
`Create a SKE cluster using an API payload sourced from the file "./payload.json"`,
"$ stackit ske cluster create my-cluster --payload @./payload.json"),
examples.NewExample(
`Create an SKE cluster using an API payload provided as a JSON string`,
`Create a SKE cluster using an API payload provided as a JSON string`,
`$ stackit ske cluster create my-cluster --payload "{...}"`),
examples.NewExample(
`Generate a payload with default values, and adapt it with custom values for the different configuration options`,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/ske/cluster/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
Args: args.SingleArg(clusterNameArg, nil),
Example: examples.Build(
examples.NewExample(
`Delete an SKE cluster with name "my-cluster"`,
`Delete a SKE cluster with name "my-cluster"`,
"$ stackit ske cluster delete my-cluster"),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/ske/cluster/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type inputModel struct {
func NewCmd(params *params.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("describe %s", clusterNameArg),
Short: "Shows details of a SKE cluster",
Long: "Shows details of a STACKIT Kubernetes Engine (SKE) cluster.",
Short: "Shows details of a SKE cluster",
Long: "Shows details of a STACKIT Kubernetes Engine (SKE) cluster.",
Args: args.SingleArg(clusterNameArg, nil),
Example: examples.Build(
examples.NewExample(
`Get details of an SKE cluster with name "my-cluster"`,
`Get details of a SKE cluster with name "my-cluster"`,
"$ stackit ske cluster describe my-cluster"),
examples.NewExample(
`Get details of an SKE cluster with name "my-cluster" in JSON format`,
`Get details of a SKE cluster with name "my-cluster" in JSON format`,
"$ stackit ske cluster describe my-cluster --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
Loading
Loading