JSON input / output for CLI utilities

Andrew Bartlett abartlet at samba.org
Mon May 31 02:29:20 UTC 2021


On Sun, 2021-05-30 at 21:14 -0400, Andrew Walker via samba-technical
wrote:
> On Fri, May 28, 2021 at 11:15 AM Ralph Boehme <slow at samba.org> wrote:
> 
> > Am 27.05.21 um 23:42 schrieb Andrew Walker via samba-technical:
> > > I know we've added JSON output to a few of the CLI utils. Over
> > > the past
> > > year or so I've added this to various utils in FreeNAS (using
> > libjansson).
> > > Is there an overall strategy for this? I'd be happy to upstream
> > > what I
> > have.
> > 
> > I guess as what you have worked for FreeNAS/TrueNAS and unless it's
> > somehow tailored to specific usecases, it should be good as is. :)
> > 
> > > Also is there an effort to add support for JSON input to them?
> > 
> > Not that I know of, but that sounds like a nice addition for some
> > tools.
> > For which tools do you have JSON input support?
> > 
> 
> I'm in the process of adding support for pdbedit, net groupmap, and
> net
> conf. I see one of major advantages of JSON input support for some of
> these
> is we can trivially add support for batch operations. Libjansson is
> quite
> easy to work with for doing json input via json_loads().

Cool.  I'm really excited to see this expanded.  It is awesome when an
idea spreads beyond the original developer's narrow use case like this!

Andrew Bartlett
-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source
Solutions




More information about the samba-technical mailing list