Dear OpenZFS,

Within various applications that make use of ZFS, the means of integration is 
largely done by calling the zfs/zpool/etc. executables and parsing the output 
(e.g. moby, lumina). I'd like to see an additional path for integration in the 
form of an API that provides equivalent functionality to the CLI. While it's 
true that libzfs and libzfs_core expose all the building blocks necessary to 
achieve the same result as the aforementioned executables, there's a fair 
amount of logic in the executables that would need to be duplicated to provide 
equivalent functionality.

I propose that a separate library (or possibly header/source in libzfs) be 
created, using the logic present in zpool and zfs to provide the same 
functionality exposed as an API. A few benefits from this:
- Allow for an alternate and potentially better integration path for third 
party applications
- Simplify zpool and zfs to really just focus on CLI related concerns

In my view, the "true" API to OpenZFS is the functionality provided in the CLI 
commands of the executables.

An example to illustrate what this might look like can be seen here: 
https://github.com/mcarlin/zfs/commit/660cc435543596284a218bf773cf1087829ebde8

I'd greatly appreciate everyone's thoughts on this and to see if this is 
something the community would be on board with.

Thanks,

Mike Carlin
------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/Tdde1f0006baa1227-M4c1229e160c31935bc0ff42b
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription

Reply via email to