z_osmf

Crates.ioz_osmf
lib.rsz_osmf
version0.13.4
sourcesrc
created_at2023-12-16 17:11:46.140669
updated_at2024-11-02 15:47:14.925909
descriptionThe Rust z/OSMF Client
homepagehttps://crates.io/crates/z_osmf
repositoryhttps://github.com/wmcgee3/z_osmf-rs
max_upload_size
id1071871
size372,341
Billy McGee (wmcgee3)

documentation

https://docs.rs/z_osmf

README

z_osmf

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

Examples

List your datasets:

#[tokio::main]
async fn main() -> z_osmf::Result<()> {
    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() -> z_osmf::Result<()> {
    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() -> z_osmf::Result<()> {
    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(())
}

Footnotes

  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)

Commit count: 74

cargo fmt