hetzner_rhai/examples/05_list_ssh_keys.rhai
2025-07-17 14:03:49 +02:00

11 lines
424 B
Plaintext

// This script demonstrates how to list all SSH keys in your Hetzner Cloud project.
// Initialize the Hetzner client with your API token.
let client = new_hetzner_client(get_env("HETZNER_API_TOKEN"));
// Retrieve the list of all SSH keys.
print("Listing all SSH keys...");
let ssh_keys = client.list_ssh_keys();
// The `show_table` method formats the SSH key list into a user-friendly table.
print(ssh_keys.show_table());