JSON input / output for CLI utilities

Andrew Walker awalker at ixsystems.com
Fri May 28 21:20:02 UTC 2021


On Fri, May 28, 2021 at 11:15 AM Ralph Boehme <slow at samba.org> wrote:

> Am 28.05.21 um 17:10 schrieb Andrew Walker via samba-technical:
> > Should we have version strings for all the JSON output generated by
> > utilities?
>
> yes please.
>
> -slow
>
> --
> Ralph Boehme, Samba Team                https://samba.org/
> Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
> GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46
>
>
I was thinking of something like this:
```
root@:/usr/ports/net/samba # net --json groupmap add data='{"nt_name":
"smbuser", "gid": 1000}'
{"version": {"major": 1, "minor": 0}, "groupmap": [{"nt_name": "smbuser",
"sid": "S-1-5-21-3928159180-3161166842-2405926743-1005", "gid": 1000,
"group_type_int": 2}]}
```

Basically, have the json-input variety for adding a new groupmap entry
print what actually got added in JSON on stdout. It's probably better
because scripts may send incomplete information, but may benefit from
knowing what SID they received.


More information about the samba-technical mailing list