Skip to content

Commit

Permalink
update CLI and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Aug 28, 2023
1 parent fec33ce commit 44d89d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 6 additions & 2 deletions docs/source/reference/running/api-publishing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
11 changes: 4 additions & 7 deletions wis2box-management/wis2box/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 44d89d1

Please sign in to comment.