-
Notifications
You must be signed in to change notification settings - Fork 1
Introduce new structure and output format #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…o feature/restructure-postman
sven1103
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KochTobi thank you for your big refactor.
I have one big concern though: the list command has now changed completely, and that was not the request. The legacy output needed to be preserved in the minor version upgrade, otherwise we are not providing a pleasant user experience for power users that have downstream application dependencies on the output.
This PR violates our semantic versioning policy, and the intention was not to upgrade to a new major version.
So I kindly ask you to implement the legacy behavior of the list command and introduce the flat option as requested in the Jira issue.
|
Hi @sven1103 |
Add whitespace between file size and unit
qPostman
A Java command line tool to download datasets from QBiC.
A client software written in Java for dataset downloads from QBiC's data management system openBIS (https://wiki-bsse.ethz.ch/display/bis/Home).
We are making use of the V3 API of openBIS (https://wiki-bsse.ethz.ch/display/openBISDoc1605/openBIS+V3+API) in order to interact with the data management system from command line, in order to provide a quick data retrieval on server or cluster resources, where the download via the qPortal is impractical.
How to run
Download
You can download the compiled and executable Java binaries as JAR of postman from the GitHub release page: https://github.com/qbicsoftware/postman-cli/releases.
If you want to build from source, checkout the commit of your choice and execute
mvn clean package. We only recommend this if you are familiar with Java build systems though, as we cannot give you support here. In the normal case, the binary of a stable release is sufficient.Requirements
You need to have Java JRE or JDK installed (openJDK is fine), at least version 17. And the client's host must have allowance to connect to the server, which is determined by our firewall settings. If you are unsure, if your client is allowed to connect, contact us at [email protected].
Configuration
Postman uses picocli file arguments. Therefore, a config file has to be passed with the '@' prefix to its path:
Example:
The structure of the configuration file is:
For example: To set the ApplicationServerURL to another URL we have to use:
-as [URL]To use our openBIS URL we write the following lines in the config file:
(Anything beginning with '#' is a comment)
A default file is provided here: default-config.
How to use
Options
Just execute the following command to get an overview over the available options.
Printed file sizes
File sizes printed by postman Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte use base 2.
How to specify your log directory
By default postman will create log files in a directory
./logs/in your working directory.You can specify where logs are written by setting the system property
log.pathto the desired directory.How to provide your credentials
After gaining access by applying through [email protected], you can log in using your credentials.
The username is provided by us or if you have a uni-tuebingen account by the university of tuebingen.
Provide your username:
Use the option
-u / --userto provide us with your username.Provide your password:
Please never send your password over email. We will never ask you for it!
When using the application, you can either:
--password--password:prop my.awesome.property--password:env MY_PASSWORDHow to provide QBiC identifiers
To specify which data you want to list or download, you need to provide us with QBiC identifiers.
A QBiC project identifier begins with
Qfollowed by four characters (QTEST). QBiC sample identifiers contain their project identifier.You can provide identifiers either using the command line directly:
java -jar postman.jar QSTTSABCD01 QSTTSABCD02 QSTTSABCDE4 NGSQSTTS0012 "QTEST*"Please note: When you use the
*character to search for all files in a project, escape your identifier using quotation marks.Provide identifiers using a file:
You can provide identifiers using a file containing the identifiers. Lines starting with
#are ignored.How to filter files by suffix
Both the
downloadand thelistcommand allow you to filter files by their suffix. The suffixes provided are not case-sensitive..TXTand.txtwill have the same effect.Multiple suffixes can be provided separated by a comma. A suffix does not have to be the file ending but can be any substring from the end of a files name.
If you only want to download
fastqandfastq.gzfiles you can run postman withlistUsage: postman-cli list [-hV] [--exact-filesize] [--with-checksum] [--without-header] [--format=<outputFormat>] -u=<user> [-s=<suffix>[,<suffix>...]]... (--password: env=<environment-variable> | --password: prop=<system-property> | --password) (-f=<filePath> | SAMPLE_IDENTIFIER...) Description: lists all the datasets found for the given identifiers Parameters: SAMPLE_IDENTIFIER... one or more QBiC sample identifiers Options: --password:env=<environment-variable> provide the name of an environment variable to read in your password from --password:prop=<system-property> provide the name of a system property to read in your password from --password please provide your password -u, --user=<user> openBIS user name -f, --file=<filePath> a file with line-separated list of QBiC sample ids -s, --suffix=<suffix>[,<suffix>...] only include files ending with one of these (case-insensitive) suffixes --with-checksum list the crc32 checksum for each file --exact-filesize use exact byte count instead of unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte --format=<format> The format to list files in. Case-insensitive. Possible values: LEGACY, TSV Default: LEGACY --without-header remove the header line from the output. Only takes effect for tabular output formats. -h, --help Show this help message and exit. -V, --version Print version information and exit. Optional: specify a config file by running postman with '@/path/to/config.txt'. A detailed documentation can be found at https://github.com/qbicsoftware/postman-cli#readme.The
listcommand comes with some special options. You can change how your output looks by--exact-filesize--without-header--with-checksumTSVformatLEGACYformatdownloadUsage: postman-cli download [-hV] [-o=<outputPath>] -u=<user> [-s=<suffix>[, <suffix>...]]... (--password: env=<environment-variable> | --password: prop=<system-property> | --password) (-f=<filePath> | SAMPLE_IDENTIFIER...) Description: Download data from QBiC. Parameters: SAMPLE_IDENTIFIER... one or more QBiC sample identifiers Options: --password:env=<environment-variable> provide the name of an environment variable to read in your password from --password:prop=<system-property> provide the name of a system property to read in your password from --password please provide your password -u, --user=<user> openBIS user name -f, --file=<filePath> a file with line-separated list of QBiC sample ids -s, --suffix=<suffix>[,<suffix>...] only include files ending with one of these (case-insensitive) suffixes -o, --output-dir=<outputPath> specify where to write the downloaded data -h, --help Show this help message and exit. -V, --version Print version information and exit. Optional: specify a config file by running postman with '@/path/to/config.txt'. A detailed documentation can be found at https://github.com/qbicsoftware/postman-cli#readme.The
downloadcommand allows you to download data from our storage to your machine.Use the
--output-diroption to specify a location on your client the location will be interpreted relative to your working directory.File integrity check
Postman computes the CRC32 checksum for all input streams using the native Java utility class CRC32. Postman favors
CheckedInputStreamover the traditional InputStream, and promotes the CRC checksum computation.
Computed CRC32 checksums are compared with CRC32 checksum stored on our servers.
When the checksum does not match, then the download failed. Each download is attempted multiple times.
When all attempts fail, the mismatching checksum is recorded in your log directory in the
checksum-mismatch.logfile.The
checksum-mismatch.logfile contains one line for each file that was not downloaded.In addition, Postman writes the CRC32 checksum in an additional file
<file-name-of-checked-file>.crc32and stores it together with the according file.Advanced Options
posmtan-Dlog.path: provide the log directory-Dlog.level: provide the log level to use for logging--source-sample-type <sample-type>: specify which sample type to consider as source sample type.--server-timeout <millis>: the server timeout in milli secondsdownload--download-attempts <download-attempts>provide the maximal amount attempted downloads--buffer-size <buffer-size>provide a custom buffer size. Please only specify values that are a multiple of1024.