-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add support for Storage Boxes #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #684 +/- ##
==========================================
+ Coverage 78.24% 78.52% +0.27%
==========================================
Files 55 59 +4
Lines 5039 5603 +564
==========================================
+ Hits 3943 4400 +457
- Misses 827 911 +84
- Partials 269 292 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
992641b
to
2d340eb
Compare
ff07920
to
aa5a527
Compare
ee914b1
to
39b8d99
Compare
39b8d99
to
8c628b8
Compare
a4842c1
to
20e0a5f
Compare
There was a problem hiding this 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.
a00ef9f
to
8a77911
Compare
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 <[email protected]>
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 <[email protected]>
SnapshotLimit and AutomaticSnapshotLimits were both pointers, which is not necessary.
Adds the new Storage Box client with the necessary types and CRUD operations. API Reference: https://docs.hetzner.cloud/reference/hetzner#storage-boxes --------- Co-authored-by: Julian Tölle <[email protected]>
Adds support for Storage Box snapshots. API Reference: https://docs.hetzner.cloud/reference/hetzner#snapshots
Adds support for Storage Box subaccounts. API Reference: https://docs.hetzner.cloud/reference/hetzner#subaccounts
Adds support for Storage Box subaccount actions. API Reference: https://docs.hetzner.cloud/reference/hetzner#subaccount-actions
`snapshot_limit` and `automatic_snapshot_limit` are both nullable. We implemented them as required.
This PR adds missing schema conversion functions and makes some conversions more consistent with other resources
`hcloud.StorageBox` is part of `hcloud.StorageBoxSubaccount` and `hcloud.StorageBoxSnapshot`. Therefore, we can remove the storage box reference from the function parameters.
Co-authored-by: Jonas L. <[email protected]>
Co-authored-by: Jonas L. <[email protected]>
ℹ️ I am currently fixing a bunch of things here. |
Done, please see #752 |
Additional fixes for the storage boxes implementation.
// GetByID retrieves a [StorageBox] by its ID. If the [StorageBox] does not exist, nil is returned. | ||
func (c *StorageBoxClient) GetByID(ctx context.Context, id int64) (*StorageBox, *Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Should we include links to the upstream documentation for each client methods?
- Are we releasing this as experimental or not?
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