Skip to content

Commit 787470f

Browse files
committed
add snapshot basic structure
1 parent 2c00ad0 commit 787470f

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package snapshot
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
"github.com/stackitcloud/stackit-cli/internal/cmd/params"
6+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/create"
7+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/delete"
8+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/describe"
9+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/list"
10+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/update"
11+
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
12+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
13+
)
14+
15+
func NewCmd(params *params.CmdParams) *cobra.Command {
16+
cmd := &cobra.Command{
17+
Use: "snapshot",
18+
Short: "Provides functionality for snapshots",
19+
Long: "Provides functionality for snapshots.",
20+
Args: args.NoArgs,
21+
Run: utils.CmdHelp,
22+
}
23+
addSubcommands(cmd, params)
24+
return cmd
25+
}
26+
27+
func addSubcommands(cmd *cobra.Command, params *params.CmdParams) {
28+
cmd.AddCommand(create.NewCmd(params))
29+
cmd.AddCommand(delete.NewCmd(params))
30+
cmd.AddCommand(describe.NewCmd(params))
31+
cmd.AddCommand(list.NewCmd(params))
32+
cmd.AddCommand(update.NewCmd(params))
33+
}

internal/cmd/volume/volume.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/list"
99
performanceclass "github.com/stackitcloud/stackit-cli/internal/cmd/volume/performance-class"
1010
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/resize"
11+
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot"
1112
"github.com/stackitcloud/stackit-cli/internal/cmd/volume/update"
1213
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
1314
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
@@ -35,4 +36,5 @@ func addSubcommands(cmd *cobra.Command, params *params.CmdParams) {
3536
cmd.AddCommand(update.NewCmd(params))
3637
cmd.AddCommand(resize.NewCmd(params))
3738
cmd.AddCommand(performanceclass.NewCmd(params))
39+
cmd.AddCommand(snapshot.NewCmd(params))
3840
}

0 commit comments

Comments
 (0)