Bench of utility methods used by filters.
Returns a dict of all metadata based on a metadata key for a specific host. If the key is not provided, returns a dict of all metadata.
Returns a set of values based on a metadata key for a specific host.
Tests for overlap between a host_state and a list of uuids.
Returns True if any of the supplied uuids match any of the instance.uuid values in the host_state.
Tests for overlap between a host_state’s instances and an instance_type_id.
Returns True if there are any instances in the host_state whose instance_type_id is different than the supplied instance_type_id value.
Returns a correctly casted value based on a set of values.
This method is useful to work with per-aggregate filters, It takes a set of values then return the ‘based_on’{min/max} converted to ‘cast_to’ of the set or the default value.
Note: The cast implies a possible ValueError