... | ... | @@ -70,5 +70,77 @@ Following assumptions were made: |
|
|
* the collections are copied and published just one time, even if the rule to publish them is executed multiple times.
|
|
|
|
|
|
# Available functions of the python scripts
|
|
|
The B2SAFE B2SHARE client has 3 major functions draft, meta, pub to create a draft, add metadata to it and publish it. Further it as helping functions to list all available communities, 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 needed to be specified for every call are the **--confpath** the path to the configuration file for the b2shareclient.py and the **--userName** name if the user in iRODS, to get the B2SHARE access token of the user from his meta data.
|
|
|
```
|
|
|
python b2shareclient.py -h
|
|
|
usage: b2shareclient.py [-h] [--confpath CONFPATH] [-dbg] [-d] [-u USERNAME]
|
|
|
{draft,meta,pub,listCommunities,communitySchema,getDraft,deleteDraft}
|
|
|
B2SAFE B2SHARE client
|
|
|
positional arguments:
|
|
|
{draft,meta,pub,listCommunities,communitySchema,getDraft,deleteDraft}
|
|
|
sub-command help
|
|
|
draft create a draft record in B2Share
|
|
|
meta add metadata to the draft
|
|
|
pub publish the draft
|
|
|
listCommunities list all communities with their names and id's
|
|
|
communitySchema get community schema
|
|
|
getDraft get draft and if there write it to the log file
|
|
|
deleteDraft delete the draft
|
|
|
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
--confpath CONFPATH path to the configuration file
|
|
|
-dbg, --debug enable debug
|
|
|
-d, --dryrun run without performing any real change
|
|
|
-u USERNAME, --userName USERNAME iRODS user name
|
|
|
```
|
|
|
Depending on what function is called further options are needed to be specified.
|
|
|
```
|
|
|
python b2shareclient.py draft -h
|
|
|
usage: b2shareclient.py draft [-h] (-c COMMUNITYNAME | -i COMMUNITYID) [-ti TITLE] -cp COLLECTIONPATH
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-c COMMUNITYNAME, --communityName COMMUNITYNAME B2Share community name
|
|
|
-i COMMUNITYID, --communityID COMMUNITYID B2Share community id
|
|
|
-ti TITLE, --title TITLE title of the record
|
|
|
-cp COLLECTIONPATH, --collectionPath COLLECTIONPATH path to the collection in iRODS with files
|
|
|
|
|
|
python b2shareclient.py meta -h
|
|
|
usage: b2shareclient.py meta [-h] -id RECORD_ID -md METADATA
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-id RECORD_ID, --record_id RECORD_ID the b2share id of the record
|
|
|
-md METADATA, --metadata METADATA path to the metadata JSON file of the record
|
|
|
|
|
|
python b2shareclient.py pub -h
|
|
|
usage: b2shareclient.py pub [-h] -pi REC_ID
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-pi REC_ID, --rec_id REC_ID the b2share id of the record
|
|
|
|
|
|
python b2shareclient.py listCommunities -h
|
|
|
usage: b2shareclient.py listCommunities [-h]
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
|
|
|
python b2shareclient.py communitySchema -h
|
|
|
usage: b2shareclient.py communitySchema [-h] (-cn COMMNAME | -ci COMMID)
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-cn COMMNAME, --commName COMMNAME B2Share community name
|
|
|
-ci COMMID, --commID COMMID B2Share community id
|
|
|
|
|
|
python b2shareclient.py getDraft -h
|
|
|
usage: b2shareclient.py getDraft [-h] -di DRAFT_ID
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-di DRAFT_ID, --draft_id DRAFT_ID the b2share id of the record
|
|
|
|
|
|
python b2shareclient.py deleteDraft -h
|
|
|
usage: b2shareclient.py deleteDraft [-h] -ddi DRAFT_TO_DELETE_ID
|
|
|
optional arguments:
|
|
|
-h, --help show this help message and exit
|
|
|
-ddi DRAFT_TO_DELETE_ID, --draft_to_delete_id DRAFT_TO_DELETE_ID the b2share id of the record
|
|
|
```
|
|
|
|
|
|
# iRODS rules |
|
|
\ No newline at end of file |