Releases: hetznercloud/hcloud-go
Releases · hetznercloud/hcloud-go
v2.17.0
v1.59.2
v2.16.0
v2.15.0
v2.14.0
v2.13.1
v1.59.1
v2.13.0
v1.59.0
v2.12.0
2.12.0 (2024-07-25)
API Changes for Traffic Prices and Server Type Included Traffic
There will be a breaking change in the API regarding Traffic Prices and Server Type Included Traffic on 2024-08-05. This release marks the affected fields as Deprecated
. Please check if this affects any of your code and switch to the replacement fields where necessary.
You can learn more about this change in our changelog.
Upgrading
Server Type Included Traffic
If you were using the field hcloud.ServerType.IncludedTraffic
, you can now get the information through hcloud.ServerType.Pricings
:
func main() {
// previous
includedTraffic := serverType.IncludedTraffic
// now
locationOfInterest := "fsn1"
var includedTraffic uint64
for _, price := range serverType.Pricings {
if price.Location.Name == locationOfInterest {
includedTraffic = price.IncludedTraffic
break
}
}
}
Traffic Prices
If you were using the field hcloud.Pricing.Traffic
, you can now get the information through hcloud.Pricing.ServerTypes
or hcloud.Pricing.LoadBalancerTypes
:
func main() {
// previous
trafficPrice := pricing.Traffic
// now
serverTypeOfInterest := "cx22"
locationOfInterest := "fsn1"
var trafficPrice hcloud.Price
for _, serverTypePricings := range pricing.ServerTypes {
if serverTypePricings.ServerType.Name == serverTypeOfInterest {
for _, price := range serverTypePricings {
if price.Location.Name == locationOfInterest {
trafficPrice = price.PerTBTraffic
break
}
}
}
}
}
Features
- add jitter in the client default retry exponential backoff (#492) (6205076)
- add new
WithPollOpts
client option (#493) (2c1a2d6) - allow checking multiple errors codes in
IsError
(#491) (af59ab8) - load-balancer-type: new traffic price fields (94e0f44)
- pricing: mark traffic field as deprecated (94e0f44)
- server-type: mark included traffic field as deprecated (94e0f44)
- server-type: new traffic price fields (94e0f44)