Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (22 sloc) 877 Bytes
layout title published tags
default
storejson
true
reference
io functions
functions
storejson
json
inline_json
container

[%CFEngine_function_prototype(data_container)%]

Description: Converts a data container to a JSON string.

[This function can accept many types of data parameters.][Functions#collecting functions]

[%CFEngine_function_attributes(data_container)%]

Example:

   vars:

      "loadthis"
         data =>  readjson("/tmp/data.json", 4000);
      "andback"
         string =>  storejson(loadthis);
   reports:
      "Converted /tmp/data.json to '$(andback)'";

History: The [collecting function][Functions#collecting functions] behavior was added in 3.9.

See also: readjson(), readyaml(), parsejson(), parseyaml(), [about collecting functions][Functions#collecting functions], and data documentation.

You can’t perform that action at this time.