Skip to content

Commit 0ad6788

Browse files
feat(observability): add multi API version support (#5839)
relates to STACKITSDK-346 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent d237131 commit 0ad6788

File tree

359 files changed

+79993
-209
lines changed

Some content is hidden

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

359 files changed

+79993
-209
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@
212212
- `v2api`: New package which can be used for communication with the objectstorage v2 API
213213
- **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.
214214
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
215+
- `observability`: [v0.18.0](services/observability/CHANGELOG.md#v0180)
216+
- **Feature:** Introduction of multi API version support for the observability SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
217+
- `v1api`: New package which should be used for communication with the STACKIT observability API in the future
218+
- **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 `v1api` package instead.
219+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
215220

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

examples/observability/go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
module github.com/stackitcloud/stackit-sdk-go/examples/argus
1+
module github.com/stackitcloud/stackit-sdk-go/examples/observability
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/observability => ../../services/observability
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/observability v0.17.0
811
)
912

examples/observability/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/observability v0.17.0 h1:LGwCvvST0fwUgZ6bOxYIfu45qqTgv421ZS07UhKjZL8=
10-
github.com/stackitcloud/stackit-sdk-go/services/observability v0.17.0/go.mod h1:9KdrXC5JS30Ay3mR0adb3vNdhca+qxiy/cPF5P4wehQ=
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/observability/observability.go

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

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

1313
func main() {
@@ -23,25 +23,25 @@ func main() {
2323
}
2424

2525
// Get the observability instances for your project
26-
getInstanceResp, err := observabilityClient.ListInstances(context.Background(), projectId).Execute()
26+
getInstanceResp, err := observabilityClient.DefaultAPI.ListInstances(context.Background(), projectId).Execute()
2727

2828
if err != nil {
2929
fmt.Fprintf(os.Stderr, "[Observability API] Error when calling `GetInstances`: %v\n", err)
3030
} else {
31-
fmt.Printf("[Observability API] Number of instances: %v\n", len(*getInstanceResp.Instances))
31+
fmt.Printf("[Observability API] Number of instances: %v\n", len(getInstanceResp.Instances))
3232
}
3333

3434
// Create an observability instance
3535
createInstancePayload := observability.CreateInstancePayload{
3636
Name: utils.Ptr("myInstance"),
37-
PlanId: utils.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
37+
PlanId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
3838
}
3939

40-
createInstanceResp, err := observabilityClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute()
40+
createInstanceResp, err := observabilityClient.DefaultAPI.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute()
4141
if err != nil {
4242
fmt.Fprintf(os.Stderr, "[Observability API] Error when calling `CreateInstance`: %v\n", err)
4343
os.Exit(1)
4444
}
4545

46-
fmt.Printf("[Observability API] Created instance with id \"%s\" and dashboard url \"%s\".\n", *createInstanceResp.InstanceId, *createInstanceResp.DashboardUrl)
46+
fmt.Printf("[Observability API] Created instance with id \"%s\" and dashboard url \"%s\".\n", createInstanceResp.InstanceId, createInstanceResp.DashboardUrl)
4747
}

services/observability/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.18.0
2+
- **Feature:** Introduction of multi API version support for the observability 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 should be used for communication with the STACKIT observability API in the future
4+
- **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 `v1api` package instead.
5+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
6+
17
## v0.17.0
28
- **Feature:** add AlertRecord
39
- new related operations: `CreateAlertRecord`, `DeleteAlertRecord`, `DeleteAlertRecords`, `GetAlertRecord`, `ListAlertRecords`, `PartialUpdateAlertRecords`, `UpdateAlertRecord`

services/observability/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.17.0
1+
v0.18.0

0 commit comments

Comments
 (0)