# glance.db package

## Subpackages

- glance.db.simple package
  - Submodules
    - glance.db.simple.api module
      - `clear_db_env()`
      - `configure()`
      - `delete_all_cached_images()`
      - `delete_cached_image()`
      - `get_cached_images()`
      - `get_hit_count()`
      - `get_least_recently_accessed()`
      - `image_create()`
      - `image_delete_property_atomic()`
      - `image_destroy()`
      - `image_get()`
      - `image_get_all()`
      - `image_location_delete()`
      - `image_member_count()`
      - `image_member_delete()`
      - `image_member_find()`
      - `image_member_update()`
      - `image_property_create()`
      - `image_property_delete()`
      - `image_restore()`
      - `image_set_property_atomic()`
      - `image_tag_delete()`
      - `image_tag_get()`
      - `image_tag_get_all()`
      - `image_tag_set_all()`
      - `image_update()`
      - `insert_cache_details()`
      - `is_image_cached_for_node()`
      - `is_image_visible()`
      - `log_call()`
      - `metadef_namespace_delete()`
      - `metadef_namespace_delete_content()`
      - `metadef_namespace_get()`
      - `metadef_namespace_get_all()`
      - `metadef_namespace_get_by_id()`
      - `metadef_object_count()`
      - `metadef_object_delete()`
      - `metadef_object_delete_namespace_content()`
      - `metadef_object_get()`
      - `metadef_object_get_all()`
      - `metadef_object_get_by_id()`
      - `metadef_property_count()`
      - `metadef_property_delete()`
      - `metadef_property_delete_namespace_content()`
      - `metadef_property_get()`
      - `metadef_property_get_all()`
      - `metadef_property_get_by_id()`
      - `metadef_resource_type_association_create()`
      - `metadef_resource_type_association_delete()`
      - `metadef_resource_type_association_get()`
      - `metadef_resource_type_association_get_all_by_namespace()`
      - `metadef_resource_type_create()`
      - `metadef_resource_type_get()`
      - `metadef_resource_type_get_all()`
      - `metadef_tag_count()`
      - `metadef_tag_create_tags()`
      - `metadef_tag_delete()`
      - `metadef_tag_delete_namespace_content()`
      - `metadef_tag_get()`
      - `metadef_tag_get_all()`
      - `metadef_tag_get_by_id()`
      - `node_reference_create()`
      - `node_reference_get_by_url()`
      - `reset()`
      - `task_create()`
      - `task_delete()`
      - `task_get()`
      - `task_get_all()`
      - `task_update()`
      - `tasks_get_by_image()`
      - `update_hit_count()`
      - `user_get_storage_usage()`
  - Module contents

## Submodules

- glance.db.metadata module
  - `export_metadefs()`
  - `get_backend()`
  - `load_metadefs()`
  - `unload_metadefs()`
- glance.db.migration module
- glance.db.utils module
  - `ensure_image_dict_v2_compliant()`
  - `is_image_visible()`
  - `mutate_image_dict_to_v1()`

## Module contents

class glance.db.ImageMemberRepo(context, db_api, image)

  Bases: `object`

  add(image_member)
  get(member_id)
  list()
  remove(image_member)
  save(image_member, from_state=None)

class glance.db.ImageProxy(image, context, db_api)

  Bases: `Image`

class glance.db.ImageRepo(context, db_api)

  Bases: `object`

  add(image)
  delete_property_atomic(image, name, value)
  get(image_id)
  list(marker=None, limit=None, sort_key=None, sort_dir=None, filters=None, member_status='accepted')
  remove(image)
  save(image, from_state=None)
  set_property_atomic(image, name, value)

class glance.db.MetadefNamespaceRepo(context, db_api)

  Bases: `object`

  add(namespace)
  get(namespace)
  list(marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters=None)
  object_count(namespace_name)
  property_count(namespace_name)
  remove(namespace)
  remove_objects(namespace)
  remove_properties(namespace)
  remove_tags(namespace)
  save(namespace)

class glance.db.MetadefObjectRepo(context, db_api)

  Bases: `object`

  add(metadata_object)
  get(namespace, object_name)
  list(marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters=None)
  remove(metadata_object)
  save(metadata_object)

class glance.db.MetadefPropertyRepo(context, db_api)

  Bases: `object`

  add(property)
  get(namespace, property_name)
  list(marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters=None)
  remove(property)
  save(property)

class glance.db.MetadefResourceTypeRepo(context, db_api)

  Bases: `object`

  add(resource_type)
  get(resource_type, namespace)
  list(filters=None)
  remove(resource_type)

class glance.db.MetadefTagRepo(context, db_api)

  Bases: `object`

  add(metadata_tag)
  add_tags(metadata_tags, can_append=False)
  get(namespace, name)
  list(marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters=None)
  remove(metadata_tag)
  save(metadata_tag)

class glance.db.TaskRepo(context, db_api)

  Bases: `object`

  add(task)
  get(task_id)
  list(marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters=None)
  remove(task)
  save(task)

glance.db.get_api()

glance.db.unwrap(db_api)

this page last updated: 2026-03-18 20:42:57

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