Skip to content

feat: remove datacenter property from server and primary_ip - #1460

Merged
phm07 merged 3 commits into
mainfrom
feat/remove-datacenter-property
Jul 24, 2026
Merged

feat: remove datacenter property from server and primary_ip#1460
phm07 merged 3 commits into
mainfrom
feat/remove-datacenter-property

Conversation

@lukasmetzner

Copy link
Copy Markdown
Contributor

Remove the datacenter property from Server and Primary IP resource where
possible. The property was deprecated ~6 months ago, and because the property
is removed from the API, removing it from our code is not considered a breaking
change.

Changelog entry: https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters

@lukasmetzner
lukasmetzner requested a review from a team as a code owner July 21, 2026 14:09
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.12%. Comparing base (c3adacb) to head (c47e470).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1460      +/-   ##
==========================================
+ Coverage   72.89%   73.12%   +0.23%     
==========================================
  Files         300      300              
  Lines       11127    11081      -46     
==========================================
- Hits         8111     8103       -8     
+ Misses       2118     2084      -34     
+ Partials      898      894       -4     
Flag Coverage Δ
e2e 51.50% <88.88%> (+0.14%) ⬆️
unit 67.97% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Comment thread docs/reference/manual/hcloud_primary-ip_create.md
@jooola
jooola requested a review from phm07 July 24, 2026 08:48
Comment thread internal/cmd/primaryip/create.go
Remove the `datacenter` property from Server and Primary IP resource where
possible. The property was deprecated ~6 months ago, and because the property
is removed from the API, removing it from our code is not considered a breaking
change.

Changelog entry: https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters
@phm07
phm07 force-pushed the feat/remove-datacenter-property branch from 9d35d87 to 031ef19 Compare July 24, 2026 09:06
@phm07
phm07 merged commit 31f790a into main Jul 24, 2026
8 checks passed
@phm07
phm07 deleted the feat/remove-datacenter-property branch July 24, 2026 09:31
phm07 pushed a commit that referenced this pull request Jul 24, 2026
<!-- section-start changelog -->
### Removed deprecated Datacenter from Server and Primary IP

Removed the deprecated Datacenter property from the Server and Primary
IP resources. Since the property was already removed from the Hetzner
Cloud API, we do not consider this a breaking change (see [changelog
entry](https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters)).

The `hcloud primary-ip create --datacenter` and `hcloud server create
--datacenter` flags have been removed in favor of `--location`.
Additionally, `hcloud primary-ip describe` and `hcloud server describe`
will no longer show the Datacenter property.

In place of the `--datacenter` flag the `--location` flag can be used.
The Location name is the first part of the Datacenter name, e.g. the
part before `-`. Example:

**Before:**

```sh
$ hcloud server create --datacenter fsn1-dc14
$ hcloud primary-ip create --datacenter hel1-dc2
```

**After:**

```sh
$ hcloud server create --location fsn1
$ hcloud primary-ip create --location hel1
```

### Features

- add http-timeout option (#1445)
- remove datacenter property from server and primary_ip (#1460)

### Bug Fixes

- **primary-ip**: format IPv6 properly in describe (#1451)

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

~~~~rp-prefix
### Removed deprecated Datacenter from Server and Primary IP

Removed the deprecated Datacenter property from the Server and Primary
IP resources. Since the property was already removed from the Hetzner
Cloud API, we do not consider this a breaking change (see [changelog
entry](https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters)).

The `hcloud primary-ip create --datacenter` and `hcloud server create
--datacenter` flags have been removed in favor of `--location`.
Additionally, `hcloud primary-ip describe` and `hcloud server describe`
will no longer show the Datacenter property.

In place of the `--datacenter` flag the `--location` flag can be used.
The Location name is the first part of the Datacenter name, e.g. the
part before `-`. Example:

**Before:**

```sh
$ hcloud server create --datacenter fsn1-dc14
$ hcloud primary-ip create --datacenter hel1-dc2
```

**After:**

```sh
$ hcloud server create --location fsn1
$ hcloud primary-ip create --location hel1
```
~~~~

### Suffix / End

This will be added to the end of the release notes.

~~~~rp-suffix
~~~~

</details>

Co-authored-by: Hetzner Cloud Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants