regent-sdk 0.7.0

Multi-paradigm configuration management system as a library
Documentation
use regent_sdk::hosts::handlers::ConnectionMethod;
use regent_sdk::hosts::handlers::TargetUser;
use regent_sdk::hosts::managed_host::ManagedHostBuilder;
use regent_sdk::secrets::{SecretProvider, SecretProvidersPool};

#[tokio::main]
async fn main() {
    // Build a SecretProvidersPool
    let secret_providers = SecretProvidersPool::from("env_vars", SecretProvider::env_var());

    // Describe the ManagedHost
    let mut managed_host = ManagedHostBuilder::new(
        "<host-id>",
        "<address:port>",
        Some(ConnectionMethod::Localhost(TargetUser::current_user())),
    )
    .build(Some(secret_providers))
    .await
    .unwrap();

    // Open connection with this ManagedHost
    assert!(managed_host.connect().is_ok());

    // What kind of OS are we dealing with ?
    match managed_host.collect_properties() {
        Ok(()) => {
            println!("Host properties : {:?}", managed_host.get_host_properties());
        }
        Err(error_detail) => {
            println!("Unable to collect host properties : {:?}", error_detail);
        }
    }
}