Skip to content

This is the unofficial OpenAPI description of the Hetzner Cloud API. It allows automatic code generation for the hcloud API.

License

Notifications You must be signed in to change notification settings

MaximilianKoestler/hcloud-openapi

Repository files navigation

Unofficial OpenAPI Description for the Hetzner Cloud API

This is an attempt to improve Hetzner's own OpenAPI specification to make it usable in code generation.

When this project was started, Hetzner had not published their own OpenAPI specification for their cloud API, so I decided to build my own based on the HTML documentation on their website. Luckily, Hetzner has actually published an OpenAPI spec for their API in the meantime but I think this project still adds some value.

While Hetzner now appears to generate their documentation website from the OpenAPI spec, the spec is not very useful for automatic code generation. This project aims to convert the official spec to an improved version with the following main features:

  • Definition of common components that are reused throughout the schema
  • Added pagination support
  • API-friendly tag names
  • Unique operationIds

As an added benefit, mainly from use of common components, the improved spec is much smaller (548 KiB vs 1.4 MiB) than the original.

Further Reading

Use Cases

This API description is currently being used by the following projects:

Supported Endpoints

actions certificates datacenters
floating_ips images isos
load_balancer_types load_balancers locations
networks pricing server_types
servers ssh_keys volumes
firewalls placement_groups primary_ips
/actions (GET)
/actions/{id} (GET)
/certificates (GET, POST)
/certificates/{id} (DELETE, GET, PUT)
/certificates/{id}/actions (GET)
/certificates/{id}/actions/{action_id} (GET)
/certificates/{id}/actions/retry (POST)
/certificates/actions (GET)
/certificates/actions/{id} (GET)
/datacenters (GET)
/datacenters/{id} (GET)
/firewalls (GET, POST)
/firewalls/{id} (DELETE, GET, PUT)
/firewalls/{id}/actions (GET)
/firewalls/{id}/actions/{action_id} (GET)
/firewalls/{id}/actions/apply_to_resources (POST)
/firewalls/{id}/actions/remove_from_resources (POST)
/firewalls/{id}/actions/set_rules (POST)
/firewalls/actions (GET)
/firewalls/actions/{id} (GET)
/floating_ips (GET, POST)
/floating_ips/{id} (DELETE, GET, PUT)
/floating_ips/{id}/actions (GET)
/floating_ips/{id}/actions/{action_id} (GET)
/floating_ips/{id}/actions/assign (POST)
/floating_ips/{id}/actions/change_dns_ptr (POST)
/floating_ips/{id}/actions/change_protection (POST)
/floating_ips/{id}/actions/unassign (POST)
/floating_ips/actions (GET)
/floating_ips/actions/{id} (GET)
/images (GET)
/images/{id} (DELETE, GET, PUT)
/images/{id}/actions (GET)
/images/{id}/actions/{action_id} (GET)
/images/{id}/actions/change_protection (POST)
/images/actions (GET)
/images/actions/{id} (GET)
/isos (GET)
/isos/{id} (GET)
/load_balancer_types (GET)
/load_balancer_types/{id} (GET)
/load_balancers (GET, POST)
/load_balancers/{id} (DELETE, GET, PUT)
/load_balancers/{id}/actions (GET)
/load_balancers/{id}/actions/{action_id} (GET)
/load_balancers/{id}/actions/add_service (POST)
/load_balancers/{id}/actions/add_target (POST)
/load_balancers/{id}/actions/attach_to_network (POST)
/load_balancers/{id}/actions/change_algorithm (POST)
/load_balancers/{id}/actions/change_dns_ptr (POST)
/load_balancers/{id}/actions/change_protection (POST)
/load_balancers/{id}/actions/change_type (POST)
/load_balancers/{id}/actions/delete_service (POST)
/load_balancers/{id}/actions/detach_from_network (POST)
/load_balancers/{id}/actions/disable_public_interface (POST)
/load_balancers/{id}/actions/enable_public_interface (POST)
/load_balancers/{id}/actions/remove_target (POST)
/load_balancers/{id}/actions/update_service (POST)
/load_balancers/{id}/metrics (GET)
/load_balancers/actions (GET)
/load_balancers/actions/{id} (GET)
/locations (GET)
/locations/{id} (GET)
/networks (GET, POST)
/networks/{id} (DELETE, GET, PUT)
/networks/{id}/actions (GET)
/networks/{id}/actions/{action_id} (GET)
/networks/{id}/actions/add_route (POST)
/networks/{id}/actions/add_subnet (POST)
/networks/{id}/actions/change_ip_range (POST)
/networks/{id}/actions/change_protection (POST)
/networks/{id}/actions/delete_route (POST)
/networks/{id}/actions/delete_subnet (POST)
/networks/actions (GET)
/networks/actions/{id} (GET)
/placement_groups (GET, POST)
/placement_groups/{id} (DELETE, GET, PUT)
/pricing (GET)
/primary_ips (GET, POST)
/primary_ips/{id} (DELETE, GET, PUT)
/primary_ips/{id}/actions/assign (POST)
/primary_ips/{id}/actions/change_dns_ptr (POST)
/primary_ips/{id}/actions/change_protection (POST)
/primary_ips/{id}/actions/unassign (POST)
/primary_ips/actions (GET)
/primary_ips/actions/{id} (GET)
/server_types (GET)
/server_types/{id} (GET)
/servers (GET, POST)
/servers/{id} (DELETE, GET, PUT)
/servers/{id}/actions (GET)
/servers/{id}/actions/{action_id} (GET)
/servers/{id}/actions/add_to_placement_group (POST)
/servers/{id}/actions/attach_iso (POST)
/servers/{id}/actions/attach_to_network (POST)
/servers/{id}/actions/change_alias_ips (POST)
/servers/{id}/actions/change_dns_ptr (POST)
/servers/{id}/actions/change_protection (POST)
/servers/{id}/actions/change_type (POST)
/servers/{id}/actions/create_image (POST)
/servers/{id}/actions/detach_from_network (POST)
/servers/{id}/actions/detach_iso (POST)
/servers/{id}/actions/disable_backup (POST)
/servers/{id}/actions/disable_rescue (POST)
/servers/{id}/actions/enable_backup (POST)
/servers/{id}/actions/enable_rescue (POST)
/servers/{id}/actions/poweroff (POST)
/servers/{id}/actions/poweron (POST)
/servers/{id}/actions/reboot (POST)
/servers/{id}/actions/rebuild (POST)
/servers/{id}/actions/remove_from_placement_group (POST)
/servers/{id}/actions/request_console (POST)
/servers/{id}/actions/reset (POST)
/servers/{id}/actions/reset_password (POST)
/servers/{id}/actions/shutdown (POST)
/servers/{id}/metrics (GET)
/servers/actions (GET)
/servers/actions/{id} (GET)
/ssh_keys (GET, POST)
/ssh_keys/{id} (DELETE, GET, PUT)
/volumes (GET, POST)
/volumes/{id} (DELETE, GET, PUT)
/volumes/{id}/actions (GET)
/volumes/{id}/actions/{action_id} (GET)
/volumes/{id}/actions/attach (POST)
/volumes/{id}/actions/change_protection (POST)
/volumes/{id}/actions/detach (POST)
/volumes/{id}/actions/resize (POST)
/volumes/actions (GET)
/volumes/actions/{id} (GET)

Quick Start

npm run convert -- --output openapi/hcloud.json

Usage with OpenAPI Generator

OpenAPI Generator on GitHub

Validate

java -jar <path>/openapi-generator-cli.jar validate --input-spec openapi/hcloud.json

Generate

java -jar <path>/openapi-generator-cli.jar generate --input-spec openapi/hcloud.json --generator-name <name> --output <path>

About

This is the unofficial OpenAPI description of the Hetzner Cloud API. It allows automatic code generation for the hcloud API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •