As explained above rules are composed of calls to other rules or micro-services. A micro-service is a "unit of work" in iRODS: it represents the simplest, atomic operation. We have seen that the iRODS provides a comprehensive set of such micro-services, for instance to calculate the checksum or replicate the data. From the provided micro-services quite complex workflows can be build to reflect complex data management policies. Furthermore it is possible to extend iRODS by defining (check project documentation for details own micro-services).

When additional functionality is required in iRODS there are at least three possible options to provide it:

  • native iRODS modules written in C
  • embedPython iRODS module allows to define micro-services in Python
  • external scripts can be called by msiExecCmd micro-service

For security reasons embedPython should be avoided in the production-ready deployments.

An example usage of msiExecCmd micro-service in a rule is listed below.

testexec.r

testExecCmd () { msiExecCmd("myyscript.sh","args args2","null","null","null",*OUT); } INPUT null OUTPUT null

This very simple rule calls a script called myscript.sh and provides it with arguments args args2. For the security reasons only scripts located in server/bin/cmd/ directory in the iRODS server can be run in this way.

When using msiExecCmd it is quite easy possible to include external programs into iRODS rules. The integration is easy but not very powerful as it is relatively hard to access iRODS functionalities from the external scripts and programs run this way.

The most powerful option of extending iRODS is to write own micro-services in C by writing so-called modules. This is a quite a broad subject and hence we will not include much information about this option here. In short, native iRODS modules have to be written in C. They are composed of sources, headers, Makefile and special file (microservices.table) which assigns micro-service names to C functions defined in the module. Micro-services written in this fashion can access iRODS functionality by using iRODS C.

There are few example modules are provided with standard iRODS installation more general information can be found in the iRODS documentation.