added functions check auctioned transactions and order auctioned server
This commit is contained in:
		@@ -1,15 +1,48 @@
 | 
			
		||||
// // Get all available products (servers) that we can order and print them in a table
 | 
			
		||||
/// --- Get all available products (servers) that we can order and print them in a table
 | 
			
		||||
// let available_server_products = hetzner.get_server_ordering_product_overview();
 | 
			
		||||
// available_server_products.pretty_print();
 | 
			
		||||
 | 
			
		||||
// // List the details from a specific sever product based on the ID
 | 
			
		||||
/// --- List the details from a specific sever product based on the ID
 | 
			
		||||
// let example_server_product = hetzner.get_server_ordering_product_by_id("AX41-NVMe");
 | 
			
		||||
// print(example_server_product);
 | 
			
		||||
 | 
			
		||||
// List all the transactions from the past 30 days
 | 
			
		||||
/// --- List all the transactions from the past 30 days
 | 
			
		||||
// let transactions_last_30 = hetzner.get_transactions();
 | 
			
		||||
// print(transactions_last_30);
 | 
			
		||||
 | 
			
		||||
let example_transaction = hetzner.get_transaction_by_id("2111181");
 | 
			
		||||
print(example_transaction);
 | 
			
		||||
/// --- Fetch a transcation by ID
 | 
			
		||||
// let example_transaction = hetzner.get_transaction_by_id("120000706572");
 | 
			
		||||
// print(example_transaction);
 | 
			
		||||
 | 
			
		||||
/// --- List all the auction transaction from the past 30 days
 | 
			
		||||
// let auction_transactions_last_30 = hetzner.get_auction_transactions();
 | 
			
		||||
// auction_transactions_last_30.pretty_print();
 | 
			
		||||
 | 
			
		||||
/// --- Fetch a auction transaction by ID
 | 
			
		||||
// let example_auction_transaction = hetzner.get_auction_transaction_by_id("");
 | 
			
		||||
// print(example_auction_transaction);
 | 
			
		||||
 | 
			
		||||
/// --- List all the auctioned server products
 | 
			
		||||
// let auctioned_servers = hetzner.get_auction_server_products();
 | 
			
		||||
// auctioned_servers.pretty_print();
 | 
			
		||||
 | 
			
		||||
/// --- Get information about one specific auctioned server by ID
 | 
			
		||||
let auctioned_server = hetzner.get_auction_server_product_by_id("2739567");
 | 
			
		||||
print(auctioned_server);
 | 
			
		||||
 | 
			
		||||
/// --- Order an auction server
 | 
			
		||||
// 1. Grab the SSH key to pass to the deployment
 | 
			
		||||
let ssh_key = hetzner.get_ssh_key("e0:73:80:26:80:46:f0:c8:bb:74:f4:d0:2d:10:2d:6f");
 | 
			
		||||
// 2. Order the auctioned server
 | 
			
		||||
let transaction = hetzner.order_auction_server(
 | 
			
		||||
    auctioned_server.id,
 | 
			
		||||
    [ssh_key], // Pass ssh_key as an array
 | 
			
		||||
    (), // dist (Option<String>)
 | 
			
		||||
    (), // arch (Option<String>)
 | 
			
		||||
    (), // lang (Option<String>)
 | 
			
		||||
    (), // comment (Option<String>)
 | 
			
		||||
    [], // addons (Array)
 | 
			
		||||
    (), // test (Option<bool>)
 | 
			
		||||
);
 | 
			
		||||
print(transaction);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,8 @@ keys.pretty_print();
 | 
			
		||||
// print(key);
 | 
			
		||||
 | 
			
		||||
// Add a new SSH key
 | 
			
		||||
// Replace "my-new-key" with the desired name and "ssh-rsa ..." with your public key data
 | 
			
		||||
// let new_key = hetzner.add_ssh_key("vanheesm@incubaid.com", "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFyZJCEsvRc0eitsOoq+ywC5Lmqejvk3hXMVbO0AxPrd");
 | 
			
		||||
// print(new_key);
 | 
			
		||||
let new_key = hetzner.add_ssh_key("vanheesm@incubaid.com", "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFyZJCEsvRc0eitsOoq+ywC5Lmqejvk3hXMVbO0AxPrd");
 | 
			
		||||
print(new_key);
 | 
			
		||||
 | 
			
		||||
// Update an SSH key's name
 | 
			
		||||
// Replace "cb:8b:ef:a7:fe:04:87:3f:e5:55:cd:12:e3:e8:9f:99" with the fingerprint of the key you want to update
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user