hcloud-ruby
hcloud-ruby copied to clipboard
[Feature] Label support
https://github.com/hetznercloud/cli/commit/bf798628de328ba8b58c0225bff14f1c8c642dce
Are you alive?
Of course ;)
Any estimate when labels will be available, they would be quite handy for tagging resources for CI.
Hey :wave:
I want to take a look at the labels and just drop some thought here to go over it later.
- objectives:
- add, remove, view labels on a resource (https://docs.hetzner.cloud/#labels)
- filter labels via label selector (https://docs.hetzner.cloud/#label-selector)
- affected resources:
Servers, Floating IPs, Volumes, SSH keys and Images
Example:
# creating a server with labels
c = Hcloud::Client.new(token: "<your project token>")
c.servers.create(name: "moo6", server_type: "cx11", image: "ubuntu-22.04", labels: ["ci", "runner-923fb89a"])
# removing a label
c.servers.remove_label("ci")
We have additional affected resource types:
- network
- upcoming: firewalls
Resource types that also have labels, but are not implemented in this library, yet:
- certificates
- load balancers
- primary IPs
- placement groups