Skip to content

Conversation

@apricote
Copy link
Member

@apricote apricote commented Aug 6, 2025

We collect all changes for the Storage Box support (#675) in this PR. It will only be merged when everything is implemented through smaller pull requests targetting the storage-boxes branch.

Closes #675

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 79.93139% with 117 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.53%. Comparing base (68c6e74) to head (a9b5ff9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hcloud/storage_box.go 72.27% 43 Missing and 13 partials ⚠️
hcloud/storage_box_subaccount.go 81.02% 19 Missing and 7 partials ⚠️
hcloud/storage_box_snapshot.go 84.31% 11 Missing and 5 partials ⚠️
hcloud/schema_gen.go 76.66% 6 Missing and 1 partial ⚠️
hcloud/schema.go 87.50% 6 Missing ⚠️
hcloud/storage_box_type.go 86.04% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #684      +/-   ##
==========================================
+ Coverage   78.24%   78.53%   +0.28%     
==========================================
  Files          55       59       +4     
  Lines        5039     5619     +580     
==========================================
+ Hits         3943     4413     +470     
- Misses        827      912      +85     
- Partials      269      294      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jooola jooola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do another pass when the additional changes from #745 are merged.

@lukasmetzner lukasmetzner force-pushed the storage-boxes branch 2 times, most recently from a00ef9f to 8a77911 Compare October 17, 2025 06:49
@lukasmetzner lukasmetzner marked this pull request as ready for review October 17, 2025 07:02
@lukasmetzner lukasmetzner requested a review from a team as a code owner October 17, 2025 07:02
Lukas Metzner and others added 3 commits October 17, 2025 10:57
Adds support for the new Hetzner API with a shallow copy of the original
client.

The new options `WithHetznerEndpoints` is marked as experimental for
now.

---------

Co-authored-by: Julian Tölle <julian.toelle@hetzner-cloud.de>
We can use the same API endpoint here, as this is a local server for
testing, where we define the responses ourselves.
Reference to API docs:
https://docs.hetzner.cloud/reference/hetzner#storage-box-types

---------

Co-authored-by: Julian Tölle <julian.toelle@hetzner-cloud.de>
@jooola
Copy link
Member

jooola commented Oct 17, 2025

ℹ️ I am currently fixing a bunch of things here.

@jooola
Copy link
Member

jooola commented Oct 17, 2025

ℹ️ I am currently fixing a bunch of things here.

Done, please see #752

Additional fixes for the storage boxes implementation.
Lukas Metzner and others added 3 commits October 20, 2025 13:38
`ExampleStorageBoxClient_Create` and `ExampleStorageBoxClient_Create`
are two examples, which can be expanded in the `func (*StorageBoxClient)
[Create]` section of the https://pkg.go.dev/ docs.
Omitted the changelog reference, as there is no sensible one.

I have opted for `[StorageBoxClient] is experimental`, as this puts a
focus on the hcloud-go integration being experimental instead of the
product.
@lukasmetzner lukasmetzner merged commit b12e415 into main Oct 21, 2025
3 checks passed
@lukasmetzner lukasmetzner deleted the storage-boxes branch October 21, 2025 09:19
lukasmetzner pushed a commit that referenced this pull request Oct 21, 2025
### Storage Box API Experimental

This release adds support for the [Storage Box
API](https://docs.hetzner.cloud/reference/hetzner#storage-boxes).

The Storage Box integration will be introduced as an **experimental**
feature. This experimental phase is expected to last until **21 November
2025**. During this period, upcoming minor releases of the project may
include breaking changes to features related to the Storage Box API.

This release includes all changes from the recent [Storage Box API
changelog](https://docs.hetzner.cloud/changelog#2025-10-21-storage-box-api-update)
entry.

#### Examples

```go
result, _, err := client.StorageBox.Create(ctx, hcloud.StorageBoxCreateOpts{
	Name:           "my-storage-box",
	StorageBoxType: &hcloud.StorageBoxType{Name: "bx11"},
	Location:       &hcloud.Location{Name: "fsn1"},
	Password:       "my-secure-password",
	SSHKeys: []*hcloud.SSHKey{{ PublicKey: "ssh-rsa AAAAB3NzaC1yc2E..." }},
	Labels:         map[string]string{"key": "value"},
	AccessSettings: &hcloud.StorageBoxCreateOptsAccessSettings{
		ReachableExternally: hcloud.Ptr(true),
		SSHEnabled:          hcloud.Ptr(true),
	},
})

err = client.Action.WaitFor(ctx, result.Action)
```

### Features

- retrieve a server or load balancer network attachment (#750)
- add support for Storage Boxes (#684)

### Bug Fixes

- deprecate `firewall_already_removed` error code (#748)
- invalid property in network add_subnet request body (#751)
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Oct 21, 2025
…8.0 (hetznercloud/fleeting-plugin-hetzner!294)

This MR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) | `v2.27.0` -> `v2.28.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.27.0/v2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary>

### [`v2.28.0`](https://github.com/hetznercloud/hcloud-go/blob/HEAD/CHANGELOG.md#v2280)

[Compare Source](hetznercloud/hcloud-go@v2.27.0...v2.28.0)

##### Storage Box API Experimental

This release adds support for the [Storage Box API](https://docs.hetzner.cloud/reference/hetzner#storage-boxes).

The Storage Box integration will be introduced as an **experimental** feature. This experimental phase is expected to last until **21 November 2025**. During this period, upcoming minor releases of the project may include breaking changes to features related to the Storage Box API.

This release includes all changes from the recent [Storage Box API changelog](https://docs.hetzner.cloud/changelog#2025-10-21-storage-box-api-update) entry.

##### Examples

```go
result, _, err := client.StorageBox.Create(ctx, hcloud.StorageBoxCreateOpts{
	Name:           "my-storage-box",
	StorageBoxType: &hcloud.StorageBoxType{Name: "bx11"},
	Location:       &hcloud.Location{Name: "fsn1"},
	Password:       "my-secure-password",
	SSHKeys: []*hcloud.SSHKey{{ PublicKey: "ssh-rsa AAAAB3NzaC1yc2E..." }},
	Labels:         map[string]string{"key": "value"},
	AccessSettings: &hcloud.StorageBoxCreateOptsAccessSettings{
		ReachableExternally: hcloud.Ptr(true),
		SSHEnabled:          hcloud.Ptr(true),
	},
})

err = client.Action.WaitFor(ctx, result.Action)
```

##### Features

- retrieve a server or load balancer network attachment ([#&#8203;750](hetznercloud/hcloud-go#750))
- add support for Storage Boxes ([#&#8203;684](hetznercloud/hcloud-go#684))

##### Bug Fixes

- deprecate `firewall_already_removed` error code ([#&#8203;748](hetznercloud/hcloud-go#748))
- invalid property in network add\_subnet request body ([#&#8203;751](hetznercloud/hcloud-go#751))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTYuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support for Storage Boxes

5 participants