Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

 
alt

Daniel Nashed

 

One-Touch Domino JSON file validation in Domino 12.0.1

Daniel Nashed  5 December 2021 11:51:05

One-Touch Domino is one of my favorites features in Domino 12 when it comes to automated deployments.

With Domino 12.0.1 there is a new validation tool for JSON files. It makes a lot of sense to validate before starting your server setup.

There are two options

1. Check if the JSON format is valid --> that's something jq could also do for you and I am using this validation in my "domino setup json" start script option
2. Check if the JSON file is valid based on the current scheme! --> That's really very very helpful when writing JSON configuration files.

On Windows you can run the binary directly from the program directory. And most of the times the notes.ini is in the server binary directory.
The validation tool searches the schema in the curent directory.

On Linux this needs some two minor tweaks in beta 2.

1. First of all you need to add a startup link for the servertask in the same way other servertasks which are invoked from command-line.

cd /opt/hcl/domino/bin
ln -s tools/startup validjson

2. Next you have to copy the schema json file to your Notes data directory like that

cp /opt/hcl/domino/notes/latest/linux/dominoOneTouchSetup.schema.json /local/notesdata

Once done, you can run the validation tool.

Because it still needs those two changes, I have not add this check yet to my "domino setup" start script command.
It would need root permissions to create the startup link.
But if only used in my program or a similar controlled environment, I could also set the path accordingly to run the program and just copy the schema json.


So instead of the symbolic link you could also export the lib path and run the binary from the binary directory.

export LD_LIBRARY_PATH=/opt/hcl/domino/notes/latest/linux
/opt/hcl/domino/notes/latest/linux/validjson setup.json


-- Daniel


--- Validation output --

/opt/hcl/domino/bin/validjson
[002434:000002-00007FEC04510740] validates input json file and optionally validates the input file against a JSON schema:
[002434:000002-00007FEC04510740] Usages:
[002434:000002-00007FEC04510740]     validjson fileToValidate.json                  -> validates json without a schema
[002434:000002-00007FEC04510740]     validjson fileToValidate.json -default         -> validates json against default dominoOneTouchSetup.schema.json
[002434:000002-00007FEC04510740]     validjson fileToValidate.json schemaFile.json  -> validates json against the specified schema



/opt/hcl/domino/bin/validjson setup.json
[002849:000002-00007F2B5E92F740] Success - setup.json is valid


/opt/hcl/domino/bin/validjson setup.json  -default
[002795:000002-00007FE83E78F740] Success - setup.json is valid with respect to schema dominoOneTouchSetup.schema.json


Comments
No Comments Found

Links

    Archives


    • [HCL Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]