From 2ac593696a2e8669894ccb8f7bb80a5e903106d4 Mon Sep 17 00:00:00 2001 From: Toni Kangas Date: Fri, 2 Oct 2026 13:01:00 +0300 Subject: [PATCH 1/3] fix(dbaas): add missing fields to clone database method --- CHANGELOG.md | 4 ++++ upcloud/request/managed_database.go | 16 ++++++++++------ upcloud/request/managed_database_test.go | 16 ++++++++++++---- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d7d7c3..e202288a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +### Added + +- managed database: add `AdditionalDiskSpaceGiB`, `Labels`, `Networks`, and `TerminationProtection` to `request.CloneManagedDatabaseRequest` + ## [8.42.0] ### Added diff --git a/upcloud/request/managed_database.go b/upcloud/request/managed_database.go index 1db45e72..b615dd06 100644 --- a/upcloud/request/managed_database.go +++ b/upcloud/request/managed_database.go @@ -34,6 +34,7 @@ func (c *CancelManagedDatabaseSession) RequestURL() string { // CloneManagedDatabaseRequest represents a request to cancel type CloneManagedDatabaseRequest struct { + AdditionalDiskSpaceGiB int `json:"additional_disk_space_gib,omitempty"` // UUID selects an existing managed database instance to clone UUID string `json:"-"` // CloneTime selects a point-in-time from where to clone the data. Zero value selects the most recent available. @@ -42,12 +43,15 @@ type CloneManagedDatabaseRequest struct { // Only for Valkey. Create a clone of your database service data from the backups by name. BackupName string `json:"backup_name,omitempty"` - HostNamePrefix string `json:"hostname_prefix"` - Maintenance ManagedDatabaseMaintenanceTimeRequest `json:"maintenance,omitempty"` - Plan string `json:"plan"` - Properties ManagedDatabasePropertiesRequest `json:"properties,omitempty"` - Title string `json:"title,omitempty"` - Zone string `json:"zone"` + HostNamePrefix string `json:"hostname_prefix"` + Labels []upcloud.Label `json:"labels,omitempty"` + Maintenance ManagedDatabaseMaintenanceTimeRequest `json:"maintenance,omitempty"` + Networks []upcloud.ManagedDatabaseNetwork `json:"networks,omitempty"` + Plan string `json:"plan"` + Properties ManagedDatabasePropertiesRequest `json:"properties,omitempty"` + Title string `json:"title,omitempty"` + TerminationProtection *bool `json:"termination_protection,omitempty"` + Zone string `json:"zone"` } // MarshalJSON implements json.Marshaler diff --git a/upcloud/request/managed_database_test.go b/upcloud/request/managed_database_test.go index 7edaf6dd..984fdb6c 100644 --- a/upcloud/request/managed_database_test.go +++ b/upcloud/request/managed_database_test.go @@ -30,10 +30,14 @@ func TestCloneManagedDatabaseRequest_MarshalJSON(t *testing.T) { }) req := CloneManagedDatabaseRequest{ - UUID: "fakeuuid", - CloneTime: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), - HostNamePrefix: "fakename", - BackupName: "backup name", + AdditionalDiskSpaceGiB: 20, + UUID: "fakeuuid", + CloneTime: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + HostNamePrefix: "fakename", + BackupName: "backup name", + Labels: []upcloud.Label{{Key: "env", Value: "test"}}, + Networks: []upcloud.ManagedDatabaseNetwork{{Family: "IPv4", Name: "private", Type: "private"}}, + TerminationProtection: upcloud.BoolPtr(false), Maintenance: ManagedDatabaseMaintenanceTimeRequest{ DayOfWeek: "monday", Time: "12:00:00", @@ -48,12 +52,16 @@ func TestCloneManagedDatabaseRequest_MarshalJSON(t *testing.T) { const expect = `{ "hostname_prefix": "fakename", + "additional_disk_space_gib": 20, "plan": "fakeplan", "backup_name": "backup name", + "labels": [{"key": "env", "value": "test"}], + "networks": [{"family": "IPv4", "name": "private", "type": "private"}], "properties": { "fakeprop": "fakevalue" }, "title": "faketitle", + "termination_protection": false, "zone": "fakezone", "clone_time": "2021-01-01T00:00:00Z", "maintenance": { From 2026356520a5029ee99ce3e34c668423589ba9f6 Mon Sep 17 00:00:00 2001 From: Toni Kangas Date: Fri, 2 Oct 2026 13:02:39 +0300 Subject: [PATCH 2/3] chore: prepare release v8.42.1 --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e202288a..85baac6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +## [8.42.1] + ### Added - managed database: add `AdditionalDiskSpaceGiB`, `Labels`, `Networks`, and `TerminationProtection` to `request.CloneManagedDatabaseRequest` @@ -813,7 +815,8 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/) First stable release -[Unreleased]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.42.0...HEAD +[Unreleased]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.42.1...HEAD +[8.42.1]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.42.0...v8.42.1 [8.42.0]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.41.0...v8.42.0 [8.41.0]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.40.0...v8.41.0 [8.40.0]: https://github.com/UpCloudLtd/upcloud-go-api/compare/v8.39.0...v8.40.0 From 45899af0b3a3fe0fc034d94b3bd1614acf848330 Mon Sep 17 00:00:00 2001 From: kangasta <6261016+kangasta@users.noreply.github.com> Date: Fri, 2 Oct 2026 10:03:52 +0000 Subject: [PATCH 3/3] chore: update version in `User-Agent` --- upcloud/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upcloud/client/client.go b/upcloud/client/client.go index e84132e0..0a6f3ecd 100644 --- a/upcloud/client/client.go +++ b/upcloud/client/client.go @@ -18,7 +18,7 @@ import ( ) const ( - Version string = "8.42.0" + Version string = "8.42.1" APIVersion string = "1.3" APIBaseURL string = "https://api.upcloud.com"