Skip to content

Latest commit

 

History

History
84 lines (60 loc) · 3.25 KB

README.md

File metadata and controls

84 lines (60 loc) · 3.25 KB

broker-cmdline-client

Java-based command line client to access notification records from the OpenAIRE Broker public API (Swagger documentation). Click here for more information about the OpenAIRE Broker Service.

The client will store the requested notification records in your file system in json files. One file per subscription, each containing a json array (one item per notification record). The files can be optionally saved in compressed format (i.e. as .json.gz).

The produced files can be used as input to the Data correction service for DSpace7/DSpace-CRIS 7 developed by 4Science in the context of the OpenAIRE-Advance Open Innovation Call.

Full documentation, github links and installation instructions of the Data correction service are available here.

Compilation requirements

  • git client
  • Java 1.8
  • Maven 3.6.0 (or above)

Compilation instructions

git clone https://github.com/openaire/broker-cmdline-client.git                                                                                                   
Cloning into 'broker-cmdline-client'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.

cd broker-cmdline-client/
mvn package

The compiled binaries will be available under the target subdirectory of each module. In particular the executable JAR will be available under:

./broker-cmdline/target

In UNIX-like systems the client binary can be executed with

./broker-cmdline-client-[VERSION].jar 

In Windows systems the client binary can be executed with

java -jar ./broker-cmdline-client-[VERSION].jar 

Client synopsis

===================================
OpenAIRE Broker - Public API Client
===================================

usage: ./broker-cmdline-client.jar [-bu <arg>] [-h] [-i] -o <arg> -u <arg> [-v] [-vv]
        [-z]
-bu,--baseurl <arg>   override of the default Broker Public Api baseUrl
-h,--help             help
-i                    interactive mode
-o,--output <arg>     the output directory (REQUIRED)
-u,--user <arg>       the email of the subscriber (REQUIRED)
-v                    verbose
-vv                   show debug logs
-z                    compress the output files in GZIP format

See http://api.openaire.eu/broker for further details.

Important: the email of the subscriber must correspond to the email associated to the OpenAIRE account used to create the subscriptions on provide.openaire.eu

Example usage

./broker-cmdline-client-[VERSION].jar -u [email protected] -i -z  -o /tmp/broker 

The command above performs the following actions

  • lists all the subscriptions associated with the given user email
  • for each subscription id asks for configurmation in interactive mode (-i) and
  • produces a gzip compressed JSON file (-z)
  • stored in the given output path (-o)