hetzner_robot_rhai/examples/server_management.rhai
2025-07-18 15:40:42 +02:00

21 lines
744 B
Plaintext

// Get all servers and print them in a table
// let servers = hetzner.get_servers();
// servers.pretty_print();
// // Get a specific server and print its details
// // Replace 2550253 with the server number you want to fetch
// let server = hetzner.get_server(2550253);
// print(server);
// Update the name of a specific server and print it
// print(hetzner.update_server_name(2550253, "kristof-123456"));
// Query cancellation data for a server
let c_d = hetzner.get_cancellation_data(2550253);
print(c_d);
// Cancel a server
// Replace 2550253 with the server number you want to cancel
// Replace "2014-04-15" with the desired cancellation date
let cancelled_server = hetzner.cancel_server(2550253, "2014-04-15");
print(cancelled_server);