Go to file
2025-07-17 16:59:11 +03:00
examples feat: Add server rebuild example using install_image 2025-07-17 15:56:33 +03:00
src feat: Add server rebuild example using install_image 2025-07-17 15:56:33 +03:00
.gitignore implemented list servers + ping + reboot + example shown in example.rhai 2025-07-14 18:16:30 +02:00
Cargo.lock added functionality to list different images 2025-07-17 13:38:16 +02:00
Cargo.toml added functionality to list different images 2025-07-17 13:38:16 +02:00
README.md fix: Remove unneeded section in the README 2025-07-17 16:59:11 +03:00

Hetzner Cloud API - Rhai Wrapper

This project provides a Rhai wrapper for interacting with the Hetzner Cloud API, allowing you to manage your servers through simple scripts.

Setup

To use this wrapper, you need to set your Hetzner API Token as an environment variable. You can create your own API Token by following the steps from the Hetzner docs.

export HETZNER_API_TOKEN="YOUR_API_TOKEN_HERE"

Replace "YOUR_API_TOKEN_HERE" with your actual Hetzner API token.

Usage

You can execute any of the example scripts by passing the file path to cargo run.

cargo run -- examples/<script_name>.rhai

For example, to run the script that creates a server:

cargo run -- examples/01_create_server.rhai

Examples

The examples/ directory contains a collection of scripts demonstrating the available functionality. For detailed examples, please see the files in that directory:

Features

Server Management

  • Create servers with flexible configuration options
  • List and inspect server details and status
  • Reboot and reset servers
  • Rebuild servers with new images (install_image functionality)
  • Rescue mode management

Image Management

  • List images with advanced filtering (by type, status, architecture, etc.)
  • Support for all image types: system, backup, snapshot, and app images
  • Flexible image selection by name or ID

SSH Key Management

  • List SSH keys in your project
  • Automatic SSH key assignment during server creation