Content Data Validation Jython Scripts

The Content Data Validation Jython scripts are divided into main scripts and library scripts. Each "main" script must have the ValidateData function which is the entry point for the execution of data validation. The ValidateData function has the following parameters:

  • TaskResults. Provides the API accessing data objects.
  • Environment. Provides the API for accessing Environment information, such as the Probe Gateway name, the Probe Gateway IP, and the domain name.

The dataValidationlibs.xml file is a configuration file where you define which scripts to execute and which to execute as libraries. The file is divided into sections which logically define the data validation execution.

Example of the dataValidationlibs.xml File

<datavalidation parserClassName="com.hp.ucmdb.discovery.
library.communication.downloader.cfgfiles.
ContentDataValidationConfigFile">
	<script name="dataValidator1.py">
		<library name="validator1.py"/>
		</script>
	<script name="dataValidator2.py" cit="Node,Process">
		<library name="validator2.py"/>
		<library name="validator3.py"/>
	</script>
</datavalidation>

where:

  • validator<x>.py is a library script.

    Libraries must be ordered according to their dependency. In this example, validator3.py uses validator2.py, so validator3.py appears after first validator2.py.

  • The cit parameter lists the CITs that the script receives for validation. In this example, the dataValidator2.py script receives only Node and Process CITs for validation.

Handling Errors and Warnings

  • addError/addWarning. Use this API from the TaskResults parameter to attach error/warning to triggered CIs. Bulk is reported to the RTSM server.
  • raise ContentDataValidationException. Use to report an error message if the bulk should be discarded.

Related Topics Link IconRelated Information