22 releases (11 breaking)

0.12.1 Apr 6, 2024
0.12.0 Mar 24, 2024
0.11.0 Mar 23, 2024
0.1.5 Dec 18, 2023

#203 in Asynchronous

Download history 6/week @ 2024-01-02 7/week @ 2024-01-16 5/week @ 2024-01-23 23/week @ 2024-01-30 1/week @ 2024-02-06 110/week @ 2024-02-13 124/week @ 2024-02-20 40/week @ 2024-02-27 107/week @ 2024-03-05 286/week @ 2024-03-12 288/week @ 2024-03-19 20/week @ 2024-03-26 190/week @ 2024-04-02 17/week @ 2024-04-09

525 downloads per month

MIT/Apache

250KB
7K SLoC

z_osmf

The VERY work in progress Rust z/OSMFTM [^1] Client.

Examples

List your datasets:

#[tokio::main]
async fn main() -> Result<(), z_osmf::Error> {
    let client = reqwest::Client::new();
    let base_url = "https://mainframe.my-company.com";

    let zosmf = z_osmf::ZOsmf::new(client, base_url);
    zosmf.login("USERNAME", "PASSWORD").await?;

    let my_datasets = zosmf
        .datasets()
        .list("USERNAME")
        .build()
        .await?;

    for dataset in my_datasets.items().iter() {
        println!("{}", dataset.name());
    }

    Ok(())
}

List the files in your home directory:

#[tokio::main]
async fn main() -> Result<(), z_osmf::Error> {
    let client = reqwest::Client::new();
    let base_url = "https://mainframe.my-company.com";

    let zosmf = z_osmf::ZOsmf::new(client, base_url);
    zosmf.login("USERNAME", "PASSWORD").await?;

    let my_files = zosmf
        .files()
        .list("/u/username")
        .build()
        .await?;

    for file in my_files.items().iter() {
        println!("{}", file.name());
    }

    Ok(())
}

List all active jobs:

#[tokio::main]
async fn main() -> Result<(), z_osmf::Error> {
    let client = reqwest::Client::new();
    let base_url = "https://mainframe.my-company.com";

    let zosmf = z_osmf::ZOsmf::new(client, base_url);
    zosmf.login("USERNAME", "PASSWORD").await?;

    let active_jobs = zosmf
        .jobs()
        .list()
        .owner("*")
        .active_only(true)
        .build()
        .await?;

    for job in active_jobs.items().iter() {
        println!("{}", job.name());
    }

    Ok(())
}

[^1]: z/OSMFTM, z/OSTM, and the lowercase letter zTM (probably) are trademarks owned by International Business Machines Corporation ("IBM"). This crate is not approved, endorsed, acknowledged, or even tolerated by IBM. (Please don't sue me, Big Blue)

Dependencies

~7–21MB
~290K SLoC