glance.cmd.manage module

Glance Management Utility

class glance.cmd.manage.DbCommands[source]

Bases: object

Class for managing the db

check()[source]

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)[source]

Run the contraction phase of a database migration.

expand(online_migration=True)[source]

Run the expansion phase of a database migration.

export_metadefs(path=None)[source]

Export metadefinitions data from database to files

load_metadefs(path=None, merge=False, prefer_new=False, overwrite=False)[source]

Load metadefinition json files to database

migrate(online_migration=True)[source]

Run the data migration phase of a database migration.

purge(age_in_days=30, max_rows=100)[source]

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

purge_images_table(age_in_days=180, max_rows=100)[source]

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

sync(version=None)[source]

Perform a complete (offline) database migration

unload_metadefs()[source]

Unload metadefinitions from database

upgrade(version='heads')[source]

Upgrade the database’s migration level

version()[source]

Print database’s current migration level

version_control(version='liberty')[source]

Place a database under migration control

class glance.cmd.manage.DbLegacyCommands(command_object)[source]

Bases: object

Class for managing the db using legacy commands

check()[source]
contract()[source]
expand()[source]
export_metadefs(path=None)[source]
load_metadefs(path=None, merge=False, prefer_new=False, overwrite=False)[source]
migrate()[source]
sync(version=None)[source]
unload_metadefs()[source]
upgrade(version='heads')[source]
version()[source]
version_control(version='liberty')[source]
glance.cmd.manage.add_command_parsers(subparsers)[source]
glance.cmd.manage.add_legacy_command_parsers(command_object, subparsers)[source]
glance.cmd.manage.args(*args, **kwargs)[source]
glance.cmd.manage.main()[source]
glance.cmd.manage.methods_of(obj)[source]

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

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