Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2014 20:22:40 -0700
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Garance A Drosehn <drosih@rpi.edu>
Cc:        arch@freebsd.org, marcel@freebsd.org, phil@juniper.net
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <20140731032240.8F711580A2@chaos.jnpr.net>
In-Reply-To: <82CFA67F-BA93-44EE-BD4B-9105F89AD157@rpi.edu>
References:  <20140725044921.9F0D3580A2@chaos.jnpr.net> <82CFA67F-BA93-44EE-BD4B-9105F89AD157@rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 30 Jul 2014 21:37:54 -0400, Garance A Drosehn writes:
>Do you have links to the library itself?

Not yet.

>I'd suggest that the above isn't quite what one would want, either.
>For the text version it's fine to have a time-of-day value as
>'6:47PM', but if you're going for machine-readable output then

Actually for machine readable output the most useful thing is the utc
seconds.  Eg (in case you don't have access to a Junos router):

root@vjb5> show system uptime | display xml 
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/13.3I0/junos">;
    <system-uptime-information xmlns="http://xml.juniper.net/junos/14.2I0/junos">;
        <current-time>
            <date-time junos:seconds="1406776765">2014-07-30 20:19:25 PDT</date-time>
        </current-time>

etc.

The patch to w(1) was mostly to demo the API I think.

>It's hard to tell based on your sample output, but there's also
>the question of truncating strings.  In the text output of your
>example, it obviously makes sense to truncate the 'WHAT' value
>to 'ssh svl-junos-d026.juniper.net', but when printing the same
>output in a machine-readable format you wouldn't want to truncate
>it.  Let the application which *reads* the data decide how many
>characters *it* wants to use.

Yes.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140731032240.8F711580A2>