forked from NationTech/harmony
21 lines
669 B
Rust
21 lines
669 B
Rust
use libredfish::{Config, Redfish};
|
|
use reqwest::blocking::Client;
|
|
|
|
pub fn main() {
|
|
let client = Client::builder().danger_accept_invalid_certs(true).build().expect("Failed to build reqwest client");
|
|
let redfish = Redfish::new(
|
|
client,
|
|
Config {
|
|
user: Some(String::from("Administrator")),
|
|
endpoint: String::from("10.10.8.104/redfish/v1"),
|
|
// password: Some(String::from("YOUR_PASSWORD")),
|
|
password: Some(String::from("wrongpass")),
|
|
port: None,
|
|
},
|
|
);
|
|
|
|
let response = redfish.get_power_status().expect("Failed redfish request");
|
|
|
|
println!("Got power {:?}", response);
|
|
}
|