keystone.common.resource_options module

keystone.common.resource_options module

Options specific to resources managed by Keystone (Domain, User, etc).

class keystone.common.resource_options.ResourceOption(option_id, option_name, validator=<function _validator>, json_schema_validation=None)[source]

Bases: object

json_schema
option_id
option_name
class keystone.common.resource_options.ResourceOptionRegistry(registry_name)[source]

Bases: object

get_option_by_id(opt_id)[source]
get_option_by_name(name)[source]
json_schema
option_ids
option_names
options
options_by_name
register_option(option)[source]
keystone.common.resource_options.boolean_validator(value)[source]
keystone.common.resource_options.ref_mapper_to_dict_options(ref)[source]

Convert the values in _resource_option_mapper to options dict.

NOTE: this is to be called from the relevant to_dict methods or
similar and must be called from within the active session context.
Parameters:ref – the DB model ref to extract options from
Returns:Dict of options as expected to be returned out of to_dict in the options key.
keystone.common.resource_options.resource_options_ref_to_mapper(ref, option_class)[source]

Convert the _resource_options property-dict to options attr map.

The model must have the resource option mapper located in the _resource_option_mapper attribute.

The model must have the resource option registry located in the resource_options_registry attribute.

The option dict with key(opt_id), value(opt_value) will be pulled from ref._resource_options.

NOTE: This function MUST be called within the active writer session
context!
Parameters:
  • ref – The DB model reference that is actually stored to the backend.
  • option_class – Class that is used to store the resource option in the DB.
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.