On 03/01/15 13:25, Craig Rodrigues wrote:
> On Sun, Mar 1, 2015 at 10:49 AM, Harrison Grundy <
> harrison.gru...@astrodoggroup.com> wrote:
>> Thanks!
>> That does seem useful, but I'm not sure I see the reasoning behind
>> putting into base, over a port or package
>> , since processing XML in base is a pain, and it can't serve up JSON or
>> HTML without additional
>> utilities anyway.
> I think if you take another pass at reading the entire thread  of responses
> to see the discussion for the motivation behind libxo, you will get the
> idea:
>  https://lists.freebsd.org/pipermail/freebsd-arch/2014-July/015633.html
> There are many people who are building products on top of FreeBSD.
> For these people, it is super useful for the base utilities in FreeBSD
> to emit output in properly formatted XML or JSON.
> That way, they do not need to write scripts to take the output of
> say, netstat, and use awk/sed/whatever scripts to take the human readable
> netstat output and convert it to a form which can be used in a script.
> There are many, many parsers for XML and JSON not in the base system.
> For people building products on top of FreeBSD, they don't care
> if these parsers are not in the base, since they can add these parsers on
> top of base FreeBSD.
> For example, languages like Python and Ruby have excellent parsers
> for JSON and XML.  Many people build products using these languages.
> There are JSON and XML parsers in C, C++, and other languages as well.
> In addition to people building products, the other audience of people who
> benefit from libxo are devops people.
> These days, devops folks have no problem using Python, Ruby, Perl,
> whatever to write scripts to interact with Unix boxes and pull information
> off of it.  Having the base utilities emit info in native JSON or XML
> greatly facilitates this.
> I talked to one person who is improving FreeBSD support for Saltstack (a
> devops framework).   He told me
> that if more base utilities such as sysctl, could use libxo to emit output
> in JSON, that would greatly facilitate improving FreeBSD support for
> these devops frameworks.  That is because Saltstack would require
> less FreeBSD-specific parsing code for getting info from base utilities.

I like the idea behind this... where I'm running into difficulty is why
these bits of functionality need to be combined. What someone does with
ifconfig on the command line, versus what someone wants to know about
their network interfaces in an XML dump may be very distinct bits of
information. (For instance, an XML dump of network information may want
to incorporate data from netstat, route, and ifconfig, while ifconfig is
really only designed to deal with the interfaces themselves.)

I know it involves some notable reworking, but would there be any
interest in seeing what "libifying" a handful of binaries and splitting
the libxo and CLI functionality looks like? It seems like this may give
FreeBSD the best of both worlds, so the XML output isn't logically
limited by how the CLI needs to work, and the CLI won't have to deal
with the complexity XML output can require.

I'd be happy to get this set up for a few binaries so people can see how
it might work and what it could look like if there's any interest in
going that route.

--- Harrison
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to