Skip to content

Commit 37812eb

Browse files
feat(dns): add multi API version support (#5430)
relates to STACKITSDK-333 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent d58c621 commit 37812eb

File tree

111 files changed

+19318
-250
lines changed

Some content is hidden

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

111 files changed

+19318
-250
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
- `v2api`: New package which can be used for communication with the ske v2 API
5757
- **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.
5858
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
59+
- `dns`: [v0.18.0](services/dns/CHANGELOG.md#v0180)
60+
- **Feature:** Introduction of multi API version support for the dns SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
61+
- `v1api`: New package which should be used for communication with the STACKIT dns API in the future
62+
- **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 `v0api` package instead.
63+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
5964

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

examples/authentication/authentication.go

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

88
"github.com/stackitcloud/stackit-sdk-go/core/config"
9-
"github.com/stackitcloud/stackit-sdk-go/services/dns"
9+
dns "github.com/stackitcloud/stackit-sdk-go/services/dns/v1api"
1010
)
1111

1212
func main() {
@@ -55,11 +55,11 @@ func main() {
5555
}
5656

5757
// Check that you can make an authenticated request
58-
getZoneResp, err := dnsClient.ListZones(context.Background(), projectId).Execute()
58+
getZoneResp, err := dnsClient.DefaultAPI.ListZones(context.Background(), projectId).Execute()
5959

6060
if err != nil {
6161
fmt.Fprintf(os.Stderr, "[DNS API] Error when calling `ZoneApi.GetZones`: %v\n", err)
6262
} else {
63-
fmt.Printf("[DNS API] Number of zones: %v\n", len(*getZoneResp.Zones))
63+
fmt.Printf("[DNS API] Number of zones: %v\n", len(getZoneResp.Zones))
6464
}
6565
}

examples/authentication/go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/authentication
22

33
go 1.21
44

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/dns => ../../services/dns
7+
58
require (
6-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
9+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
710
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6
811
)
912

examples/authentication/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/dns v0.17.6 h1:GBRb49x5Nax/oQQaaf2F3kKwv8DQQOL0TQOC0C/v/Ew=
10-
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6/go.mod h1:IX9iL3MigDZUmzwswTJMfYvyi118KAHrFMfjJUy5NYk=
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/backgroundrefresh/backgroundrefresh.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"time"
88

99
"github.com/stackitcloud/stackit-sdk-go/core/config"
10-
"github.com/stackitcloud/stackit-sdk-go/services/dns"
10+
dns "github.com/stackitcloud/stackit-sdk-go/services/dns/v1api"
1111
)
1212

1313
func main() {
@@ -31,11 +31,11 @@ func main() {
3131
// Use this for long-running operations (hours)
3232
for i := 0; i < 10; i++ {
3333
// Get the DNS zones for your project
34-
getZoneResp, err := dnsClient.ListZones(context.Background(), projectId).Execute()
34+
getZoneResp, err := dnsClient.DefaultAPI.ListZones(context.Background(), projectId).Execute()
3535
if err != nil {
3636
fmt.Fprintf(os.Stderr, "Error when calling `ListZones`: %v\n", err)
3737
}
38-
fmt.Printf("Number of DNS zones: %v\n", len(*getZoneResp.Zones))
38+
fmt.Printf("Number of DNS zones: %v\n", len(getZoneResp.Zones))
3939

4040
time.Sleep(time.Hour)
4141
}

examples/backgroundrefresh/go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/backgroundrefresh
22

33
go 1.21
44

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/dns => ../../services/dns
7+
58
require (
6-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
9+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
710
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6
811
)
912

examples/backgroundrefresh/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/dns v0.17.6 h1:GBRb49x5Nax/oQQaaf2F3kKwv8DQQOL0TQOC0C/v/Ew=
10-
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6/go.mod h1:IX9iL3MigDZUmzwswTJMfYvyi118KAHrFMfjJUy5NYk=
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/configuration/configuration.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"time"
88

99
"github.com/stackitcloud/stackit-sdk-go/core/config"
10-
"github.com/stackitcloud/stackit-sdk-go/services/dns"
10+
dns "github.com/stackitcloud/stackit-sdk-go/services/dns/v1api"
1111
"github.com/stackitcloud/stackit-sdk-go/services/postgresql"
1212
)
1313

@@ -43,9 +43,7 @@ func main() {
4343
}
4444

4545
// Create a new API client for a regional API
46-
_, err = postgresql.NewAPIClient(
47-
config.WithRegion("eu01"),
48-
)
46+
_, err = postgresql.NewAPIClient()
4947
if err != nil {
5048
fmt.Fprintf(os.Stderr, "[PostgreSQL API] Creating API client: %v\n", err)
5149
os.Exit(1)

examples/configuration/go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/configuration
22

33
go 1.21
44

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/dns => ../../services/dns
7+
58
require (
6-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
9+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0
710
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6
811
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.1
912
)

examples/configuration/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ 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/dns v0.17.6 h1:GBRb49x5Nax/oQQaaf2F3kKwv8DQQOL0TQOC0C/v/Ew=
10-
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6/go.mod h1:IX9iL3MigDZUmzwswTJMfYvyi118KAHrFMfjJUy5NYk=
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=
119
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.1 h1:u2jNFPPLM2TlpM1qUu1UuG9XKx/EYPjwg2nJqAK1HUY=
1210
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.1/go.mod h1:rTbdB/rl+e9o9sJNrT3yMIaSNVBGqR5G2Vh4opKrEwo=

0 commit comments

Comments
 (0)