{"id":13702535,"url":"https://github.com/floriandejonckheere/hcloud","last_synced_at":"2026-01-16T18:01:28.562Z","repository":{"id":56876339,"uuid":"384486697","full_name":"floriandejonckheere/hcloud","owner":"floriandejonckheere","description":"Modern object-oriented Ruby wrapper for Hetzner Cloud API","archived":false,"fork":false,"pushed_at":"2026-01-06T05:29:45.000Z","size":656,"stargazers_count":10,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-09T02:15:11.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://floriandejonckheere.github.io/hcloud/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floriandejonckheere.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-09T15:59:04.000Z","updated_at":"2026-01-06T05:29:47.000Z","dependencies_parsed_at":"2024-05-07T06:29:02.311Z","dependency_job_id":"4f9f33ba-8c5a-4259-8ab9-35cc530bb2be","html_url":"https://github.com/floriandejonckheere/hcloud","commit_stats":{"total_commits":253,"total_committers":2,"mean_commits":126.5,"dds":0.02371541501976282,"last_synced_commit":"581f48f4b3a357c7a5700b1fa08e24aec3a9e7d4"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/floriandejonckheere/hcloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriandejonckheere%2Fhcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriandejonckheere%2Fhcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriandejonckheere%2Fhcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriandejonckheere%2Fhcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floriandejonckheere","download_url":"https://codeload.github.com/floriandejonckheere/hcloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriandejonckheere%2Fhcloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T21:00:37.417Z","updated_at":"2026-01-16T18:01:28.077Z","avatar_url":"https://github.com/floriandejonckheere.png","language":"Ruby","funding_links":[],"categories":["Libraries"],"sub_categories":["Ruby"],"readme":"# HCloud\n\n![Continuous Integration](https://github.com/floriandejonckheere/hcloud/actions/workflows/ci.yml/badge.svg)\n![Release](https://img.shields.io/github/v/release/floriandejonckheere/hcloud?label=Latest%20release)\n\nUnofficial Ruby integration with the [Hetzner Cloud API](https://docs.hetzner.cloud/).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"hetznercloud\"\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install hcloud\n\n## Usage\n\n```ruby\nrequire \"hcloud\"\n\n# Create a new client\nclient = HCloud::Client.new(access_token: \"my_access_token\")\n\n# Set client as default connection\nHCloud::Client.connection = client\n\n# Create resource\nssh_key = HCloud::SSHKey.new(name: \"My SSH key\", public_key: \"ssh-rsa ...\")\nssh_key.create\n\n# Alternate syntax:\nssh_key = HCloud::SSHKey.create(name: \"My SSH key\", public_key: \"ssh-rsa ...\")\n\n# Find resource by ID\nssh_key = HCloud::SSHKey.find(1)\n\n# Update resource\nssh_key.updatable_attributes # =\u003e [:name, :labels]\nssh_key.name = \"New name\"\nssh_key.update\n\n# Delete resource\nssh_key.delete\nssh_key.deleted?\n# =\u003e true\n\n# For detailed usage of resources, refer to the class documentation\n\n# When specifying associated resources, you can either use an instance of the resource, an integer as ID or a string as name.\n# The following calls are equivalent:\nserver = HCloud::Server.new(name: \"my_server\", location: \"fsn\", ...)\nserver = HCloud::Server.new(name: \"my_server\", location: 1, ...)\nserver = HCloud::Server.new(name: \"my_server\", location: Location.new(name: \"fsn\"), ...)\n```\n\nThe gem aims to provide a simple, object-oriented interface to the Hetzner Cloud API.\nIt does not aim to be an authoritative source of information, and as such does little validation on your input data or behaviour.\nIt expects you to use it in a sane way.\n\n## Features\n\nThe following table lists the Hetzner Cloud API endpoints that are currently implemented.\n\n| Resource                                                                         | State                 |\n|----------------------------------------------------------------------------------|-----------------------|\n| [Actions](lib/hcloud/resources/action.rb)                                        | Implemented           |\n| [Certificates](lib/hcloud/resources/certificate.rb)                              | Implemented           |\n| [Certificate Actions](lib/hcloud/resources/certificate.rb)                       | Implemented           |\n| [Datacenters](lib/hcloud/resources/datacenter.rb)                                | Implemented           |\n| [Firewalls](lib/hcloud/resources/firewall.rb)                                    | Implemented           |\n| [Firewall Actions](lib/hcloud/resources/firewall.rb)                             | Implemented           |\n| [Floating IPs](lib/hcloud/resources/floating_ip.rb)                              | Implemented           |\n| [Floating IP Actions](lib/hcloud/resources/floating_ip.rb)                       | Implemented           |\n| [Images](lib/hcloud/resources/image.rb)                                          | Implemented           |\n| [Image Actions](lib/hcloud/resources/image.rb)                                   | Implemented           |\n| [ISOs](lib/hcloud/resources/iso.rb)                                              | Implemented           |\n| [Load Balancers](lib/hcloud/resources/load_balancer.rb)                          | Implemented           |\n| [Load Balancer Actions](lib/hcloud/resources/load_balancer.rb)                   | Implemented           |\n| [Load Balancer Types](lib/hcloud/resources/load_balancer.rb)                     | Implemented           |\n| [Locations](lib/hcloud/resources/location.rb)                                    | Implemented           |\n| [Primary IPs](lib/hcloud/resources/primary_ip.rb)                                | Implemented           |\n| [Primary IP Actions](lib/hcloud/resources/primary_ip.rb)                         | Implemented           |\n| [Networks](lib/hcloud/resources/network.rb)                                      | Implemented           |\n| [Network Actions](lib/hcloud/resources/network.rb)                               | Implemented           |\n| [Placement Groups](lib/hcloud/resources/placement_group.rb)                      | Implemented           |\n| [Pricing](lib/hcloud/resources/pricing.rb)                                       | Implemented           |\n| [RRSets](lib/hcloud/resources/rrset.rb)                                          | Implemented           |\n| [RRSet Actions](lib/hcloud/resources/rrset.rb)                                   | Implemented           |\n| [Servers](lib/hcloud/resources/server.rb)                                        | Partially implemented |\n| [Server Actions](lib/hcloud/resources/server.rb)                                 | Not implemented       |\n| [Server Types](lib/hcloud/resources/server_type.rb)                              | Implemented           |\n| [SSH Keys](lib/hcloud/resources/ssh_key.rb)                                      | Implemented           |\n| [Storage Boxes](lib/hcloud/resources/storage_box.rb)                             | Implemented           |\n| [Storage Box Actions](lib/hcloud/resources/storage_box.rb)                       | Implemented           |\n| [Storage Box Types](lib/hcloud/resources/storage_box_type.rb)                    | Implemented           |\n| [Storage Box Subaccount](lib/hcloud/resources/storage_box_subaccount.rb)         | Implemented           |\n| [Storage Box Subaccount Actions](lib/hcloud/resources/storage_box_subaccount.rb) | Implemented           |\n| [Storage Box Snapshot](lib/hcloud/resources/storage_box_snapshot.rb)             | Implemented           |\n| [Volumes](lib/hcloud/resources/volume.rb)                                        | Implemented           |\n| [Volume Actions](lib/hcloud/resources/volume.rb)                                 | Implemented           |\n| [Metadata](lib/hcloud/resources/metadata.rb)                                     | Implemented           |\n| [Zones](lib/hcloud/resources/zone.rb)                                            | Implemented           |\n| [Zone Actions](lib/hcloud/resources/zone.rb)                                     | Implemented           |\n\n### Pagination\n\nPaginated resources are wrapped in a `HCloud::Collection` that automatically fetches the next page when needed.\nThe collection acts as a (lazy) enumerator.\nCall `to_a` to fetch all pages and parse all resources.\n\n### Rate limiting\n\nFrom the [documentation](https://docs.hetzner.cloud/#rate-limiting):\n\n\u003e The default limit is 3600 requests per hour and per Project.\n\u003e The number of remaining requests increases gradually.\n\u003e For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second.\n\nThe client is able to handle the rate limiting by delaying the requests if necessary and executing them whenever possible.\nTo enable this behaviour, pass `rate_limit: true` as argument to `HCloud::Client.new`.\nClient calls will block until possible to execute and then return.\n\n```ruby\nclient = HCloud::Client.new(access_token: \"my_token\", rate_limit: true)\n\n# At least one request has to be made to enable the rate limiter\nclient.rate_limiter.limit # =\u003e nil\nclient.rate_limiter.remaining # =\u003e nil\nclient.rate_limiter.reset # =\u003e nil\n\nHCloud::Server.create(...)\n\nclient.rate_limiter.limit # =\u003e 3600\nclient.rate_limiter.remaining # =\u003e 3599\nclient.rate_limiter.reset # =\u003e 2023-01-01 00:00:00 +0100\n\n# Make a bunch of requests\n\nclient.rate_limiter.remaining # =\u003e 0\n\nservers = HCloud::Server.all # Will block until remaining requests have regenerated (1 second by default) and then execute\nssh_keys = HCloud::SSHKey.all # Will block until remaining requests have regenerated (1 second by default) and then execute\n```\n\nSince rate limits are per hour and per project, using multiple clients at the same time will interfere with the rate limiting mechanism.\nTo prevent this, wrap client calls in a loop that retries the call after it fails with a `HCloud::RateLimitExceeded` error.\n\n### Compression\n\nEnable compression by passing an appropriate `compression` option to `HCloud::Client.new`.\nCurrent supported options are `nil`, `\"gzip\"`, and `\"brotli\"`.\nCompression is disabled by default.\n\n```ruby\nclient = HCloud::Client.new(access_token: \"my_access_token\", compression: \"gzip\")\n```\n\nTo use Brotli compression, you need to install the `brotli` gem (at least version 0.3.0):\n\n```ruby\ngem \"brotli\"\n```\n\n## Storage boxes\n\nPlease note that storage boxes require a different API endpoint.\nThe endpoint for **storage boxes** is `https://api.hetzner.com/v1`.\nThe endpoint for **all other resources** is `https://api.hetzner.cloud/v1`.\nThe storage box endpoint is passed as an extra argument to the `HCloud::Client`, see [Endpoint](#endpoint) for more information.\n\n## Testing\n\n```ssh\n# Run test suite (without integration tests)\nbundle exec rspec\n\n# Run integration tests (WARNING: THIS WILL DESTROY **ALL** RESOURCES AFTER EACH RUN)\nbundle exec rspec --tag integration\n```\n\n## Debugging\n\n### Logging\n\nWhen using the gem in your code, you can pass a `logger:` argument to `HCloud::Client`:\n\n```ruby\nlogger = Logger.new(\"log/http.log\")\nlogger.level = :debug\n\nclient = HCloud::Client.new(access_token: \"my_access_token\", logger: logger)\n```\n\nWhen executing the test suite, set `LOG_LEVEL` environment variable to `debug` in order to see HTTP requests.\n\n### Endpoint\n\n`HCloud::Client` also accepts alternate endpoints:\n\n```ruby\nclient = HCloud::Client.new(\n  endpoint: \"https://myproxy/v1\",\n  storage_box_endpoint: \"https://myproxy/storage-box/v1\",\n  access_token: \"my_access_token\",\n)\n```\n\n## Releasing\n\nTo release a new version, update the version number in `lib/hcloud/version.rb`, update the changelog, commit the files and create a git tag starting with `v`, and push it to the repository.\nGithub Actions will automatically run the test suite, build the `.gem` file and push it to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/floriandejonckheere/hcloud](https://github.com/floriandejonckheere/hcloud). \n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriandejonckheere%2Fhcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriandejonckheere%2Fhcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriandejonckheere%2Fhcloud/lists"}