Skip to content

Commit aa6a459

Browse files
feat(sqlserverflex): add multi API version support (#5169)
relates to STACKITSDK-361 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent 7aa7243 commit aa6a459

File tree

350 files changed

+81436
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+81436
-73
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
- `v1api`: New package which can be used for communication with the logs v1 API
2222
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
2323
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
24+
- `sqlserverflex`: [v1.5.0](services/sqlserverflex/CHANGELOG.md#v150)
25+
- **Feature:** Introduction of multi API version support for the sqlserverflex SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
26+
- `v1api`: New package which can be used for communication with the sqlserverflex v1 API
27+
- `v2api`: New package which can be used for communication with the sqlserverflex v1 API
28+
- `v3alpha1api`: New package which can be used for communication with the sqlserverflex v3 alpha1 API
29+
- `v3beta1api`: New package which can be used for communication with the sqlserverflex v3 beta1 API
30+
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
31+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
2432

2533
## Release (2026-02-20)
2634
- `core`: [v0.21.1](core/CHANGELOG.md#v0211)

examples/sqlserverflex/go.mod

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ module github.com/stackitcloud/stackit-sdk-go/examples/sqlserverflex
22

33
go 1.21
44

5-
require github.com/stackitcloud/stackit-sdk-go/core v0.21.1
5+
// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub.
6+
replace github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex => ../../services/sqlserverflex
7+
8+
require (
9+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
10+
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.4.3
11+
)
612

713
require (
814
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
915
github.com/google/uuid v1.6.0 // indirect
10-
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.4.3
1116
)

examples/sqlserverflex/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
44
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
55
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
66
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts=
8-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
9-
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.4.3 h1:AQrcr+qeIuZob+3TT2q1L4WOPtpsu5SEpkTnOUHDqfE=
10-
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.4.3/go.mod h1:8BBGC69WFXWWmKgzSjgE4HvsI7pEgO0RN2cASwuPJ18=
7+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c=
8+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=

examples/sqlserverflex/sqlserverflex.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"os"
77

88
"github.com/stackitcloud/stackit-sdk-go/core/utils"
9-
"github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex"
10-
"github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex/wait"
9+
sqlserverflex "github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex/v2api"
10+
"github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex/v2api/wait"
1111
)
1212

1313
func main() {
@@ -30,41 +30,41 @@ func main() {
3030
}
3131

3232
// Get the SQLServer Flex instances for your project
33-
getInstancesResp, err := sqlserverflexClient.ListInstances(ctx, projectId, region).Execute()
33+
getInstancesResp, err := sqlserverflexClient.DefaultAPI.ListInstances(ctx, projectId, region).Execute()
3434
if err != nil {
3535
fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err)
3636
os.Exit(1)
3737
}
38-
items := *getInstancesResp.Items
38+
items := getInstancesResp.Items
3939
fmt.Printf("Number of instances: %v\n", len(items))
4040

4141
// Create an instance
4242
createInstancePayload := sqlserverflex.CreateInstancePayload{
43-
Name: utils.Ptr("my-instance"),
44-
FlavorId: utils.Ptr(flavorId),
43+
Name: "my-instance",
44+
FlavorId: flavorId,
4545
Version: utils.Ptr(version),
4646
}
47-
instance, err := sqlserverflexClient.CreateInstance(ctx, projectId, region).CreateInstancePayload(createInstancePayload).Execute()
47+
instance, err := sqlserverflexClient.DefaultAPI.CreateInstance(ctx, projectId, region).CreateInstancePayload(createInstancePayload).Execute()
4848
if err != nil {
4949
fmt.Fprintf(os.Stderr, "Error creating SQL Server Flex instance: %v\n", err)
5050
}
5151
instanceId := *instance.Id
5252

53-
_, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId, region).WaitWithContext(ctx)
53+
_, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, region).WaitWithContext(ctx)
5454
if err != nil {
5555
fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance creation: %v\n", err)
5656
}
5757

5858
fmt.Printf("Created SQL Server Flex instance \"%s\".\n", instanceId)
5959

6060
// Delete an instance
61-
err = sqlserverflexClient.DeleteInstance(ctx, projectId, instanceId, region).Execute()
61+
err = sqlserverflexClient.DefaultAPI.DeleteInstance(ctx, projectId, instanceId, region).Execute()
6262

6363
if err != nil {
6464
fmt.Fprintf(os.Stderr, "Error deleting SQL Server Flex instance: %v\n", err)
6565
}
6666

67-
_, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId, region).WaitWithContext(ctx)
67+
_, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, region).WaitWithContext(ctx)
6868
if err != nil {
6969
fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance deletion: %v\n", err)
7070
}

services/sqlserverflex/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v1.5.0
2+
- **Feature:** Introduction of multi API version support for the sqlserverflex SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
3+
- `v1api`: New package which can be used for communication with the sqlserverflex v1 API
4+
- `v2api`: New package which can be used for communication with the sqlserverflex v1 API
5+
- `v3alpha1api`: New package which can be used for communication with the sqlserverflex v3 alpha1 API
6+
- `v3beta1api`: New package which can be used for communication with the sqlserverflex v3 beta1 API
7+
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
8+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
9+
110
## v1.4.3
211
- Bump STACKIT SDK core module from `v0.21.0` to `v0.21.1`
312

services/sqlserverflex/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.4.3
1+
v1.5.0

0 commit comments

Comments
 (0)