... | ... | @@ -3,12 +3,12 @@ To replicate an object, it is possible to |
|
|
2. invoke it
|
|
|
|
|
|
1) To define a rule that can be invoked by an iRODS icommand called [irule](https://docs.irods.org/master/icommands/user/#irule) means to create a file similar to this (call it, for example, test_rule.r):
|
|
|
|
|
|
```
|
|
|
Replication {
|
|
|
*source = /My/source/irods/path;
|
|
|
*destination = /My/destination/irods/path;
|
|
|
*registered = bool("true");
|
|
|
*recursive = bool("true");
|
|
|
*registered = "true";
|
|
|
*recursive = "true";
|
|
|
*status = EUDATReplication(*source, *destination, *registered, *recursive, *response);
|
|
|
if (*status) {
|
|
|
writeLine("stdout", "Success!");
|
... | ... | @@ -18,27 +18,27 @@ To replicate an object, it is possible to |
|
|
}
|
|
|
}
|
|
|
OUTPUT ruleExecOut
|
|
|
|
|
|
```
|
|
|
2) Then open a shell where the iRODS icommand are available and, after the initial authentication with [iinit](https://docs.irods.org/master/icommands/user/#iinit), type:
|
|
|
|
|
|
```
|
|
|
$ irule -F test_rule.r
|
|
|
Success!
|
|
|
|
|
|
```
|
|
|
If the output shows the response "Success!", it works.
|
|
|
|
|
|
Now assume that we want to check that the information stored in the PID registry is correct.
|
|
|
1. Get the PID of the source
|
|
|
2. Get the information of the 10320/LOC field of the pid record associated to the source's PID. It should contain the PID of the replica.
|
|
|
3. Get the information of the EUDAT/PPID field of the replica's PID. The PPID should be equal to the source's PID.
|
|
|
2. Get the information of the EUDAT/REPLICA field of the pid record associated to the source's PID. It should contain the PID of the replica.
|
|
|
3. Get the information of the EUDAT/PARENT field of the replica's PID. The EUDAT/PARENT should be equal to the source's PID.
|
|
|
|
|
|
If you have used a public [handle prefix](https://www.handle.net/prefix.html) for the PID, it is possible to get all those pieces of information through the web interface of the [handle resolution service](http://hdl.handle.net/). In case you have not, or you prefer to query the PID registry via the python client embedded in the B2SAFE, go to the _/opt/eudat/b2safe_ directory where you have just installed the B2SAFE package and try the following commands:
|
|
|
|
|
|
```
|
|
|
1) $ cmd/epicclient.py os conf/credentials search URL "irods://irods-hostname:irods-port/My/source/irods/path"
|
|
|
842/4676bcce-1ff2-11e5-9a45-fa163e62896a
|
|
|
|
|
|
2) $ cmd/epicclient.py os conf/credentials read --key 10320/LOC 842/4676bcce-1ff2-11e5-9a45-fa163e62896a
|
|
|
<locations><location href="irods://irods-hostname:irods-port/My/source/irods/path" id="0"/><location href="http://hdl.handle.net/842/db9fbd72-a8a1-11e5-9ae1-fa163e62896a" id="1"/></locations>
|
|
|
2) $ cmd/epicclient.py os conf/credentials read --key EUDAT/REPLICA 842/4676bcce-1ff2-11e5-9a45-fa163e62896a
|
|
|
842/db9fbd72-a8a1-11e5-9ae1-fa163e62896a
|
|
|
|
|
|
3) $ cmd/epicclient.py os conf/credentials read --key EUDAT/PPID 842/db9fbd72-a8a1-11e5-9ae1-fa163e62896a
|
|
|
3) $ cmd/epicclient.py os conf/credentials read --key EUDAT/PARENT 842/db9fbd72-a8a1-11e5-9ae1-fa163e62896a
|
|
|
842/4676bcce-1ff2-11e5-9a45-fa163e62896a
|
|
|
|
|
|
``` |