get_group_members
Lists the members of the specified group.
Note that targets are only listed once, even though they can be in more than one sub-group of the group.
Format
emcli get_group_members -name=<name> [-type=<group>] [-depth=#] [-noheader] [-expand_non_groups] [-script | -format= [name:<pretty|script|csv>]; [column_separator:<column_sep_string>]; [row_separator:<row_sep_string>]; ] [ ] indicates that the parameter is optional
Options
-
name
Target name of the group.
-
type
Group type: group. Defaults to
group
. -
depth
Lists target members in sub-groups to the depth specified. The default is 1. When the depth is set to 0, no group target members are listed, and only the group's existence is verified. When the depth is set to -1, all group and sub-group target members are listed; in this case no groups appear in the output. Note that a target is listed at most once, even though it can be a member of several sub-groups.
-
noheader
Displays tabular information without column headers.
-
expand_non_groups
Lists members of aggregates and the aggregate target. By default, only sub-group target members are listed.
-
script
This is equivalent to
-format="name:script"
. -
format
Format specification (default is
-format="name:pretty"
).-
format="name:pretty"
prints the output table in a readable format not intended to be parsed by scripts. -
format="name:script"
sets the default column separator to a tab and the default row separator to a newline. The column and row separator strings can be specified to change these defaults. -
format="name:csv"
sets the column separator to a comma and the row separator to a newline. -
format=
column_separator:"column_sep_string" column-separates the verb output by <column_sep_string>. Rows are separated by the newline character. -
row_separator:"row_sep_string" row-separates the verb output by <row_sep_string>. Rows are separated by the tab character.
-
Output Columns
Target Name, Target Type
Examples
Example 1
This example lists the unique targets in group my_group:group
and its sub-groups.
emcli get_group_members -name=my_group -depth=-1
Example 2
This example lists the unique targets in group my_group:group and its sub-groups/aggregates. The aggregate targets are also listed.
emcli get_group_members -name=my_group -depth=-1 -expand_non_groups