Skip to main content

Filter

A Filter selects which scope items (or groups) a spec applies to. It is a shared building block used by many specs. If a spec's filter is left unset, the spec applies to all of them.

Fields

FieldTypeDefaultDescription
itemsWhitelistlist<string>(unset)Only the listed entries are considered.
itemsBlacklistlist<string>(unset)The listed entries are excluded; all others are considered.
typeFilterTypeSCOPE_ITEMWhat the entries name. See FilterType.

Set at most one of itemsWhitelist / itemsBlacklist; setting both throws an error.

FilterType

type says what the itemsWhitelist / itemsBlacklist entries refer to:

typeEntries are
SCOPE_ITEM (default)scope item names
GROUPgroup names from a partition (used by group-aware specs)

Example

Consider only specific scope items (whitelist):

Filter filter;
filter.itemsWhitelist() = {"host0", "host1"};

Consider all but specific scope items (blacklist):

Filter filter;
filter.itemsBlacklist() = {"host0"};

Source