diff --git a/deepsearch/cps/cli/data_indices_typer.py b/deepsearch/cps/cli/data_indices_typer.py index ade0f569..acb22a4a 100644 --- a/deepsearch/cps/cli/data_indices_typer.py +++ b/deepsearch/cps/cli/data_indices_typer.py @@ -157,7 +157,7 @@ def upload_files( raise typer.Abort() coords = ElasticProjectDataCollectionSource(proj_key=proj_key, index_key=index_key) - utils.upload_files( + statuses = utils.upload_files( api=api, coords=coords, url=urls, @@ -165,6 +165,12 @@ def upload_files( s3_coordinates=cos_coordinates, ) + if all([status == "SUCCESS" for status in statuses]): + typer.echo("File upload completed successfully") + else: + # TODO + typer.echo("Some files did not upload successfully") + @app.command( name="add-attachment", help="Add attachment to a index item", no_args_is_help=True diff --git a/deepsearch/cps/data_indices/utils.py b/deepsearch/cps/data_indices/utils.py index 53058035..b3168be0 100644 --- a/deepsearch/cps/data_indices/utils.py +++ b/deepsearch/cps/data_indices/utils.py @@ -94,7 +94,7 @@ def process_url_input( ) print(success_message) - return + return statuses def process_local_file( @@ -160,7 +160,7 @@ def process_local_file( ) print(success_message) cleanup(root_dir=root_dir) - return + return statuses def process_external_cos( @@ -197,4 +197,4 @@ def process_external_cos( api=api, cps_proj_key=coords.proj_key, task_ids=task_ids ) print(success_message) - return + return statuses