JSON input / output for CLI utilities

Jeremy Allison jra at samba.org
Tue Jun 1 15:59:11 UTC 2021


On Mon, May 31, 2021 at 02:29:20PM +1200, Andrew Bartlett via samba-technical wrote:
>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!

Yay ! Massive +1 for this ! Enabling scripting of these
things beyond writing bash will really help expand Samba
use into new environments.



More information about the samba-technical mailing list