in dataplex-quickstart-labs/00-resources/scripts/python/business-glossary-import/bg_import/utils.py [0:0]
def configure_export_v2_arg_parser(parser: argparse.ArgumentParser) -> None:
"""
Defines flags and parses arguments related to the export v2.
For the JSON export, we require a project, group, glossary,
location, and output JSON file path.
"""
glossary_argument_parser(parser)
parser.add_argument(
"--glossary-json",
help="Path to the JSON file to export the glossary entries data.",
metavar="[Output JSON file for glossary]",
type=str,
)
parser.add_argument(
"--entrylinks-json",
help="Path to the JSON file to export the glossary entry links data.",
metavar="[Output JSON file for entry links]",
type=str,
)
parser.add_argument(
"--export-mode",
choices=["glossary_only", "entry_links_only", "all"],
default="all",
type=str,
help=(
"Sets the export mode for the data:\n"
"glossary\tExport only the glossary entries to the specified JSON file.\n"
"entry_links\tExport only the entry links to the specified JSON file.\n"
"all\tExport both the glossary entries and entry links to the specified JSON files.\n"
)
)
parser.add_argument(
"--testing",
metavar="<true>",
type=lambda x: x.lower() == "true",
default=False,
help="If true, use staging environment instead of prod"
)