aboutsummaryrefslogtreecommitdiff
path: root/doc/sg3_utils_json.8
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-08-18 19:46:38 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-08-18 19:46:38 +0000
commit7e7308a2dbdec4c900b0805ad94324d3a288a163 (patch)
treec6c84399abcab97cc9bb0657f0734e0aa56a917d /doc/sg3_utils_json.8
parent98b99ad2ab348bbba1676b95a8895f12ee48fd31 (diff)
downloadsg3_utils-7e7308a2dbdec4c900b0805ad94324d3a288a163.tar.gz
sg_inq+sg_vpd: more updates but not finished
The sg_inq+sg_inq work is mainly JSON additions. sg_vpd has a new --sinq_inraw=RFN option. Update and place names for the 64 TapeAlert flags in the library. This improves TapeAlert reporting for sg_inq, sg_vpd and sg_logs. Refine the description of the VPD page merge of processing for sg_inq and sg_vpd to only include _T10_ defined pages, so the vendor specific VPD page processings of those utilities are still separate. git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@969 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'doc/sg3_utils_json.8')
-rw-r--r--doc/sg3_utils_json.825
1 files changed, 16 insertions, 9 deletions
diff --git a/doc/sg3_utils_json.8 b/doc/sg3_utils_json.8
index d24ebb06..e8cdb62f 100644
--- a/doc/sg3_utils_json.8
+++ b/doc/sg3_utils_json.8
@@ -14,9 +14,10 @@ returned by SCSI commands (e.g. sg_vpd) can optionally provide JSON
output, rather than simple, human-readable output. The default remains
human-readable output.
.PP
-JSON is an open standard file format that can be used for data exchange
-between systems. See https://en.wikipedia.org/wiki/JSON . JSON comes in many
-flavours and this one uses the json-builder C implementation found at
+JavaScript Object Notation (JSON) is an open standard file format that can be
+used for data exchange between programs including across a network. See
+https://en.wikipedia.org/wiki/JSON . JSON comes in many flavours and this one
+uses the json-builder C implementation found at
https://github.com/json-parser/json-builder which implements four simple JSON
data types: string, integer, boolean and null. Its other data types are JSON
object and JSON array.
@@ -210,11 +211,17 @@ human readable form. Errors are reported to stderr and may cause the early
termination of a utility (e.g. command line option syntax error).
.PP
When the \fI\-\-json\fR option is given and no errors are detected, then
-only JSON is sent to stdout. If the 'o' control character is in the \fIJO\fR
-argument to the \fI\-\-json\fR option, then the former "human readable"
-output is placed in a JSON array named "output" within a JSON object
-named "utility_invoked". Each line of the former "human readable" output
-is placed in its own element of the JSON array named "output".
+only JSON is normally sent to stdout. As the SCSI response is parsed, a JSON
+representation is built as a tree in memory. After all other actions (perhaps
+apart from the final exit status report) that JSON tree is "dumped" to
+stdout. This means if there is any non-JSON output sent to stdout that
+it will appear _before_ the JSON output.
+.PP
+If the 'o' control character is in the \fIJO\fR argument to the
+\fI\-\-json\fR option, then the former "human readable" output is placed in
+a JSON array named "output" within a JSON object named "utility_invoked".
+Each line of the former "human readable" output is placed in its own
+element of the JSON array named "output".
.PP
A JSON tree is built in memory as the utility parses the data returned
from the SCSI device (e.g. sg_vpd parsing a VPD page returned from a
@@ -236,7 +243,7 @@ reason then no JSON output will appear. With the normal, human readable output
processing, some output may appear before the utility aborts in such bad
situations.
.SH ERRORS
-No attempts has been made to translate errors into JSON form, apart from the
+No attempts have been made to translate errors into JSON form, apart from the
final "exit_status" JSON object where a value of 0 means "no errors". Exit
status values indicating a problem range from 1 to 255.
.PP