summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-06-29 12:30:07 +0100
committerKen Barber <ken@bob.sh>2011-06-29 12:30:07 +0100
commite071b05ab631f4b73fed7178c52d0416f7629cb8 (patch)
tree117365b45372eb4259f873ad0bbeb1d5f783dccd /README.markdown
parent157531cd290e53c9a174171bb29de293bade2ed4 (diff)
downloadpuppet-stdlib-e071b05ab631f4b73fed7178c52d0416f7629cb8.tar.gz
puppet-stdlib-e071b05ab631f4b73fed7178c52d0416f7629cb8.tar.bz2
Added kwalify function.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown29
1 files changed, 29 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index ec4267c..68e559e 100644
--- a/README.markdown
+++ b/README.markdown
@@ -17,3 +17,32 @@ From github, download the module into your modulepath on your Puppetmaster. If y
puppet --configprint modulepath
Depending on the version of Puppet, you may need to restart the puppetmasterd (or Apache) process before the functions will work.
+
+## Functions
+
+### kwalify
+
+This function allows you to validate Puppet data structures using Kwalify
+schemas as documented here:
+
+http://www.kuwata-lab.com/kwalify/ruby/users-guide.01.html
+
+To validate, create a schema in Puppet:
+
+ $schema = {
+ 'type' => 'seq',
+ 'sequence' => [
+ { 'type' => 'str' }
+ ]
+ }
+
+And create some content that you want validated:
+
+ $document = ['a', 'b', 'c']
+
+And then use the function to validate:
+
+ kwalify($schema, $document)
+
+The function will throw an error and list all validation errors if there is a
+problem otherwise it succeeds silently.