tonobo / hcloud-ruby

Native ruby client for HetznerCloud
MIT License
32 stars 11 forks source link

label support (create, update, search) #45

Closed ghost closed 1 year ago

ghost commented 1 year ago

Adds label support following the Hetzner Cloud API behaviour. Labels can be specified when a new resource is created and updated with the update method of a resource. It is also possible to search for resources with labels with the label_selector in client.X.where (X being the desired resource type). Labels are supported by servers, firewalls, floating IPs, networks, SSH keys, volumes and images (read-only).

tonobo commented 1 year ago

I just thought about having a resource/entrity marker for "labelable" similar to "has_actions" but this is kind of tricky to implement. At the moment the create methods makes use of keyword args which isn't helpfuil by accepting labals parameter without writing them down there. So keep as is for the moment, lets see how it goes.