HSCRIPT-FROMJSON(1)

NAME
hscript-fromjson - convert a JSON object to a HorizonScript

SYNOPSIS
hscript-fromjson [-fn] [-h] [-v] [INSTALLFILE] [JSONFILE]

DESCRIPTION
The hscript-fromjson utility converts a valid JSON object to a HorizonScript. The JSON schema used for representing HorizonScript can be found in the Horizon YANG model. In most installations, this file is available in /usr/share/doc/horizon.

hscript-fromjson will, by default, read JSON from stdin, and write the HorizonScript representation to /etc/horizon/installfile. If you want to read the JSON from a file, you must supply the path to write the HorizonScript first.

OPTIONS
The hscript-fromjson utility supports the following options:

-f  Force writing the HorizonScript to the specified path, even if it already exists. By default, hscript-fromjson will display an error and quit without writing if a HorizonScript already exists at the specified path.

-h  Displays a help message, and then exits.

-n  Disables colour output and ANSI escape sequences in any log messages. This is the default when not running from a terminal.

-v  Displays the version information for this utility, and then exits.

EXIT STATUS

EXAMPLES
The following invocation will read JSON from stdin and output the resultant HorizonScript to /etc/horizon/installfile:
    $ hscript-fromjson

The following invocation will read JSON from myimage.json and output the resultant HorizonScript to stdout:
    $ hscript-fromjson - myimage.json

DIAGNOSTICS

%dateT%time log %location: %status: %message[: %extra] A message of type %status was logged while processing %location. The log message %message may be followed by additional information or hints in %extra.

SEE ALSO
hscript-validate(1), hscript(5), hscript-executor(8).

HISTORY
The hscript-fromjson command first appeared in Horizon 0.9.

AUTHORS
A. Wilcox <awilfox@adelielinux.org>