Monday, April 14, 2025

#1067 OIC 25.04 New Features - File Server Events

With the 25.04 release, OIC events have been augmented to support File Server. The following file server events are supported -

  • File created
  • File deleted
  • Folder created
  • Folder deleted

Subscribing to the Folder Created Event


Create a new integration - 


Activate and test, by adding a new folder via FileZilla - 

Subscribing to the File Created Event

Same as above, I just choose a different event - 

Activate and test, by adding a new file to the NewOrders folder via FileZilla - 

Check out the activity stream - 

Here is the payload received from File Server - 

{"action":"file_create","name":"700Orders.json","path":"/home/users/yourUser/NiallC/NewOrders","size":83791,"extension":"json","source":"urn://fs/sftp","type":"file","time":"2025-04-14T08:35:57.703Z","metadata":[{"key":"createdBy","value":"yourUser"}]}

All of the above fields are self-explanatory, at least I hope so.


Subscribing to the File Deleted Event




Subscribing to the Folder Deleted Event


Delete the NewOrders folder - 

Very easy to use - now to some filtering - 

Filtering Events


In this case, I am only interested in files with the format - ordersnnn.*.

The following filter should work - 

{"type":"jq_filter","filter-def":".data.name | startswith(\"orders\")"}



Let's test this out - 

Now I try with an orders file - 

The filter can be augmented to check for the folder - 

{"type":"jq_filter","filter-def":".data.path==\"/home/users/yourUser/NiallC/NewOrders\" and (.data.name | startswith(\"orders\")) "}

Summa Summarum

Many customers have been asking for this feature, with 25.04 you have it!






























  

No comments: