Skip to content

Commit

Permalink
add usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjiangshu committed Sep 3, 2024
1 parent 942cd18 commit 76763c9
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions sda-admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# sda-admin

`sda-admin` is a command-line tool for managing sensitive data archives. It provides functionalities to list users and files, ingest and set accession IDs for files, and create or release datasets.

## General Usage

```sh
sda-admin [-uri URI] [-token TOKEN] <command> [options]
```

## Global Options
- `-uri URI`
Set the URI for the API server (optional if the environmental variable `API_HOST` is set).
- `-token TOKEN`
Set the authentication token (optional if the environmental variable `ACCESS_TOKEN` is set).

## List all users

Use the following command to return all users with active uploads as a JSON array
```sh
sda-admin list users
```

## List all files, optionally filtered by a specific user.

Use the following command to return all files belonging to the user associated with the token

```sh
sda-admin list files
```

Use the following command to return all files belonging to the specified user `[email protected]`
```sh
sda-admin list files -user [email protected]
```

## Ingest a file

Use the following command to trigger the ingesting of a given file `/path/to/file.c4gh` that belongs to the user `[email protected]`

```sh
sda-admin file ingest -filepath /path/to/file.c4gh -user [email protected]
```

## Assign an accession ID to a file

Use the following command to assign an accession ID `my-accession-id-1` to a given file `/path/to/file.c4gh` that belongs to the user `[email protected]`

```sh
sda-admin file accession -filepath /path/to/file.c4gh -user [email protected] -accession-id my-accession-id-1
```

## Create a dataset from a list of accession IDs and the dataset ID

Use the following command to create a dataset `dataset001` from accession IDs `my-accession-id-1` and `my-accession-id-2`

```sh
sda-admin dataset create -dataset-id dataset001 my-accession-id-1 my-accession-id-2
```


## Release a dataset for downloading

Use the following command to release the dataset `dataset001` for downloading

```sh
sda-admin dataset release -dataset-id dataset001
```

## Show version information

Use the following command to show the version information for sda-admin.

```sh
sda-admin version
```

## Help

For detailed usage information about specific commands or options, use:

```sh
sda-admin help <command>
```

### Examples

To get help on the list command:
```sh
sda-admin help list
```

To get help on the file ingest command:

```sh
sda-admin help file ingest
```

To get help on the dataset create command:

```sh
sda-admin help dataset create
```

0 comments on commit 76763c9

Please sign in to comment.