# glance.cmd.manage module

Glance Management Utility

class glance.cmd.manage.DbCommands

  Bases: `object`

  Class for managing the db

  check()

    Report any pending database upgrades.

    An exit code of 3 indicates db expand is needed, see stdout output. An exit code of 4 indicates db migrate is needed, see stdout output. An exit code of 5 indicates db contract is needed, see stdout output.

  contract(online_migration=True)

    Run the contraction phase of a database migration.

  expand(online_migration=True)

    Run the expansion phase of a database migration.

  export_metadefs(path=None)

    Export metadefinitions data from database to files

  load_metadefs(path=None, merge=False, prefer_new=False, overwrite=False)

    Load metadefinition json files to database

  migrate(online_migration=True)

    Run the data migration phase of a database migration.

  purge(age_in_days=30, max_rows=100)

    Purge deleted rows older than a given age from glance tables.

  purge_images_table(age_in_days=180, max_rows=100)

    Purge deleted rows older than a given age from images table.

  sync(version=None)

    Perform a complete (offline) database migration

  unload_metadefs()

    Unload metadefinitions from database

  upgrade(version='heads')

    Upgrade the database’s migration level

  version()

    Print database’s current migration level

  version_control(version='liberty')

    Place a database under migration control

class glance.cmd.manage.DbLegacyCommands(command_object)

  Bases: `object`

  Class for managing the db using legacy commands

  check()
  contract()
  expand()
  export_metadefs(path=None)
  load_metadefs(path=None, merge=False, prefer_new=False, overwrite=False)
  migrate()
  sync(version=None)
  unload_metadefs()
  upgrade(version='heads')
  version()
  version_control(version='liberty')

glance.cmd.manage.add_command_parsers(subparsers)

glance.cmd.manage.add_legacy_command_parsers(command_object, subparsers)

glance.cmd.manage.args(*args, **kwargs)

glance.cmd.manage.main()

glance.cmd.manage.methods_of(obj)

  Get all callable methods of an object that don’t start with underscore

  returns a list of tuples of the form (method_name, method)

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