Hetzner Cloud: reads checked against a live project

Inspect on a real project showed servers, snapshots, primary IPs and prices answer as the reader expects; volumes, load balancers, floating IPs and certificates were seen only as empty lists. Docs and the adapter's header say so; no code change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-17 19:21:33 +01:00
1 parent a91efcbfe2
commit 730d7fb36e
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -479,7 +479,7 @@ osTicket's API cannot close a ticket, so this is the one place in the app that *
- **Load balancers, floating IPs and certificates** are read with the rest (a list that cannot be asked is shown as *could not be read*, never as none): the Hetzner page lists each **load balancer** with the health of its targets, each **floating IP** and what it points at, and each **certificate** with when it ends. Their prices (a load balancer's type, a floating IP's kind and place) are now in the cost estimate. Alerts: a **load balancer with an unhealthy target** (warning; critical when none of its targets is healthy), a **certificate** that is in use and ends within 14 days (critical within 3, or past its end) or that Hetzner could not issue or renew, and a **floating IP that points at no server** (it is billed all the same). A certificate nothing uses is not raised. - **Load balancers, floating IPs and certificates** are read with the rest (a list that cannot be asked is shown as *could not be read*, never as none): the Hetzner page lists each **load balancer** with the health of its targets, each **floating IP** and what it points at, and each **certificate** with when it ends. Their prices (a load balancer's type, a floating IP's kind and place) are now in the cost estimate. Alerts: a **load balancer with an unhealthy target** (warning; critical when none of its targets is healthy), a **certificate** that is in use and ends within 14 days (critical within 3, or past its end) or that Hetzner could not issue or renew, and a **floating IP that points at no server** (it is billed all the same). A certificate nothing uses is not raised.
- **Traffic forecast:** from the month's traffic the app writes down about every six hours it works out how the month is going — by the last week's rate, or, with too little of it, by the month's average (after three days) — and warns, below the 80% alert, when a server is **on course to pass its quota before the month ends**: "at this rate web will pass its 20.0 TB traffic quota on 24 June". The page shows the date, or what the month will come to, under each server's traffic bar. The month is the calendar month in UTC; a counter that goes down starts the history over. - **Traffic forecast:** from the month's traffic the app writes down about every six hours it works out how the month is going — by the last week's rate, or, with too little of it, by the month's average (after three days) — and warns, below the 80% alert, when a server is **on course to pass its quota before the month ends**: "at this rate web will pass its 20.0 TB traffic quota on 24 June". The page shows the date, or what the month will come to, under each server's traffic bar. The month is the calendar month in UTC; a counter that goes down starts the history over.
- `/metrics` has `homelab_hetzner_server_running`, `homelab_hetzner_traffic_outgoing_bytes`, `homelab_hetzner_traffic_included_bytes` and `homelab_hetzner_monthly_cost`. - `/metrics` has `homelab_hetzner_server_running`, `homelab_hetzner_traffic_outgoing_bytes`, `homelab_hetzner_traffic_included_bytes` and `homelab_hetzner_monthly_cost`.
- **Not verified against a live project** — the endpoints (`/servers`, `/volumes`, `/images?type=snapshot` and `type=backup`, `/primary_ips`, `/pricing`) and their fields are as Hetzner's published OpenAPI file has them, and the reader is tried against a pretend server. **Traffic** is read as bytes and shown in binary units (Hetzner's 20 TB is 20 TiB); a server's *included* traffic and the *outgoing* traffic of the current billing month come from the server itself. The **cost** is the list price including VAT (the `gross` prices): check it against Hetzner's invoice the first time. Dedicated (Robot) servers and Hetzner Storage Boxes are a different API and are not read. - **Checked against a live project** (Inspect, a project with two servers, snapshots and primary IPs): `/servers`, `/images?type=snapshot` and `type=backup`, `/primary_ips`, `/pricing` and the empty lists of `/volumes`, `/load_balancers`, `/floating_ips` and `/certificates` all answered as the reader expects, and every field it reads for servers, snapshots, primary IPs and prices had a value. **Not yet seen with something in them:** volumes, load balancers (and their target health), floating IPs, certificates and servers on a private network — those are as Hetzner's published OpenAPI file has them, and the reader is tried against a pretend server. **Traffic** is read as bytes and shown in binary units (Hetzner's 20 TB is 20 TiB); a server's *included* traffic and the *outgoing* traffic of the current billing month come from the server itself. The **cost** is the list price including VAT (the `gross` prices): check it against Hetzner's invoice the first time. Dedicated (Robot) servers and Hetzner Storage Boxes are a different API and are not read.
### Fragnet game servers ### Fragnet game servers
+2 -2
View File
@@ -5,8 +5,8 @@
* snapshots and backups, its primary and floating IPs, its load balancers (and the health of their targets), its certificates (and when they expire) and Hetzner's price list — enough to say * snapshots and backups, its primary and floating IPs, its load balancers (and the health of their targets), its certificates (and when they expire) and Hetzner's price list — enough to say
* what is off, what is close to its traffic quota, what has no recent backup, what is unhealthy or about to expire, and roughly what the project costs. Nothing is sent to Hetzner but GET requests for these; no server is started, stopped or changed. * what is off, what is close to its traffic quota, what has no recent backup, what is unhealthy or about to expire, and roughly what the project costs. Nothing is sent to Hetzner but GET requests for these; no server is started, stopped or changed.
* *
* Endpoints and field names are from Hetzner's published OpenAPI file (`/servers`, `/volumes`, `/images`, `/primary_ips`, `/pricing`; lists are paged, 50 at a time) and have not been * Endpoints and field names are from Hetzner's published OpenAPI file (`/servers`, `/volumes`, `/images`, `/primary_ips`, `/pricing`; lists are paged, 50 at a time) and were checked against a
* checked against a live project here; every field is read defensively. A token belongs to one project, so one integration is one project. The API allows 3600 requests an hour per project. * live project (servers, snapshots, primary IPs and prices; volumes, load balancers, floating IPs and certificates only as empty lists); every field is read defensively. A token belongs to one project, so one integration is one project. The API allows 3600 requests an hour per project.
*/ */
import { requestJson } from "../httpJson.js"; import { requestJson } from "../httpJson.js";
import { withDiagLogging } from "../../services/diagLog.js"; import { withDiagLogging } from "../../services/diagLog.js";