Skip to content

Commit 40d79fb

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/STACKITCLI-338-Add-kms-key-options-to-secrets-manager-instance-commands
2 parents f674659 + 36fff24 commit 40d79fb

40 files changed

+968
-272
lines changed

docs/stackit_server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ stackit server [flags]
4646
* [stackit server reboot](./stackit_server_reboot.md) - Reboots a server
4747
* [stackit server rescue](./stackit_server_rescue.md) - Rescues an existing server
4848
* [stackit server resize](./stackit_server_resize.md) - Resizes the server to the given machine type
49+
* [stackit server security-group](./stackit_server_security-group.md) - Allows attaching/detaching security groups to servers
4950
* [stackit server service-account](./stackit_server_service-account.md) - Allows attaching/detaching service accounts to servers
5051
* [stackit server start](./stackit_server_start.md) - Starts an existing server or allocates the server if deallocated
5152
* [stackit server stop](./stackit_server_stop.md) - Stops an existing server
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## stackit server security-group
2+
3+
Allows attaching/detaching security groups to servers
4+
5+
### Synopsis
6+
7+
Allows attaching/detaching security groups to servers.
8+
9+
```
10+
stackit server security-group [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit server security-group"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
25+
-p, --project-id string Project ID
26+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit server](./stackit_server.md) - Provides functionality for servers
33+
* [stackit server security-group attach](./stackit_server_security-group_attach.md) - Attaches a security group to a server
34+
* [stackit server security-group detach](./stackit_server_security-group_detach.md) - Detaches a security group from a server
35+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## stackit server security-group attach
2+
3+
Attaches a security group to a server
4+
5+
### Synopsis
6+
7+
Attaches a security group to a server.
8+
9+
```
10+
stackit server security-group attach [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Attach a security group with ID "xxx" to a server with ID "yyy"
17+
$ stackit server security-group attach --server-id yyy --security-group-id xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit server security-group attach"
24+
--security-group-id string Security Group ID
25+
--server-id string Server ID
26+
```
27+
28+
### Options inherited from parent commands
29+
30+
```
31+
-y, --assume-yes If set, skips all confirmation prompts
32+
--async If set, runs the command asynchronously
33+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
34+
-p, --project-id string Project ID
35+
--region string Target region for region-specific requests
36+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
37+
```
38+
39+
### SEE ALSO
40+
41+
* [stackit server security-group](./stackit_server_security-group.md) - Allows attaching/detaching security groups to servers
42+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## stackit server security-group detach
2+
3+
Detaches a security group from a server
4+
5+
### Synopsis
6+
7+
Detaches a security group from a server.
8+
9+
```
10+
stackit server security-group detach [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Detach a security group with ID "xxx" from a server with ID "yyy"
17+
$ stackit server security-group detach --server-id yyy --security-group-id xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit server security-group detach"
24+
--security-group-id string Security Group ID
25+
--server-id string Server ID
26+
```
27+
28+
### Options inherited from parent commands
29+
30+
```
31+
-y, --assume-yes If set, skips all confirmation prompts
32+
--async If set, runs the command asynchronously
33+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
34+
-p, --project-id string Project ID
35+
--region string Target region for region-specific requests
36+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
37+
```
38+
39+
### SEE ALSO
40+
41+
* [stackit server security-group](./stackit_server_security-group.md) - Allows attaching/detaching security groups to servers
42+

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/spf13/cobra v1.10.2
1616
github.com/spf13/pflag v1.0.10
1717
github.com/spf13/viper v1.21.0
18-
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
18+
github.com/stackitcloud/stackit-sdk-go/core v0.23.0
1919
github.com/stackitcloud/stackit-sdk-go/services/alb v0.10.0
2020
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.12.0
2121
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.10.0
@@ -269,7 +269,7 @@ require (
269269
github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.8.0
270270
github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.6
271271
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.6
272-
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5
272+
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.7.0
273273
github.com/stackitcloud/stackit-sdk-go/services/observability v0.17.0
274274
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.26.0
275275
github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.6

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
596596
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
597597
github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0=
598598
github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I=
599-
github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c=
600-
github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
599+
github.com/stackitcloud/stackit-sdk-go/core v0.23.0 h1:zPrOhf3Xe47rKRs1fg/AqKYUiJJRYjdcv+3qsS50mEs=
600+
github.com/stackitcloud/stackit-sdk-go/core v0.23.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
601601
github.com/stackitcloud/stackit-sdk-go/services/alb v0.10.0 h1:V9+885qkSv621rZZatg1YE5ENM1ElALxQDJsh+hDIUg=
602602
github.com/stackitcloud/stackit-sdk-go/services/alb v0.10.0/go.mod h1:V6+MolxM/M2FWyWZA+FRFKEzzUe10MU9eEVfMvxHGi8=
603603
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.12.0 h1:HxPgBu04j5tj6nfZ2r0l6v4VXC0/tYOGe4sA5Addra8=
@@ -626,8 +626,8 @@ github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.6 h1:Y/byRjX2u/OZl
626626
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.6/go.mod h1:sY66ZgCgBc1mScPV95ek5WtUEGYizdP1RMsGaqbdbhw=
627627
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8 h1:S7t4wcT6SN8ZzdoY8d6VbF903zFpGjzqrU0FN27rJPg=
628628
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8/go.mod h1:CdrhFUsBO7/iJleCc2yQjDChIbG6YaxKNBQRNCjgcF4=
629-
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5 h1:4gpvB6t7d2lLjInoTxcvjL9jCpBl5EDfYe5yUtR1MvA=
630-
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5/go.mod h1:Bdcd59sRySyhfSUCy+5BNkp5w9PECmrywdvt+ORMKnI=
629+
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.7.0 h1:UxnbsKm6PQV8Gudw/EhySaEh9q1xSaTG8mzJz1EvhnE=
630+
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.7.0/go.mod h1:RFL4h6JZvpsyFYbdJ3+eINEkletzJQTfrPdd+yPT/fU=
631631
github.com/stackitcloud/stackit-sdk-go/services/observability v0.17.0 h1:LGwCvvST0fwUgZ6bOxYIfu45qqTgv421ZS07UhKjZL8=
632632
github.com/stackitcloud/stackit-sdk-go/services/observability v0.17.0/go.mod h1:9KdrXC5JS30Ay3mR0adb3vNdhca+qxiy/cPF5P4wehQ=
633633
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.6 h1:oTVx1+O177Ojn8OvXIOUbRSwtx7L59jhxDPrZEQFOfQ=

internal/cmd/object-storage/bucket/create/create.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
"github.com/stackitcloud/stackit-cli/internal/pkg/spinner"
1717

1818
"github.com/spf13/cobra"
19-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
20-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage/wait"
19+
objectstorage "github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api"
20+
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api/wait"
2121
)
2222

2323
const (
@@ -60,7 +60,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6060
}
6161

6262
// Check if the project is enabled before trying to create
63-
enabled, err := utils.ProjectEnabled(ctx, apiClient, model.ProjectId, model.Region)
63+
enabled, err := utils.ProjectEnabled(ctx, apiClient.DefaultAPI, model.ProjectId, model.Region)
6464
if err != nil {
6565
return fmt.Errorf("check if Object Storage is enabled: %w", err)
6666
}
@@ -81,7 +81,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
8181
if !model.Async {
8282
s := spinner.New(params.Printer)
8383
s.Start("Creating bucket")
84-
_, err = wait.CreateBucketWaitHandler(ctx, apiClient, model.ProjectId, model.Region, model.BucketName).WaitWithContext(ctx)
84+
_, err = wait.CreateBucketWaitHandler(ctx, apiClient.DefaultAPI, model.ProjectId, model.Region, model.BucketName).WaitWithContext(ctx)
8585
if err != nil {
8686
return fmt.Errorf("wait for Object Storage bucket creation: %w", err)
8787
}
@@ -112,7 +112,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
112112
}
113113

114114
func buildRequest(ctx context.Context, model *inputModel, apiClient *objectstorage.APIClient) objectstorage.ApiCreateBucketRequest {
115-
req := apiClient.CreateBucket(ctx, model.ProjectId, model.Region, model.BucketName)
115+
req := apiClient.DefaultAPI.CreateBucket(ctx, model.ProjectId, model.Region, model.BucketName)
116116
return req
117117
}
118118

internal/cmd/object-storage/bucket/create/create_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
"github.com/google/go-cmp/cmp"
1414
"github.com/google/go-cmp/cmp/cmpopts"
1515
"github.com/google/uuid"
16-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
16+
objectstorage "github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api"
1717
)
1818

1919
type testCtxKey struct{}
2020

2121
var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo")
22-
var testClient = &objectstorage.APIClient{}
22+
var testClient = &objectstorage.APIClient{DefaultAPI: &objectstorage.DefaultAPIService{}}
2323
var testProjectId = uuid.NewString()
2424

2525
const (
@@ -64,7 +64,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
6464
}
6565

6666
func fixtureRequest(mods ...func(request *objectstorage.ApiCreateBucketRequest)) objectstorage.ApiCreateBucketRequest {
67-
request := testClient.CreateBucket(testCtx, testProjectId, testRegion, testBucketName)
67+
request := testClient.DefaultAPI.CreateBucket(testCtx, testProjectId, testRegion, testBucketName)
6868
for _, mod := range mods {
6969
mod(&request)
7070
}
@@ -161,7 +161,7 @@ func TestBuildRequest(t *testing.T) {
161161
request := buildRequest(testCtx, tt.model, testClient)
162162

163163
diff := cmp.Diff(request, tt.expectedRequest,
164-
cmp.AllowUnexported(tt.expectedRequest),
164+
cmp.AllowUnexported(tt.expectedRequest, objectstorage.DefaultAPIService{}),
165165
cmpopts.EquateComparable(testCtx),
166166
)
167167
if diff != "" {

internal/cmd/object-storage/bucket/delete/delete.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"github.com/stackitcloud/stackit-cli/internal/pkg/spinner"
1616

1717
"github.com/spf13/cobra"
18-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
19-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage/wait"
18+
objectstorage "github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api"
19+
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api/wait"
2020
)
2121

2222
const (
@@ -69,7 +69,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6969
if !model.Async {
7070
s := spinner.New(params.Printer)
7171
s.Start("Deleting bucket")
72-
_, err = wait.DeleteBucketWaitHandler(ctx, apiClient, model.ProjectId, model.Region, model.BucketName).WaitWithContext(ctx)
72+
_, err = wait.DeleteBucketWaitHandler(ctx, apiClient.DefaultAPI, model.ProjectId, model.Region, model.BucketName).WaitWithContext(ctx)
7373
if err != nil {
7474
return fmt.Errorf("wait for Object Storage bucket deletion: %w", err)
7575
}
@@ -105,6 +105,6 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
105105
}
106106

107107
func buildRequest(ctx context.Context, model *inputModel, apiClient *objectstorage.APIClient) objectstorage.ApiDeleteBucketRequest {
108-
req := apiClient.DeleteBucket(ctx, model.ProjectId, model.Region, model.BucketName)
108+
req := apiClient.DefaultAPI.DeleteBucket(ctx, model.ProjectId, model.Region, model.BucketName)
109109
return req
110110
}

internal/cmd/object-storage/bucket/delete/delete_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import (
1010
"github.com/google/go-cmp/cmp"
1111
"github.com/google/go-cmp/cmp/cmpopts"
1212
"github.com/google/uuid"
13-
"github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
13+
objectstorage "github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api"
1414
)
1515

1616
type testCtxKey struct{}
1717

1818
var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo")
19-
var testClient = &objectstorage.APIClient{}
19+
var testClient = &objectstorage.APIClient{DefaultAPI: &objectstorage.DefaultAPIService{}}
2020
var testProjectId = uuid.NewString()
2121

2222
const (
@@ -61,7 +61,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
6161
}
6262

6363
func fixtureRequest(mods ...func(request *objectstorage.ApiDeleteBucketRequest)) objectstorage.ApiDeleteBucketRequest {
64-
request := testClient.DeleteBucket(testCtx, testProjectId, testRegion, testBucketName)
64+
request := testClient.DefaultAPI.DeleteBucket(testCtx, testProjectId, testRegion, testBucketName)
6565
for _, mod := range mods {
6666
mod(&request)
6767
}
@@ -158,7 +158,7 @@ func TestBuildRequest(t *testing.T) {
158158
request := buildRequest(testCtx, tt.model, testClient)
159159

160160
diff := cmp.Diff(request, tt.expectedRequest,
161-
cmp.AllowUnexported(tt.expectedRequest),
161+
cmp.AllowUnexported(tt.expectedRequest, objectstorage.DefaultAPIService{}),
162162
cmpopts.EquateComparable(testCtx),
163163
)
164164
if diff != "" {

0 commit comments

Comments
 (0)