From 060502af31ff77856cdadae335377557a52cceae Mon Sep 17 00:00:00 2001 From: Owen Littlejohns Date: Fri, 15 Sep 2023 01:36:30 -0400 Subject: [PATCH] DAS-1895 - Update README. --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 5497dfb..c7795b1 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,45 @@ umm_var = get_all_umm_var(var_info) export_all_umm_var_to_json(list(umm_var.values()), output_dir='local_dir') ``` +### End-to-end UMM-Var generation and publication: + +``` +from cmr import CMR_OPS +from varinfo import generate_collection_umm_var + +# Defaults to UAT, and not to publish: +umm_var_json = generate_collection_umm_var(, + ) + +# To use a production collection: +umm_var_json = generate_collection_umm_var(, + , + cmr_env=CMR_OPS) + +# To generate and publish records for a UAT collection (note the authorization +# header must contain a LaunchPad token): +umm_var_json = generate_collection_umm_var(, + , + publish=True) +``` + +Expected outputs: + +* `publish=False`, or not specifying a value will result in JSON output + containing the UMM-Var JSON for each identified variable. +* `publish=True` will return a list of strings. Each string is either the + concept ID of a new UMM-Var record, or a string including the full path of + a variable that failed to publish and the error messages returned from CMR. + +Native IDs for generated UMM-Var records will be of format: + +``` +- +``` + +For variables that are hierarchical, slashes will be converted to underscores, +to ensure the native ID is compatible with the CMR API. + ## Configuration file schema: The configuration file schema is defined as a JSON schema file in the `config`