diff --git a/src/dsp_tools/cli/call_action.py b/src/dsp_tools/cli/call_action.py index 5351fc45f..b3fcb37a7 100644 --- a/src/dsp_tools/cli/call_action.py +++ b/src/dsp_tools/cli/call_action.py @@ -156,6 +156,7 @@ def _call_ingest_xmlupload(args: argparse.Namespace) -> bool: password=args.password, dsp_url=args.server, sipi_url=args.sipi_url, + dump=args.dump, ) return True diff --git a/src/dsp_tools/cli/create_parsers.py b/src/dsp_tools/cli/create_parsers.py index d04427089..70df14294 100644 --- a/src/dsp_tools/cli/create_parsers.py +++ b/src/dsp_tools/cli/create_parsers.py @@ -194,6 +194,7 @@ def _add_ingest_xmlupload( subparser.add_argument("-s", "--server", default=default_dsp_api_url, help=dsp_server_text) subparser.add_argument("-u", "--user", default=root_user_email, help=username_text) subparser.add_argument("-p", "--password", default=root_user_pw, help=password_text) + subparser.add_argument("-d", "--dump", action="store_true", help="write every request to DSP-API/SIPI into a file") subparser.add_argument("xml_file", help="path to XML file containing the data") diff --git a/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py b/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py index 5dc147333..f4cf762d1 100644 --- a/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py +++ b/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py @@ -8,7 +8,7 @@ get_mapping_dict_from_file, replace_filepath_with_sipi_id, ) -from dsp_tools.commands.xmlupload.upload_config import UploadConfig +from dsp_tools.commands.xmlupload.upload_config import DiagnosticsConfig, UploadConfig from dsp_tools.commands.xmlupload.xmlupload import xmlupload from dsp_tools.models.exceptions import InputError from dsp_tools.utils.create_logger import get_logger @@ -23,6 +23,7 @@ def ingest_xmlupload( password: str, dsp_url: str, sipi_url: str, + dump: bool = False, ) -> None: """ This function reads an XML file @@ -38,6 +39,7 @@ def ingest_xmlupload( password: the user's password for login into DSP dsp_url: URL to the DSP server sipi_url: URL to the Sipi server + dump: if True, write every request to DSP-API/SIPI into a file Raises: InputError: if any media was not uploaded or uploaded media was not referenced. @@ -66,5 +68,5 @@ def ingest_xmlupload( password=password, imgdir=".", sipi=sipi_url, - config=UploadConfig(media_previously_uploaded=True), + config=UploadConfig(media_previously_uploaded=True, diagnostics=DiagnosticsConfig(dump=dump)), )