11 lines
417 B
Plaintext
11 lines
417 B
Plaintext
// This script demonstrates how to list all servers 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 servers.
|
|
print("Listing all servers...");
|
|
let servers = client.list_servers();
|
|
|
|
// The `show_table` method formats the server list into a user-friendly table.
|
|
print(servers.show_table()); |