The overall idea of printing "zfs list" output as JSON seems good.
I took a quick look at the code (https://github.com/Alyseo/zfs/compare/json ). It looks like this is a work in progress. E.g: - it would seem to do the wrong thing with "zfs list -J -o <prop>" - there are many style errors Why do we need cb_header when we already have cb_proplist? FYI - Long term, we'd like the kernel to do more of the property processing, so this could eventually turn into simply: - do an ioctl to get the requested properties of the requested datasets, returning an nvlist - print nvlist as json (which has already been implemented, e.g. by Joyent) There are going to be a couple of talks about how this might be achieved at the OpenZFS Developer Summit on Monday, you might want to catch the live stream (or recordings will be posted later in the week). (However, that long-term plan doesn't mean we shouldn't in the mean time do JSON printing with the current infrastructure, as you're proposing.) --matt On Fri, Nov 7, 2014 at 10:56 AM, Yacine Kheddache < [email protected]> wrote: > On Thu, Sep 25, 2014 at 6:54 PM, Yacine Kheddache < > [email protected]> wrote: > >> On Thu, Sep 25, 2014 at 5:39 PM, Richard Elling < >> [email protected]> wrote: >> >>> On Sep 24, 2014, at 10:55 PM, Robert Mustacchi <[email protected]> wrote: >>> >>> > On 9/24/14 22:51 , Matthew Ahrens wrote: >>> >> On Mon, Sep 22, 2014 at 9:34 AM, Yacine Kheddache < >>> >> [email protected]> wrote: >>> >> >>> >>> Hi, >>> >>> >>> >>> I know this is an old topic : >>> https://github.com/zfsonlinux/zfs/issues/740 >>> >>> >>> >>> And also that -H argument can help in some cases, also know all the >>> talks >>> >>> around libzfs, libzfs_core… >>> >>> >>> >>> But during the first OpenZFS European Conference in Paris : >>> >>> http://www.meetup.com/OpenZFS-Europe/events/177038202/ >>> >>> >>> >>> We have had pretty nice conversation with users and developers and it >>> >>> seems that all or most can agree on the fact it will be so simpler >>> and >>> >>> cleaner if all zfs / zpool outputs can be jsonify on request >>> (specific arg >>> >>> for this purpose)… >>> >>> >>> >>> So : >>> >>> 1/ did I miss something and you guys have an alternative for this ? >>> >>> 2/ if not, is the community think this is a valuable feature request >>> ? >>> >>> >>> >>> I’m convince this could really help to bring new zfs lovers on board >>> which >>> >>> can contribute with nice addons. >>> >>> >>> >>> The howto (API on top of libzfs libzfs_core or changing commands >>> >>> structures…) are still TBD if the community would like to move >>> forward on >>> >>> the topic ;-) But really think this need to go upstream… >>> >>> >>> >> Sounds like something that could be useful. If you implement this, >>> let me >>> >> know if you need any pointers, or if you'd like to discuss your design >>> >> before you start implementing it. >>> > >>> > Other thing I'd add is that we added an nvlist to JSON output into >>> > libnvpair in illumos and we have some prototype code that does the >>> > parsing back into an nvpair. If that's something you're looking for, I >>> > can get you in touch with folks about that. >>> >> >> Yes will be nice if you guys can share this code. >> >> >>> We've done similar. Now is a good time for collaboration. It would be >>> nice to >>> reach concensus by the OpenZFS conference in early November. >>> >>> >> +1 on the fact it is time to collaborate on this topic and I'm convince >> it will really help >> the community if it become upstream... >> >> >>> The method is sound, the concensus is needed around the nvlist >>> strongly-typed >>> data conversion to/from JSON, which is almost, but not quite, untyped. >>> Or, as >>> I'm often heard lamenting, "JSON numbers are neither integers nor >>> floating point, >>> they are numbers." >>> -- richard >>> >> >> Guess we can all exchange and agree on the design first and see who >> within the community >> would like to work on the implementation. >> >> Happy if this is moving in the right direction instead of all reinventing >> the wheel in the shadow >> for their own products... ;-) >> >> Yacine >> > > Hi Guys, > > Please check this out and let us know what you are thinking about it : > https://github.com/Alyseo/zfs/tree/json > > Will be happy to have a chat on Monday at OpenZFS summit and to connect > our team > with the community (we are ready to join the Hackathon on this topic). > > Thank you > Regards, > Yacine > > > _______________________________________________ > developer mailing list > [email protected] > http://lists.open-zfs.org/mailman/listinfo/developer > >
_______________________________________________ developer mailing list [email protected] http://lists.open-zfs.org/mailman/listinfo/developer
