Question: How to Resync a Data Source using the rest api

I’ve searched the forums and found references to a method of resyncing folders and I’d like to trigger this via Node-Red. However, all the references are from 2019/2020, and the api has changed. I’ve worked out how to call the rest api using node-red.

Logging into Pydio Cells using an admin account and accessing the Cells Console then showing advanced options, I can view the scheduler and see the manual tasks, which can be launched from this console:

I can trigger these commands via the command line:

/srv/pydio$ docker exec pydio-cells cells admin datasource resync --datasource=pydiods1
Resync Triggered.
Result: {"Source":"s3://127.0.0.1:41885/pydiods1","Target":"index://pydiods1","Type":"TreePatch"}
⚠ If result contains newly created files, you should now launch 'cells admin datasource rehash' command.

/srv/pydio$ docker exec pydio-cells cells admin datasource rehash --datasource=pydiods1 --username=admin
✔ [SUCCESS] Posted job for recomputing hashes on all files. You can monitor the job in the scheduler.
✔ [SUCCESS] Datasource hashing_version will be updated if necessary, you may restart the server if value is changed.

Which pydio 3.0 service method should I use to trigger the resync and optionally the rehash?

I found the answer. I rubber ducked myself. Typing out your problems is often the fastest way to fix them.

According to this post from @zayn the correct details are:

  • method: PUT
  • endpoint: /a/jobs/user/datasource-resync
  • body: {"JobName":"datasource-resync","JsonParameters":"{\"dsName\":\"pydiods1\"}"}

I added four calls to my test bed:

I adjusted each Change node to use the datasource-resync service:

I checked to make sure the json payload was properly formatted:

Then I triggered each one successfully:

Both the container logs and the cells console show progress and success.

I’m quite happy with that :slight_smile:

This topic was automatically closed 11 days after the last reply. New replies are no longer allowed.