2 releases

Uses old Rust 2015

0.0.2 Jan 8, 2025
0.0.1 Jan 12, 2018

#273 in Filesystem

Download history 2/week @ 2024-11-06 2/week @ 2024-12-04 3/week @ 2024-12-11 154/week @ 2025-01-08 8/week @ 2025-01-15

162 downloads per month

MIT license

2MB
2.5K SLoC

Contains (WOFF font, 400KB) NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2, (WOFF font, 190KB) docs/FiraSans-Medium.woff, (WOFF font, 185KB) docs/FiraSans-Regular.woff, (WOFF font, 135KB) FiraSans-Medium-8f9a781e4970d388.woff2, (WOFF font, 94KB) docs/SourceSerifPro-Bold.ttf.woff, (WOFF font, 89KB) docs/SourceSerifPro-Regular.ttf.woff and 10 more.

libstorage

Rust binding of LibStorageMgmt

LibStorageMgmt provides a set of API for programmatically manage their storage hardware in a vendor neutral way supporting these actions:

  • List storage pools, volumes, access groups, or file systems.

  • Create and delete volumes, access groups, file systems, or NFS exports.

  • Grant and remove access to volumes, access groups, or initiators.

  • Replicate volumes with snapshots, clones, and copies.

  • Create and delete access groups and edit members of a group.

  • List Linux local SCSI/ATA/NVMe disks.

  • Control IDENT/FAULT LED of local disk via SES(SCSI Enclosure Service).

To use LibStorageMgmt rust binding, you need:

Example code using simulator plugin

extern crate lsm;
use lsm::{Client, LsmError};
fn main() {
    let mut c: Client = match Client::new("sim://", None, None) {
        Ok(i) => i,
        Err(e) => {
            match e {
                // Error handling goes here
                LsmError::DaemonNotRunning(_) =>
                    panic!("Please start the libstoragemgmt daemon"),
                _ => panic!(e)
            };
        },
    };
    let syss = match c.systems() {
        Ok(i) => i,
        Err(e) => panic!(e)         // Please use error handling as above.
    };
    for s in syss {
        let cap = match c.capabilities(&s) {
            Ok(i) => i,
            Err(e) => panic!(e)     // Please use error handling as above.
        };
        if cap.is_supported(lsm::Capability::Volumes) {
            let vols = match c.volumes() {
                Ok(i) => i,
                Err(e) => panic!(e) // Please use error handling as above.
            };
            for vol in vols {
                println!("Got volume: {} {}", vol.name, vol.id);
            }
        }
    }
}

Dependencies

~4.5–7MB
~139K SLoC