Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Aliases

Aliases allow multiple pathnames to reference the same underlying record data. This is useful when a record needs to be accessible under different naming conventions.

Adding an Alias

#![allow(unused)]
fn main() {
// First, write a primary record
dss.write_ts("/BASIN/GAGE1/FLOW/01JAN2020/1HOUR/OBS/",
    &[100.0, 200.0, 300.0], "CFS", "INST-VAL")?;

// Create an alias that points to the same data
dss.alias_add(
    "/BASIN/GAGE1/FLOW/01JAN2020/1HOUR/OBS/",     // primary pathname
    "/ALTERNATE/NAME/FLOW/01JAN2020/1HOUR/ALIAS/",  // alias pathname
)?;
}

Python:

dss.alias_add("/BASIN/GAGE1/FLOW/01JAN2020/1HOUR/OBS/",
              "/ALTERNATE/NAME/FLOW/01JAN2020/1HOUR/ALIAS/")

Both pathnames now appear in the catalog and reference the same data.

Listing Aliases

#![allow(unused)]
fn main() {
let aliases = dss.alias_list()?;
for (alias_path, info_addr) in &aliases {
    println!("Alias: {alias_path} -> info at {info_addr}");
}
}

Removing an Alias

#![allow(unused)]
fn main() {
dss.alias_remove("/ALTERNATE/NAME/FLOW/01JAN2020/1HOUR/ALIAS/")?;
}

Removing an alias does not delete the primary record.