Skip to content

Commit 69748b9

Browse files
feat(auditlog): add multi API version support (#5498)
relates to STACKITSDK-329 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent df2735d commit 69748b9

Some content is hidden

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

43 files changed

+5078
-52
lines changed

CHANGELOG.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
- `dns`: [v0.18.0](services/dns/CHANGELOG.md#v0180)
7474
- **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
7575
- `v1api`: New package which should be used for communication with the STACKIT dns API in the future
76-
- **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.
76+
- **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.
7777
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
7878
- `intake`: [v0.5.0](services/intake/CHANGELOG.md#v050)
7979
- **Feature:** Introduction of multi API version support for the intake SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
@@ -90,22 +90,22 @@
9090
- `logme`: [v0.26.0](services/logme/CHANGELOG.md#v0260)
9191
- **Feature:** Introduction of multi API version support for the logme SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
9292
- `v1api`: New package which should be used for communication with the STACKIT logme API in the future
93-
- **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.
93+
- **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.
9494
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
9595
- `modelserving`: [v0.7.0](services/modelserving/CHANGELOG.md#v070)
9696
- **Feature:** Introduction of multi API version support for the modelserving SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
9797
- `v1api`: New package which should be used for communication with the STACKIT modelserving API in the future
98-
- **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.
98+
- **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.
9999
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
100100
- `rabbitmq`: [v0.27.0](services/rabbitmq/CHANGELOG.md#v0270)
101101
- **Feature:** Introduction of multi API version support for the rabbitmq SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
102102
- `v1api`: New package which should be used for communication with the STACKIT rabbitmq API in the future
103-
- **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.
103+
- **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.
104104
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
105105
- `redis`: [v0.26.0](services/redis/CHANGELOG.md#v0260)
106106
- **Feature:** Introduction of multi API version support for the redis SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
107107
- `v1api`: New package which should be used for communication with the STACKIT redis API in the future
108-
- **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.
108+
- **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.
109109
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
110110
- `kms`: [v1.4.0](services/kms/CHANGELOG.md#v140)
111111
- **Feature:** Introduction of multi API version support for the kms SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
@@ -116,7 +116,7 @@
116116
- `mariadb`: [v0.26.0](services/mariadb/CHANGELOG.md#v0260)
117117
- **Feature:** Introduction of multi API version support for the mariadb SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
118118
- `v1api`: New package which should be used for communication with the STACKIT mariadb API in the future
119-
- **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.
119+
- **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.
120120
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
121121
- `authorization`: [v0.13.0](services/authorization/CHANGELOG.md#v0130)
122122
- **Feature:** Introduction of multi API version support for the authorization SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
@@ -128,6 +128,11 @@
128128
- `v1api`: New package which should be used for communication with the STACKIT opensearch API in the future
129129
- **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.
130130
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
131+
- `auditlog`: [v0.2.0](services/auditlog/CHANGELOG.md#v020)
132+
- **Feature:** Introduction of multi API version support for the auditlog SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
133+
- `v2api`: New package which should be used for communication with the STACKIT auditlog API in the future
134+
- **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 `v2api` package instead.
135+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
131136

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

examples/auditlog/auditlog.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"time"
1010

1111
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
12-
"github.com/stackitcloud/stackit-sdk-go/services/auditlog"
12+
auditlog "github.com/stackitcloud/stackit-sdk-go/services/auditlog/v2api"
1313
)
1414

1515
func main() {
@@ -26,7 +26,7 @@ func main() {
2626
}
2727

2828
// List all audit logs of a project
29-
listProjectLogsReq := auditlogClient.ListProjectAuditLogEntries(context.Background(), projectId).
29+
listProjectLogsReq := auditlogClient.DefaultAPI.ListProjectAuditLogEntries(context.Background(), projectId).
3030
StartTimeRange(startTime).
3131
EndTimeRange(endTime).
3232
Limit(limit)
@@ -54,12 +54,12 @@ func main() {
5454
os.Exit(1)
5555
}
5656
// Break loop when response has no items
57-
if result == nil || result.Items == nil || len(*result.Items) == 0 {
57+
if result == nil || result.Items == nil || len(result.Items) == 0 {
5858
break
5959
}
6060

6161
// Append items to allItems
62-
allItems = append(allItems, *result.Items...)
62+
allItems = append(allItems, result.Items...)
6363

6464
// If cursor is not set, end of logs is reached
6565
if result.Cursor == nil {

examples/auditlog/go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module auditlog
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/auditlog => ../../services/auditlog
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/auditlog v0.1.5
811
)
912

examples/auditlog/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/auditlog v0.1.5 h1:sxky48lXBtdq6nKH6OyrMSG3JeYb69eXoP6rAQyH+Gs=
10-
github.com/stackitcloud/stackit-sdk-go/services/auditlog v0.1.5/go.mod h1:zHZ0kX8YE235wwKo9xGFUGmv4WhMvVHPdu2Cc+g7m90=
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=

services/auditlog/CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0
2+
- **Feature:** Introduction of multi API version support for the auditlog SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
3+
- `v2api`: New package which should be used for communication with the STACKIT auditlog 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 `v2api` package instead.
5+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
6+
17
## v0.1.5
28
- Bump STACKIT SDK core module from `v0.21.0` to `v0.21.1`
39

@@ -9,11 +15,10 @@
915
- Bump STACKIT SDK core module from `v0.20.1` to `v0.21.0`
1016

1117
## v0.1.2
12-
- Bump STACKIT SDK core module from `v0.20.0` to `v0.20.1`
18+
- Bump STACKIT SDK core module from `v0.20.0` to `v0.20.1`
1319

1420
## v0.1.1
15-
- Bump STACKIT SDK core module from `v0.19.0` to `v0.20.0`
21+
- Bump STACKIT SDK core module from `v0.19.0` to `v0.20.0`
1622

1723
## v0.1.0
18-
19-
- **New**: STACKIT Audit Log module for retrieving recorded actions and system changes. Download audit log entries for folders, organizations, and projects with time range filtering, pagination, and configurable result limits.
24+
- **New**: STACKIT Audit Log module for retrieving recorded actions and system changes. Download audit log entries for folders, organizations, and projects with time range filtering, pagination, and configurable result limits.

services/auditlog/VERSION

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

0 commit comments

Comments
 (0)