-
Notifications
You must be signed in to change notification settings - Fork 37
feat(server): Implement and document security group attach/detach commands #1341
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
Merged
rubenhoenle
merged 11 commits into
main
from
feat/server-security-group-attach-and-detach
Mar 24, 2026
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5aa1caa
feat(server): create security-group attach and detach command scaffolds
s-inter 0b406a0
fix(server): fix typo
s-inter c45dcbc
feat(server): implement attach security group command
s-inter 879b341
feat(server): implement detach security group command
s-inter 8a32a6c
feat(server): refactor attach command to use flags instead of positio…
s-inter 57d004d
feat(server): refactor detach command to use flags instead of positio…
s-inter 902777c
fix(server): fix unused-parameter linter warning, update parseInput f…
s-inter a107df6
feat(server): add documentation for security group attach and detach …
s-inter d8f2ec2
fix(server): security group attach/detach now correctly print to stdout
s-inter b14bc5c
refactor(server): simplify TestParseInput by using testutils helper f…
s-inter acb8d91
Merge remote-tracking branch 'origin/main' into feat/server-security-…
s-inter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package attach | ||
|
|
||
| import ( | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/types" | ||
| ) | ||
|
|
||
| func NewCmd(params *types.CmdParams) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "attach", | ||
| Short: "Attach a security group to a server", | ||
| Long: "Attach a security group to a server.", | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| params.Printer.Info("Attaching security group to server...") | ||
| }, | ||
| } | ||
| return cmd | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| package attach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package detach | ||
|
|
||
| import ( | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/types" | ||
| ) | ||
|
|
||
| func NewCmd(params *types.CmdParams) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "detach", | ||
| Short: "Detach a security group from a server", | ||
| Long: "Detach a security group from a server.", | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| params.Printer.Info("Detaching security group from server...") | ||
| }, | ||
| } | ||
| return cmd | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| package detach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package securitygroup | ||
|
|
||
| import ( | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/server/security-group/attach" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/server/security-group/detach" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/types" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func NewCmd(params *types.CmdParams) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "security-group", | ||
| Short: "Allows attaching/detaching security groups to servers", | ||
| Long: "Allows attaching/detaching security groups to servers.", | ||
| Args: args.NoArgs, | ||
| Run: utils.CmdHelp, | ||
| } | ||
| addSubcommands(cmd, params) | ||
| return cmd | ||
| } | ||
|
|
||
| func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { | ||
| cmd.AddCommand(attach.NewCmd(params)) | ||
| cmd.AddCommand(detach.NewCmd(params)) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.