DMTF / Redfish-JsonSchema-ResponseValidator

The Redfish JSON Schema Response Validator is a Python3 utility used to validate any JSON resource against DMTF provided JSON schemas
Other
3 stars 6 forks source link
redfish

Copyright 2017-2018 DMTF. All rights reserved.

Redfish-JsonSchema-ResponseValidator

Deprecated

This tool is deprecated in favor of response payload validation performed by the Redfish-Service-Validator.

About

Redfish-JsonSchema-ResponseValidator.py is a Python3 utility used to validate any JSON resource against DMTF provided JSON schemas.

To run:

[OPTIONS]:

Redfish-JsonSchema-ResponseValidator.py usage:
-h   display usage and exit
-v   verbose
-m   directory path to a mockup tree to validate against.   default: ./mockup-sim-pull
-s   path to a local directory containing the json schema files to validate against.  default ./DMTFSchemas
-S   Tells resourceValicate to get the schema from http://redfish.dmtf.org/schemas/v1/
-u   user name, default root
-p   password, default calvin
-e   error output path/filename, default ./validate_errs
-f   comma separated list of files to validate.  If -f is not specified, it will validate all index.json fils in the mockup
-r   hostname or IP address [:portno], default None
-i   url  --used with -r option to specify the url to test, default /redfish/v1
-x   comma separated list of patterns to exclude from errors
-g   validate only resources which failed a previous run
-l   a local json file to validate
NOTE: if -r is specified, this will validate 
       one resource (rest API) from a host
NOTE: if -f is specified, this will validate individual
       resources from the mockup directory
NOTE: if -v is specified, resource JSON will be
       printed to std out
NOTE: if -g is specified, input files will be the files
       found in a previous error file. If used with -v,
       the output will include the resource JSON and the Schema

Installation, Path, and Dependencies:

Examples:

Redfish-JsonSchema-ResponseValidator.py -m mockupdir
    -- walks the tree in mockupdir and validate every index.json file found

Redfish-JsonSchema-ResponseValidator.py -r 199.199.199.1[:port] or MyRedfishHost -i /redfish/vi/Systems
    -- validates one response from a live service

Redfish-JsonSchema-ResponseValidator.py -g -v [-e errorfile] > saveout
    -- validates the resources for a previous error file (-g)
       includes in the output the json resource and the json schema
       saves the standard out to be examined with an editor

Redfish-JsonSchema-ResponseValidator.py -l LocalResourceFile -S
    -- validates the lcoal resources file with the schema from http://redfish.dmtf.org/schemas/v1/

NOTE: here is a shortcut bash script

Known Issues

Release Process

  1. Update CHANGELOG.md with the list of changes since the last release
  2. Update the tool_version variable in Redfish-JsonSchema-ResponseValidator.py to reflect the new tool version
  3. Push changes to Github
  4. Create a new release in Github

See Also: