Hi Alan,
Thanks for replying.
So basically what I understand is that the iComomand "irsync -r i:foo1 i:foo2" and "msiCollRsync" msi should behave same in this sense.
One of the old microservice manual has this remark, "note that optional parameters take the value 'null' when not being used". But I cannot see the same remark in the "doxygen". There could be then some issue after the version upgrade? I can open an issue for this if you see as bug.
Note: I tested by providing with "null". It didn't work. Even for the native rule language I got "NO_MICROSERVICE_FOUND_ERR".
With regards to the error message in the log;
I have two collections, sub1 and sub2. I wanted to test few things like what I have done with "irsync". Assume "test1.txt" exists in "sub1" and doesn't exist in "sub2", then if I execute "irsync -r i:sub1 i:sub2" I don't have any issue in the logs and I can see the "test1.txt" in "sub2", meaning copied to "sub2". If I do the same with the following test rule I am getting the error I shared earlier (nothing more in the log). But it also copies test1.txt in spite of errors in the log. So no, the data object "test1.txt" didn't exist in "/tempZone/home/rods/sub2/" if that was the the question. However, if I am not mixing things, like how iCommand does this msi first will look at the source and compares the dataobjs there with target-source. If that is not in the target, it will write/copy it. Then later it will check the size/checksum to update the files in the target based on the source.
def main(rule_args, callback, rei):
src_coll = global_vars['*srcColl'][1:-1]
dest_coll = global_vars['*destColl'][1:-1]
resource = global_vars['*Resource'][1:-1]
callback.msiCollRsync(src_coll, dest_coll, resource, 'IRODS_TO_IRODS', 0)
callback.writeLine('stdout', 'Synchronized collection ' + src_coll + ' with collection ' + dest_coll)
INPUT *srcColl="/tempZone/home/rods/sub1", *destColl="/tempZone/home/rods/sub2", *Resource="demoResc"
OUTPUT ruleExecOut
As for the metadata copy microservice:
When there is a need to copy the content (dataObjs together with their attached metadata) of "collection1" to "collection2", we are using our own function that works with "msiString2KeyValPair", "msiAssociateKeyValuePairsToObj" and "Query" object.
callback.msiDataObjCopy(collection1/file_name, collection2/file_name, "forceFlag=", 0)
copyMetadataToDataObj(callback, collection1, file_name, collection2/file_name)
Instead of doing like this, I would prefer to use either a single msi or want it part of the one another msi as an option. But that is okay for now.
One extra question;
In older manuals, I see "msiIsColl" but not exists anymore. Currently I am using the python subprocess module to get the content of a collection. I guess there isnt any counterpart of "msiIsColl" for 4.2.8. Is this correct?
Regards
Mustafa