feat: Add server rebuild example using install_image #1

Open
MahmoudEmad wants to merge 2 commits from development_install_image into master
Collaborator

Changes

  • Added a new example script demonstrating server rebuilds
    using the install_image function.
  • The example shows how to list available images (system,
    backup, etc.), select an image, and initiate a rebuild.
  • Includes comprehensive error handling and progress
    monitoring.
  • Improved documentation with detailed explanations and usage
    instructions.

Example

Server Management:

// Create, list, inspect servers
let servers = client.list_servers();
let server = client.get_server(server_id);

// Rebuild server with new image
client.install_image(server_id, "ubuntu-22.04");

// Monitor rebuild progress
while server.status != "running" {
    sleep(5);
    server = client.get_server(server_id);
}

Advanced Image Filtering:

// Flexible image filtering
let params = new_list_images_params_builder()
    .with_type("system")
    .with_status("available")
    .with_architecture("x86");
let images = client.list_images(params);
### Changes - Added a new example script demonstrating server rebuilds using the `install_image` function. - The example shows how to list available images (system, backup, etc.), select an image, and initiate a rebuild. - Includes comprehensive error handling and progress monitoring. - Improved documentation with detailed explanations and usage instructions. ### Example **Server Management:** ```rust // Create, list, inspect servers let servers = client.list_servers(); let server = client.get_server(server_id); // Rebuild server with new image client.install_image(server_id, "ubuntu-22.04"); // Monitor rebuild progress while server.status != "running" { sleep(5); server = client.get_server(server_id); } ``` **Advanced Image Filtering:** ```rust // Flexible image filtering let params = new_list_images_params_builder() .with_type("system") .with_status("available") .with_architecture("x86"); let images = client.list_images(params); ```
MahmoudEmad added 1 commit 2025-07-17 13:28:35 +00:00
- Added a new example script demonstrating server rebuilds
  using the `install_image` function.
- The example shows how to list available images (system,
  backup, etc.), select an image, and initiate a rebuild.
- Includes comprehensive error handling and progress
  monitoring.
- Improved documentation with detailed explanations and usage
  instructions.
maximevanhees requested changes 2025-07-17 13:54:53 +00:00
README.md Outdated
@ -39,0 +62,4 @@
### Monitoring and Status
- **Real-time server status** monitoring
- **Rebuild progress tracking** with automatic completion detection

@MahmoudEmad

I personally think it is not appropriate to list this as a "feature" as the progress tracking is done in the Rhai-script itself and not in the Rust code.

@MahmoudEmad I personally think it is not appropriate to list this as a "feature" as the progress tracking is done in the Rhai-script itself and not in the Rust code.
MahmoudEmad marked this conversation as resolved
MahmoudEmad added 1 commit 2025-07-17 13:59:14 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin development_install_image:development_install_image
git checkout development_install_image
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: maximevanhees/hetzner_rhai#1
No description provided.