Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/commands/datasetArchiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import (
)

var datasetArchiverCmd = &cobra.Command{
Use: "datasetArchiver [options] (ownerGroup | space separated list of datasetIds)",
Short: "Archives all datasets in state datasetCreated from a given ownerGroup",
Aliases: []string{"a", "archive"},
Use: "datasetArchiver [options] (ownerGroup | space separated list of datasetIds)",
Short: "Archives all datasets in state datasetCreated from a given ownerGroup",
Long: `Tool to archive datasets to the data catalog.

You must choose either an ownerGroup, in which case all archivable datasets
of this ownerGroup not yet archived will be archived.
Or you choose a (list of) datasetIds, in which case all archivable datasets
of this list not yet archived will be archived.
of this list not yet archived will be archived.

For further help see "` + MANUAL + `"`,
Run: func(cmd *cobra.Command, args []string) {
Expand Down
7 changes: 4 additions & 3 deletions cmd/commands/datasetCleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
)

var datasetCleanerCmd = &cobra.Command{
Use: "datasetCleaner [options] datasetPid",
Short: "Remove dataset from archive and optionally from data catalog",
Aliases: []string{"c", "clean"},
Use: "datasetCleaner [options] datasetPid",
Short: "Remove dataset from archive and optionally from data catalog",
Long: `Tool to remove datasets from the data catalog.

If Datablock entries exist for a given dataset, a reset job will be launched.

If the Dataset should be removed from the data catalog, the corresponding
Expand Down
7 changes: 4 additions & 3 deletions cmd/commands/datasetGetProposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import (
)

var datasetGetProposalCmd = &cobra.Command{
Use: "datasetGetProposal [options] ownerGroup",
Short: "Returns the proposal information for a given ownerGroup",
Aliases: []string{"proposal"},
Use: "datasetGetProposal [options] ownerGroup",
Short: "Returns the proposal information for a given ownerGroup",
Long: `Tool to retrieve proposal information for a given ownerGroup.

For further help see "` + MANUAL + `"`,
Args: exactArgsWithVersionException(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/commands/datasetIngestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
)

var datasetIngestorCmd = &cobra.Command{
Use: "datasetIngestor",
Short: "Define and add a dataset to the SciCat datacatalog",
Aliases: []string{"i", "ingest"},
Use: "datasetIngestor",
Short: "Define and add a dataset to the SciCat datacatalog",
Long: `Purpose: define and add a dataset to the SciCat datacatalog

This command must be run on the machine having access to the data
Expand Down
5 changes: 3 additions & 2 deletions cmd/commands/datasetRetriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (
)

var datasetRetrieverCmd = &cobra.Command{
Use: "datasetRetriever (options) local-destination-path",
Short: "Retrieve datasets from intermediate cache, taking into account original sourceFolder names",
Aliases: []string{"r", "retrieve"},
Use: "datasetRetriever (options) local-destination-path",
Short: "Retrieve datasets from intermediate cache, taking into account original sourceFolder names",
Long: `Tool to retrieve datasets from the intermediate cache server of the tape archive to the
destination path on your local system.

Expand Down
7 changes: 4 additions & 3 deletions cmd/commands/globusCheckTransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import (
)

var globusCheckTransfer = &cobra.Command{
Use: "globusCheckTransfer [options] (transfer_task_id transfer_task_id ...)",
Short: "Checks whether a list of Globus transfers has finished",
Aliases: []string{"gct"},
Use: "globusCheckTransfer [options] (transfer_task_id transfer_task_id ...)",
Short: "Checks whether a list of Globus transfers has finished",
Long: `Tool for checking whether a list of Globus transfers has finished

You must have a Globus account with access to the desired transfers. Optionally,
you can save
you can save

For further help see "` + MANUAL + `"`,
Args: minArgsWithVersionException(1),
Expand Down
9 changes: 5 additions & 4 deletions cmd/commands/waitForJobFinished.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (
)

var waitForJobFinishedCmd = &cobra.Command{
Use: "waitForJobFinished (options)",
Short: "Waits for job to be finished",
Long: `This script polls the status of a given job and returns when Job is finished`,
Args: cobra.NoArgs,
Aliases: []string{"w", "wait"},
Use: "waitForJobFinished (options)",
Short: "Waits for job to be finished",
Long: `This script polls the status of a given job and returns when Job is finished`,
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
// consts & vars
var client = &http.Client{
Expand Down
37 changes: 15 additions & 22 deletions migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ the new version.

| Old command | New command |
| -------------------------- | --------------- |
| datasetIngestor | scicat ingest |
| datasetRetriever | scicat retrieve |
| datasetArchiver | scicat archive |
| datasetCleaner | scicat clean |
| datasetGetProposal | scicat proposal |
| datasetIngestor | scicat-cli ingest |
| datasetRetriever | scicat-cli retrieve |
| datasetArchiver | scicat-cli archive |
| datasetCleaner | scicat-cli clean |
| datasetGetProposal | scicat-cli proposal |
| datasetPublishData | _deprecated_ |
| datasetPublishDataRetrieve | _deprecated_ |
| waitForJobFinished | scicat wait |
| waitForJobFinished | scicat-cli wait |

Old commands are also valid aliases for subcommands (eg `scicat-cli datasetIngestor`).

## Command line options

Expand All @@ -45,16 +47,7 @@ Both the old command using the `flags` parser and new command using the `cobra`

```diff
- datasetIngestor metadata.json
+ scicat ingest metadata.json
```

#### Full ingestion command

Note that `--autoarchive` is now default.

```diff
- datasetIngestor -token $SCICAT_TOKEN -ingest -autoarchive metadata.json
+ scicat ingest --token $SCICAT_TOKEN --ingest metadata.json
+ scicat-cli ingest metadata.json
```

#### Ingestion with file listing
Expand All @@ -63,7 +56,7 @@ Note that `--autoarchive` is now default.

```diff
- datasetIngestor metadata.json filelisting.txt
+ scicat ingest --filelist filelisting.txt metadata.json
+ scicat-cli ingest --filelist filelisting.txt metadata.json
```

#### Multi-dataset ingestion using folder listing
Expand All @@ -74,7 +67,7 @@ implemented with a short shell loop.

```diff
- datasetIngestor metadata.json folderlisting.txt
+ while read folder; do scicat ingest --no-interactive -DsourceFolder="$folder" metadata.json; done <folderlisting.txt
+ while read folder; do scicat-cli ingest --no-interactive -DsourceFolder="$folder" metadata.json; done <folderlisting.txt
```

This takes advantage of the `-D` flag to override the sourceFolder for each dataset.
Expand All @@ -88,7 +81,7 @@ This lists datasets which have been successfully retrieved from tape (eg by sele

```diff
- datasetRetriever -token $SCICAT_TOKEN destination/
+ scicat retrieve --token $SCICAT_TOKEN
+ scicat-cli retrieve --token $SCICAT_TOKEN
```

#### Retrieve a single dataset
Expand All @@ -98,19 +91,19 @@ the destination.

```diff
- datasetRetriever -token $SCICAT_TOKEN -retrieve -dataset PID destination/
+ scicat retrieve --token $SCICAT_TOKEN -C destination/ --no-strip-path PID
+ scicat-cli retrieve --token $SCICAT_TOKEN -C destination/ --no-strip-path PID
```

#### Retrieve all available datasets

```diff
- datasetRetriever -token $SCICAT_TOKEN -retrieve destination/
+ scicat retrieve --token $SCICAT_TOKEN -C destination/ --no-strip-path --all
+ scicat-cli retrieve --token $SCICAT_TOKEN -C destination/ --no-strip-path --all
```

#### Retrieve datasets with a given ownerGroup

```diff
- datasetRetriever -retrieve -ownergroup unx-group destination/
+ scicat retrieve -C destination/ --no-strip-path --filter ownerGroup==unx-group
+ scicat-cli retrieve -C destination/ --no-strip-path --filter ownerGroup==unx-group
```