Skip to content

Commit f77a9d6

Browse files
committed
restructed security-group command
1 parent 0976afc commit f77a9d6

File tree

13 files changed

+44
-13
lines changed

13 files changed

+44
-13
lines changed

internal/cmd/beta/beta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
networkArea "github.com/stackitcloud/stackit-cli/internal/cmd/beta/network-area"
99
networkinterface "github.com/stackitcloud/stackit-cli/internal/cmd/beta/network-interface"
1010
publicip "github.com/stackitcloud/stackit-cli/internal/cmd/beta/public-ip"
11-
security_group "github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group"
11+
securitygroup "github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group"
1212
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server"
1313
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex"
1414
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/volume"
@@ -50,6 +50,6 @@ func addSubcommands(cmd *cobra.Command, p *print.Printer) {
5050
cmd.AddCommand(volume.NewCmd(p))
5151
cmd.AddCommand(networkinterface.NewCmd(p))
5252
cmd.AddCommand(publicip.NewCmd(p))
53-
cmd.AddCommand(security_group.NewCmd(p))
53+
cmd.AddCommand(securitygroup.NewCmd(p))
5454
cmd.AddCommand(keypair.NewCmd(p))
5555
}
File renamed without changes.

internal/cmd/beta/security-group/create/create_test.go renamed to internal/cmd/beta/security-group/group/create/create_test.go

File renamed without changes.
File renamed without changes.

internal/cmd/beta/security-group/delete/delete_test.go renamed to internal/cmd/beta/security-group/group/delete/delete_test.go

File renamed without changes.

internal/cmd/beta/security-group/describe/describe.go renamed to internal/cmd/beta/security-group/group/describe/describe.go

File renamed without changes.

internal/cmd/beta/security-group/describe/describe_test.go renamed to internal/cmd/beta/security-group/group/describe/describe_test.go

File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package group
2+
3+
import (
4+
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
5+
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
6+
7+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group/group/create"
8+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group/group/delete"
9+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group/group/describe"
10+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group/group/list"
11+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/security-group/group/update"
12+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
13+
14+
"github.com/spf13/cobra"
15+
)
16+
17+
func NewCmd(p *print.Printer) *cobra.Command {
18+
cmd := &cobra.Command{
19+
Use: "group",
20+
Short: "Manage security groups",
21+
Long: "Manage the lifecycle of security groups.",
22+
Args: args.NoArgs,
23+
Run: utils.CmdHelp,
24+
}
25+
addSubcommands(cmd, p)
26+
return cmd
27+
}
28+
29+
func addSubcommands(cmd *cobra.Command, p *print.Printer) {
30+
cmd.AddCommand(
31+
create.NewCmd(p),
32+
delete.NewCmd(p),
33+
describe.NewCmd(p),
34+
list.NewCmd(p),
35+
update.NewCmd(p),
36+
)
37+
}

0 commit comments

Comments
 (0)