@@ -27,3 +27,90 @@ reports:
2727```
2828
2929The value of meta data can be of the types ` string ` or ` slist ` or ` data ` .
30+
31+ ## Attributes
32+
33+ {{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
34+
35+ ### data
36+
37+ ** Description:** A data container structure
38+
39+ ** Type:** ` data `
40+
41+ ** Allowed input range:** (arbitrary string)
42+
43+ ** Example:**
44+
45+ ``` cf3
46+ vars:
47+
48+ "loaded1" data => readjson("/tmp/myfile.json", 40000);
49+ "loaded2" data => parsejson('{"key":"value"}');
50+ "loaded3" data => readyaml("/tmp/myfile.yaml", 40000);
51+ "loaded4" data => parseyaml('- key2: value2');
52+ "merged1" data => mergedata(loaded1, loaded2, loaded3, loaded4);
53+
54+ # JSON or YAML can be inlined since CFEngine 3.7
55+ "inline1" data => '{"key":"value"}'; # JSON
56+ "inline2" data => '---$(const.n)- key2: value2'; # YAML requires "---$(const.n)" header
57+ ```
58+
59+ ### slist
60+
61+ ** Description:** A list of scalar strings
62+
63+ ** Type:** ` slist `
64+
65+ ** Allowed input range:** (arbitrary string)
66+
67+ ** Example:**
68+
69+ ``` cf3
70+ vars:
71+
72+ "xxx" slist => { "literal1", "literal2" };
73+ "xxx1" slist => { "1", @(xxx) }; # interpolated in order
74+ "yyy" slist => {
75+ readstringlist(
76+ "/home/mark/tmp/testlist",
77+ "#[a-zA-Z0-9 ]*",
78+ "[^a-zA-Z0-9]",
79+ 15,
80+ 4000
81+ )
82+ };
83+
84+ "zzz" slist => { readstringlist(
85+ "/home/mark/tmp/testlist2",
86+ "#[^\n]*",
87+ ",",
88+ 5,
89+ 4000)
90+ };
91+ ```
92+
93+ ** Notes:**
94+
95+ Some [ functions] [ Functions ] return ` slist ` s, and an ` slist `
96+ may contain the values copied from another ` slist ` , ` rlist ` , or ` ilist ` . See
97+ [ ` policy ` ] ( #policy ) .
98+
99+
100+ ### string
101+
102+ ** Description:** A scalar string
103+
104+ ** Type:** ` string `
105+
106+ ** Allowed input range:** (arbitrary string)
107+
108+ ** Example:**
109+
110+ ``` cf3
111+ vars:
112+
113+ "xxx" string => "Some literal string...";
114+ "yyy" string => readfile( "/home/mark/tmp/testfile" , "33" );
115+ ```
116+
0 commit comments