Problem/Justification
Truenas scale is a great application, but many users have specific needs and wishes to customize it. Unfortunately, there does not appear any good way of using Truenas scales gui features in conjunction with custom scripts, which often forces people to altogether abandon the gui methods and instead implement solutions themselves or alternatively people use the gui methods and then use hacky hooks through either the log files or even email alerts, as seen in the following: Monitoring status of replication tasks | TrueNAS Community Correct way to script ZFS replication in TrueNAS Scale? - #7 by winnielinnie
What I would like is either some kind of api where the gui variables are clearly exposed, or a folder which have files with all the variable values. I believe that Truenas might already have something somewhat along those lines in a middleware API, but I have been unable to find much information on this or whether it covers the case I’m mentioning.
Thus through such an API I can easily create a shell script that acts when a certain condition is met. Like for instance, if a replication task has sucessfully finished in the last 5 minutes, run this script.
Impact
The benefit of this feature is that it will be easier for people who wishes to customize truenas scale. There will be one source of truth for all the things shown in the GUI, and people can reliably query this API or whatever form this might take and get the same values as are currently exposed in the GUI.
Thus for people who do not want to customize there should be no impact, and for the people who wish to customize things there is a simple source of truth for all things happening in the GUI