openstackclient.api package

Submodules

openstackclient.api.api module

openstackclient.api.auth module

openstackclient.api.auth_plugin module

openstackclient.api.image_v1 module

openstackclient.api.image_v2 module

openstackclient.api.network_v2 module

openstackclient.api.object_store_v1 module

openstackclient.api.utils module

API Utilities Library

openstackclient.api.utils.simple_filter(data=None, attr=None, value=None, property_field=None)

Filter a list of dicts

Parameters:
  • data (list) – The list to be filtered. The list is modified in-place and will be changed if any filtering occurs.
  • attr (string) – The name of the attribute to filter. If attr does not exist no match will succeed and no rows will be retrurned. If attr is None no filtering will be performed and all rows will be returned.
  • value (sring) – The value to filter. None is considered to be a ‘no filter’ value. ‘’ matches agains a Python empty string.
  • property_field (string) – The name of the data field containing a property dict to filter. If property_field is None, attr is a field name. If property_field is not None, attr is a property key name inside the named property field.
Returns:

Returns the filtered list

Rtype list:

This simple filter (one attribute, one exact-match value) searches a list of dicts to select items. It first searches the item dict for a matching attr then does an exact-match on the value. If property_field is given, it will look inside that field (if it exists and is a dict) for a matching value.

Module contents