cinder.api.api_utils module

class GenericProjectInfo(project_id, project_keystone_api_version, domain_id=None, name=None, description=None)

Bases: object

Abstraction layer for Keystone V2 and V3 project objects

add_visible_admin_metadata(volume)

Add user-visible admin metadata to regular metadata.

Extracts the admin metadata keys that are to be made visible to non-administrators, and adds them to the regular metadata structure for the passed-in volume.

get_project(context, project_id)

Method to verify project exists in keystone

is_none_string(val)

Check if a string represents a None value.

remove_invalid_filter_options(context, filters, allowed_search_options)

Remove search options that are not valid for non-admin API/context.

validate_integer(value, name, min_value=None, max_value=None)

Make sure that value is a valid integer, potentially within range.

Parameters
  • value – the value of the integer

  • name – the name of the integer

  • min_length – the min_length of the integer

  • max_length – the max_length of the integer

Returns

integer

validate_project_and_authorize(context, project_id, policy_check=None, validate_only=False)
walk_class_hierarchy(clazz, encountered=None)

Walk class hierarchy, yielding most derived classes first.