From 44d89d1330dead9da7d1e77b91617cc501aae6ac Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sun, 27 Aug 2023 22:36:56 -0400 Subject: [PATCH] update CLI and docs --- docs/source/reference/running/api-publishing.rst | 8 ++++++-- wis2box-management/wis2box/data/__init__.py | 11 ++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/source/reference/running/api-publishing.rst b/docs/source/reference/running/api-publishing.rst index 738b5069..e8ea68aa 100644 --- a/docs/source/reference/running/api-publishing.rst +++ b/docs/source/reference/running/api-publishing.rst @@ -51,11 +51,15 @@ discovery metadata MCF created as described in the :ref:`discovery-metadata` sec wis2box data add-collection $WIS2BOX_DATADIR/data/config/foo/bar/baz/discovery-metadata.yml -To delete the colection from the API backend and configuration: + +Deleting a dataset +------------------ + +To delete a dataset from the API backend and configuration: .. code-block:: bash - wis2box api delete-collection foo.bar.baz + wis2box data delete-collection dataset-id .. note:: diff --git a/wis2box-management/wis2box/data/__init__.py b/wis2box-management/wis2box/data/__init__.py index 7f8bc073..c1385956 100644 --- a/wis2box-management/wis2box/data/__init__.py +++ b/wis2box-management/wis2box/data/__init__.py @@ -219,17 +219,14 @@ def add_collection(ctx, filepath, verbosity): @click.command() @click.pass_context -@click.option('--identifier', '-i', help='Collection identifier') +@click.argument('collection') @cli_helpers.OPTION_VERBOSITY -def delete_collection(ctx, identifier, verbosity): +def delete_collection(ctx, collection, verbosity): """Delete collection from API backend""" - if identifier is None: - raise click.ClickException('Missing -i/--identifier') + click.echo(f'Deleting collection: {collection}') - click.echo(f'Deleting collection: {identifier}') - - remove_collection(identifier) + remove_collection(collection) click.echo('Done')