libioc.Filter module¶
ioc filters for ListableResource.
-
class
libioc.Filter.
Term
(key, values=[])[source]¶ Bases:
list
A single filter term.
-
glob_characters
= ['*', '+']¶
-
matches
(value, short=False)[source]¶ Return True if the value matches the term.
- Parameters
value (
Any
) – The value that is matched against the filter termshort (
bool
) – When value has a length of 8 characters, this argument allows to match a jail’s shortname as well. This is required for selecting jails with UUIDs by the first part of the name
- Return type
bool
-
property
short
¶ Return True if the short name of a UUID be used.
- Return type
bool
-
-
class
libioc.Filter.
Terms
(terms=None, logger=None)[source]¶ Bases:
list
A group of filter terms.
Each item in this group must match for a resource to pass the filter. This can be interpreted as logical AND
-
add
(term)[source]¶ Add a Term to the list of Terms.
- Parameters
term (libioc.Filter.Term, str) – Interface name inside the jail
- Return type
None
-
match_key
(key, value)[source]¶ Check if a value matches for a given key.
Returns True if the given value matches all terms for the specified key Returns Fals if one of the terms does not match
- Return type
bool
-