hetznercloud / hcloud-go

A Go library for the Hetzner Cloud API
https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud
MIT License
372 stars 45 forks source link

A way to get the project ID #451

Closed gzuidhof closed 3 months ago

gzuidhof commented 3 months ago

TL;DR

Given an API key, expose some endpoint / routine to get the project ID number.

Expected behavior

Hi hcloud-go team,

I built this tool that automatically re-points floating IPs to healthy servers. One of the core features is that it notifies a Slack or Mattermost channel.

Right now it will print a list of servers, floating IPs, and their health state - which is great. It would be really great if I were able to provide a link to the resources as well - but to construct the URL I would need the project ID.

I'd prefer not to have a config field for this and rather have it figure that out on its own, is there any way to do that?

Thank you!

jooola commented 3 months ago

Hi @gzuidhof

We do not provide a public API to retrieve the current project ID.

I'll add your request to our internal feedback tracker regarding making the project API open to the public.

Thanks for you feedback.

gzuidhof commented 3 months ago

Thank you for the response :) I'll make it a config field until perhaps that changes.