Skip to content

Commit ecd244f

Browse files
committed
Added more missing common attributes
(cherry picked from commit bcf14a0)
1 parent 63e5287 commit ecd244f

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed

reference/common-attributes-include.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ the [Promise types] page. The common attributes are as follows:
1616

1717
#### [if][Promise types#if]
1818

19+
#### [unless][Promise types#unless]
20+
1921
#### [meta][Promise types#meta]
2022

2123
#### [with][Promise types#with]

reference/promise-types/access.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ promises will override less specific ones.
115115

116116
## Attributes
117117

118+
{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
118119

119120
### admit_hostnames
120121

reference/promise-types/defaults.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ reports:
8989

9090
## Attributes
9191

92+
{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
93+
9294
### if_match_regex
9395

9496
**Description:** If this [anchored][anchored] regular expression matches the

reference/promise-types/measurements.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ may be used in other promises in the form `$(mon.handle)`.
153153

154154
## Attributes
155155

156+
{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
157+
156158
### stream_type
157159

158160
**Description:** The datatype being collected.

reference/promise-types/meta.markdown

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,90 @@ reports:
2727
```
2828

2929
The 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+

reference/promise-types/roles.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ classes matching the regular expression `Myclass_.*` hen using the
3838

3939
## Attributes
4040

41+
{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
42+
4143
### authorize
4244

4345
**Description:** List of public-key user names that are allowed to activate

reference/promise-types/vars.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ vars:
303303

304304
## Attributes
305305

306+
{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}
307+
306308
### policy
307309

308310
**Description:** The policy for (dis)allowing (re)definition of variables

0 commit comments

Comments
 (0)