Crates.io | scst |
lib.rs | scst |
version | 0.3.3 |
source | src |
created_at | 2024-10-16 07:08:01.178941 |
updated_at | 2024-10-18 06:28:28.460537 |
description | iscsi-scst user interface implemention by rust |
homepage | |
repository | https://github.com/vine-io/scst-rs |
max_upload_size | |
id | 1411378 |
size | 73,914 |
Scst is iscsi-scst user interface implemention by rust.
use scst::{Scst, Options}
fun main() {
let mut scst = Scst::init()?;
scst.add_device(
"vdisk_blockio",
"vol",
"/dev/zvol/tank/vol",
&Options::new(),
)?;
let target = scst
.iscsi_mut()
.add_target("iqn.2018-11.com.vine:vol", &Options::new())?;
target.enable()?;
let group = target.create_ini_group("vol")?;
group.add_lun("vol", 0, &Options::new())?;
group.add_initiator("iqn.1988-12.com.oracle:d4ebaa45254b")?;
let handlers = scst.handlers();
let s = serde_yml::to_string(handlers)?;
println!("{}", s);
let targets = scst.iscsi().targets();
let s = serde_yml::to_string(targets)?;
println!("{}", s);
let tgt = scst
.iscsi()
.get_target("iqn.2018-11.com.vine:vol")
.unwrap();
let stat = serde_yml::to_string(&tgt.io_stat()?)?;
println!("target stat: {}", stat);
let sessions = serde_yml::to_string(&tgt.sessions()?)?;
println!("target session: {}", sessions);
}