Crate hrobot

source ·
Expand description

hrobot is an unofficial synchronous Rust client for interacting with the Hetzner Robot API

See the trait implementations for Robot for a complete list of supported API Endpoints.

Disclaimer: the authors are not associated with Hetzner (except as customers), and the crate is in no way endorsed or supported by Hetzner Online GmbH.

Requirements for usage

A Hetzner WebService/app user is required to make use of this library.

If you already have a Hetzner account, you can create one through the Hetzner Robot web interface under Settings/Preferences.

Example

Here’s a quick example showing how to instantiate the Robot client object and fetching a list of all dedicated servers owned by the account identified by username

use hrobot::*;

let client = Robot::new(
    &std::env::var("HROBOT_USERNAME").unwrap(),
    &std::env::var("HROBOT_PASSWORD").unwrap()
);

for server in client.list_servers().unwrap() {
    println!("{name}: {product} in {location}",
        name = server.name,
        product = server.product,
        location = server.dc
    );
}

Running the above example should yield something similar to the anonymized output below

foobar: AX51-NVMe in FSN1-DC18

Re-exports

pub use boot::*;
pub use error::*;
pub use firewall::*;
pub use ip::*;
pub use keys::*;
pub use rdns::*;
pub use reset::*;
pub use robot::*;
pub use server::*;
pub use subnet::*;
pub use vswitch::*;
pub use wol::*;

Modules