Skip to content

Releases: hetznercloud/hcloud-go

v2.30.0

10 Nov 10:50
19defdf

Choose a tag to compare

DNS API is now generally available

The DNS API is now generally available, as well as support for features in this project that are related to the DNS API.

To migrate existing zones to the new DNS API, see the DNS migration guide.

See the changelog for more details.

Features

  • DNS support is now generally available (#763)

v2.29.0

30 Oct 10:46
a906ebd

Choose a tag to compare

Features

  • exp: add TXT record helpers (#757)

v2.28.0

21 Oct 09:24
a31266b

Choose a tag to compare

Storage Box API Experimental

This release adds support for the Storage Box API.

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 entry.

Examples

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)

v2.27.0

07 Oct 08:20
7a591b7

Choose a tag to compare

DNS API Beta

This release adds support for the new DNS API.

The DNS API is currently in beta, which will likely end on 10 November 2025. After the beta ended, it will no longer be possible to create new zones in the old DNS system. See the DNS Beta FAQ for more details.

Future minor releases of this project may include breaking changes for features that are related to the DNS API.

See the DNS API Beta changelog for more details.

Examples

result, _, err := client.Zone.Create(ctx, hcloud.ZoneCreateOpts{
	Name:   "example.com",
	Mode:   hcloud.ZoneModePrimary,
	Labels: map[string]string{"key": "value"},
	RRSets: []hcloud.ZoneCreateOptsRRSet{
		{
			Name: "@",
			Type: hcloud.ZoneRRSetTypeA,
			Records: []hcloud.ZoneRRSetRecord{
				{Value: "201.180.75.2", Comment: "server1"},
			},
		},
	},
})

err = client.Action.WaitFor(ctx, result.Action)
zone = result.Zone

Features

  • support the new DNS API (#740)

v2.26.0

06 Oct 07:56
4fc2c7f

Choose a tag to compare

Features

  • support for go1.25 and drop go1.23 (#738)

Bug Fixes

  • exp: remove dots from deprecation messages (#736)

v2.25.1

26 Sep 15:33
47597e9

Choose a tag to compare

Bug Fixes

  • exp: improve deprecation message helpers (#734)

v2.25.0

25 Sep 08:19
b9c6910

Choose a tag to compare

Server Types now depend on Locations.

  • We added a new locations property to the Server Types resource. The new property defines a list of supported Locations and additional per Locations details such as deprecations information.

  • We deprecated the deprecation property from the Server Types resource. The property will gradually be phased out as per Locations deprecations are being announced. Please use the new per Locations deprecation information instead.

See our changelog for more details.

Upgrading

// Before
func ValidateServerType(serverType *hcloud.ServerType) error {
	if serverType.IsDeprecated() {
		return fmt.Errorf("server type %s is deprecated", serverType.Name)
	}
	return nil
}
// After
func ValidateServerType(serverType *hcloud.ServerType, location *hcloud.Location) error {
	serverTypeLocationIndex := slices.IndexFunc(serverType.Locations, func(e hcloud.ServerTypeLocation) bool {
		return e.Location.Name == location.Name
	})
	if serverTypeLocationIndex < 0 {
		return fmt.Errorf("server type %s is not supported in location %q", serverType.Name, location.Name)
	}

	if serverType.Locations[serverTypeLocationIndex].IsDeprecated() {
		return fmt.Errorf("server type %q is deprecated in location %q", serverType.Name, location.Name)
	}

	return nil
}

Features

  • exp: add sliceutil.Transform function (#731)
  • per locations server types (#730)

v2.24.0

20 Sep 10:41
346fba5

Choose a tag to compare

Features

  • add new ip_range param to ServerAttachToNetwork (#723)
  • add new ip_range param to LoadBalancerAttachToNetwork (#724)

v2.23.0

08 Sep 10:17
016b8a4

Choose a tag to compare

Features

  • expose account currency information (#695)
  • add category property to server type (#717)

Bug Fixes

  • primary-ip: labels not clearable (#699)

v2.22.0

11 Jul 09:24
f58c028

Choose a tag to compare

Features

  • firewall: add applied_to_resources property (#667)
  • add missing error codes (#671)