# keystone.common.resource_options.core module

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

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

  Bases: `object`

  property json_schema
  property option_id
  property option_name

class keystone.common.resource_options.core.ResourceOptionRegistry(registry_name)

  Bases: `object`

  get_option_by_id(opt_id)
  get_option_by_name(name)
  property json_schema
  property option_ids
  property option_names
  property options
  property options_by_name
  register_option(option)

keystone.common.resource_options.core.boolean_validator(value)

keystone.common.resource_options.core.get_resource_option(model, option_id)

  Get the resource option information from the model’s mapper.

keystone.common.resource_options.core.ref_mapper_to_dict_options(ref)

  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.core.resource_options_ref_to_mapper(ref, option_class)

  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.

this page last updated: 2026-08-17 12:45:24

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

found an error? report a bug