Skip to content

Commit c2dc889

Browse files
committed
Add documentation to prefix filter
1 parent d44eda5 commit c2dc889

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

plugins/filter/prefix.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
DOCUMENTATION:
2+
name: prefix
3+
author:
4+
- Lennart Betz <[email protected]>
5+
short_description: Prefix dictionaries / strings
6+
description:
7+
- Prefixes every key in dictionary with given string.
8+
- Prefixes every element in list of strings with given string.
9+
positional: _input
10+
options:
11+
_input:
12+
description:
13+
- Input dictionary or list of strings.
14+
type: dict/list
15+
required: true
16+
prefix:
17+
description:
18+
- The prefix to apply.
19+
type: string
20+
required: true
21+
22+
EXAMPLES: |
23+
# my_list: [ '__hello', '__bye' ]
24+
my_list: "{{ [ 'hello', 'bye' ] | netways.icinga.prefix(prefix='__') }}"
25+
26+
# constants: { 'const NodeName': 'example.com', 'const ZoneName': 'main' }
27+
constants: "{{ {'ZoneName': 'main', 'NodeName': 'example.com'} | netways.icinga.prefix('const ') }}"
28+
29+
RETURN:
30+
_value:
31+
description: The prefixed dictionary / list
32+
type: dict / list

0 commit comments

Comments
 (0)