... | ... | @@ -28,8 +28,8 @@ As described in the “Example Workflow” section, the iRODS rules will trigger |
|
|
# Configuration
|
|
|
There are two major scripts for the B2SHARE connection component b2shareclientCLI.py and create_md_file.py that are using the configuration file “b2share_client.json”. If the configurations
|
|
|
It consists of 3 parts. The first two sections `logging` and `b2share_http_api` are prefilled with default values.
|
|
|
* `logging` - with 2 values needed to be specified: log level, default is **"loglevel": "DEBUG"**, and the file where to safe the logging information, default value is **"logfile": "/opt/eudat/b2safe/log/b2share_connection_client.log"**, so in a file named b2share_connection_client.log in folder log under the installation path.
|
|
|
* `b2share_http_api` - with 1 value needed to be specified: host_name of the B2SHARE instance, default is the address of the training instance of B2SHARE **"host_name": "https://trng-b2share.eudat.eu/"**. Do not change the attribute **"access_parameter": "?access_token"** or any other attributes of `b2share_http_api`. It is a part of the string needed to build the URL for the B2SHARE HTTP API and need to be changed only if the B2SHARE HTTP API will change.
|
|
|
* `logging` - with 2 values needed to be specified: log level, default is `"loglevel": "DEBUG"`, and the file where to safe the logging information, default value is `"logfile": "/opt/eudat/b2safe/log/b2share_connection_client.log"`, so in a file named b2share_connection_client.log in folder log under the installation path.
|
|
|
* `b2share_http_api` - with 1 value needed to be specified: host_name of the B2SHARE instance, default is the address of the training instance of B2SHARE `"host_name": "https://trng-b2share.eudat.eu/"`. Do not change the attribute `"access_parameter": "?access_token"` or any other attributes of `b2share_http_api`. It is a part of the string needed to build the URL for the B2SHARE HTTP API and need to be changed only if the B2SHARE HTTP API will change.
|
|
|
* `irods` - connection information of the iRODS instance like the name of the iRODS zone `"zone_name": "YOUR_ZONE"` and `"irods_env": "/home/irods/.irods/irods_environment.json"`.
|
|
|
|
|
|
# Example Workflow
|
... | ... | @@ -70,7 +70,7 @@ Following assumptions were made: |
|
|
# The rule will call the methods of the python script **b2shareclientCLI.py** to execute the workflow, this methods can also be called directly.
|
|
|
|
|
|
The B2SAFE B2SHARE client has 3 major functions: draft, meta, publish; to create a draft, add metadata to and publish it. Further it has helping functions to list all names of communities available in B2SHARE, to get the schema of a community, to understand possible key value pairs of metadata file user has to fill, to get a specific draft to check it before publishing and to delete a draft if it is not correct.
|
|
|
The arguments that are needed to be specified for every call are the **--collection_path** the path to the collection in B2SAFE to operate on and the **--user** name of the user in iRODS, to get the B2SHARE access token of the user from his meta data.
|
|
|
The arguments that are needed to be specified for every call are the `--collection_path` the path to the collection in B2SAFE to operate on and the `--user` name of the user in iRODS, to get the B2SHARE access token of the user from his meta data.
|
|
|
The script has to be executed by a linux user that is the same user in iRODS who is owning the collection.
|
|
|
```
|
|
|
e.g.
|
... | ... | @@ -112,15 +112,15 @@ optional arguments: |
|
|
Depending on what function is called further options are needed to be specified.
|
|
|
```
|
|
|
e.g.
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v draft -t "Test publication 10" -comm EUDAT
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v compare_meta -idc 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v meta -rid 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v -d publish -pubid 00some00B2SHARE00record00id00
|
|
|
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v listCommunities
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v communitySchema -comm_name EUDAT
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v getDraft -di 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /JULK_ZONE/home/irods/collection_A -v -d deleteDraft -ddi 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v draft -t "Test publication 10" -comm EUDAT
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v compare_meta -idc 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v meta -rid 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v -d publish -pubid 00some00B2SHARE00record00id00
|
|
|
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v listCommunities
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v communitySchema -comm_name EUDAT
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v getDraft -di 00some00B2SHARE00record00id00
|
|
|
python3 b2shareclientCLI.py -u irods -p /ZONE/home/irods/collection_A -v -d deleteDraft -ddi 00some00B2SHARE00record00id00
|
|
|
```
|
|
|
|
|
|
To add some describing meta data to the collection of files, the user want to publish on B2SHARE, it is possible to add a metadata file directly into the collection before triggering the publication process.
|
... | ... | @@ -128,7 +128,7 @@ This file needs to be written in a specific way so it can be processed by the ** |
|
|
The script **create_md_file.py** can help one to create such a file for specified community. It is requesting the schema of the community and saves optional and required options. The user needs then fill the values (only the values) in for the options he wants to be saved in the meta data of the draft.
|
|
|
```
|
|
|
e.g. with -d dry run option that will print the resulting file content to the console and will not create the file in the collection
|
|
|
python3 create_md_file.py -u irods -p /JULK_ZONE/home/irods/collection_A -v -d -comm EUDAT
|
|
|
python3 create_md_file.py -u irods -p /ZONE/home/irods/collection_A -v -d -comm EUDAT
|
|
|
```
|
|
|
|
|
|
An example of a generated meta data file **b2share_metadata.json** for EUDAT community schema filled with some fake values in correct JSON format.
|
... | ... | |