keystone.common.sql package¶
Subpackages¶
- keystone.common.sql.contract_repo package
- Subpackages
- keystone.common.sql.contract_repo.versions package
- Submodules
- keystone.common.sql.contract_repo.versions.001_contract_initial_null_migration module
- keystone.common.sql.contract_repo.versions.002_password_created_at_not_nullable module
- keystone.common.sql.contract_repo.versions.003_remove_unencrypted_blob_column_from_credential module
- keystone.common.sql.contract_repo.versions.004_reset_password_created_at module
- keystone.common.sql.contract_repo.versions.005_placeholder module
- keystone.common.sql.contract_repo.versions.006_placeholder module
- keystone.common.sql.contract_repo.versions.007_placeholder module
- keystone.common.sql.contract_repo.versions.008_placeholder module
- keystone.common.sql.contract_repo.versions.009_placeholder module
- keystone.common.sql.contract_repo.versions.010_contract_add_revocation_event_index module
- keystone.common.sql.contract_repo.versions.011_contract_user_id_unique_for_nonlocal_user module
- keystone.common.sql.contract_repo.versions.012_contract_add_domain_id_to_idp module
- keystone.common.sql.contract_repo.versions.013_protocol_cascade_delete_for_federated_user module
- keystone.common.sql.contract_repo.versions.014_contract_add_domain_id_to_user_table module
- keystone.common.sql.contract_repo.versions.015_contract_update_federated_user_domain module
- keystone.common.sql.contract_repo.versions.016_contract_add_user_options module
- Module contents
- keystone.common.sql.contract_repo.versions package
- Submodules
- keystone.common.sql.contract_repo.manage module
- Module contents
- Subpackages
- keystone.common.sql.data_migration_repo package
- Subpackages
- keystone.common.sql.data_migration_repo.versions package
- Submodules
- keystone.common.sql.data_migration_repo.versions.001_data_initial_null_migration module
- keystone.common.sql.data_migration_repo.versions.002_password_created_at_not_nullable module
- keystone.common.sql.data_migration_repo.versions.003_migrate_unencrypted_credentials module
- keystone.common.sql.data_migration_repo.versions.004_reset_password_created_at module
- keystone.common.sql.data_migration_repo.versions.005_placeholder module
- keystone.common.sql.data_migration_repo.versions.006_placeholder module
- keystone.common.sql.data_migration_repo.versions.007_placeholder module
- keystone.common.sql.data_migration_repo.versions.008_placeholder module
- keystone.common.sql.data_migration_repo.versions.009_placeholder module
- keystone.common.sql.data_migration_repo.versions.010_migrate_add_revocation_event_index module
- keystone.common.sql.data_migration_repo.versions.011_expand_user_id_unique_for_nonlocal_user module
- keystone.common.sql.data_migration_repo.versions.012_migrate_add_domain_id_to_idp module
- keystone.common.sql.data_migration_repo.versions.013_protocol_cascade_delete_for_federated_user module
- keystone.common.sql.data_migration_repo.versions.014_migrate_add_domain_id_to_user_table module
- keystone.common.sql.data_migration_repo.versions.015_migrate_update_federated_user_domain module
- keystone.common.sql.data_migration_repo.versions.016_migrate_add_user_options module
- Module contents
- keystone.common.sql.data_migration_repo.versions package
- Submodules
- keystone.common.sql.data_migration_repo.manage module
- Module contents
- Subpackages
- keystone.common.sql.expand_repo package
- Subpackages
- keystone.common.sql.expand_repo.versions package
- Submodules
- keystone.common.sql.expand_repo.versions.001_expand_initial_null_migration module
- keystone.common.sql.expand_repo.versions.002_password_created_at_not_nullable module
- keystone.common.sql.expand_repo.versions.003_add_key_hash_and_encrypted_blob_to_credential module
- keystone.common.sql.expand_repo.versions.004_reset_password_created_at module
- keystone.common.sql.expand_repo.versions.005_placeholder module
- keystone.common.sql.expand_repo.versions.006_placeholder module
- keystone.common.sql.expand_repo.versions.007_placeholder module
- keystone.common.sql.expand_repo.versions.008_placeholder module
- keystone.common.sql.expand_repo.versions.009_placeholder module
- keystone.common.sql.expand_repo.versions.010_expand_add_revocation_event_index module
- keystone.common.sql.expand_repo.versions.011_expand_user_id_unique_for_nonlocal_user module
- keystone.common.sql.expand_repo.versions.012_expand_add_domain_id_to_idp module
- keystone.common.sql.expand_repo.versions.013_protocol_cascade_delete_for_federated_user module
- keystone.common.sql.expand_repo.versions.014_expand_add_domain_id_to_user_table module
- keystone.common.sql.expand_repo.versions.015_expand_update_federated_user_domain module
- keystone.common.sql.expand_repo.versions.016_expand_add_user_options module
- Module contents
- keystone.common.sql.expand_repo.versions package
- Submodules
- keystone.common.sql.expand_repo.manage module
- Module contents
- Subpackages
- keystone.common.sql.migrate_repo package
- Subpackages
- keystone.common.sql.migrate_repo.versions package
- Submodules
- keystone.common.sql.migrate_repo.versions.067_kilo module
- keystone.common.sql.migrate_repo.versions.068_placeholder module
- keystone.common.sql.migrate_repo.versions.069_placeholder module
- keystone.common.sql.migrate_repo.versions.070_placeholder module
- keystone.common.sql.migrate_repo.versions.071_placeholder module
- keystone.common.sql.migrate_repo.versions.072_placeholder module
- keystone.common.sql.migrate_repo.versions.073_insert_assignment_inherited_pk module
- keystone.common.sql.migrate_repo.versions.074_add_is_domain_project module
- keystone.common.sql.migrate_repo.versions.075_confirm_config_registration module
- keystone.common.sql.migrate_repo.versions.076_placeholder module
- keystone.common.sql.migrate_repo.versions.077_placeholder module
- keystone.common.sql.migrate_repo.versions.078_placeholder module
- keystone.common.sql.migrate_repo.versions.079_placeholder module
- keystone.common.sql.migrate_repo.versions.080_placeholder module
- keystone.common.sql.migrate_repo.versions.081_add_endpoint_policy_table module
- keystone.common.sql.migrate_repo.versions.082_add_federation_tables module
- keystone.common.sql.migrate_repo.versions.083_add_oauth1_tables module
- keystone.common.sql.migrate_repo.versions.084_add_revoke_tables module
- keystone.common.sql.migrate_repo.versions.085_add_endpoint_filtering_table module
- keystone.common.sql.migrate_repo.versions.086_add_duplicate_constraint_trusts module
- keystone.common.sql.migrate_repo.versions.087_implied_roles module
- keystone.common.sql.migrate_repo.versions.088_domain_specific_roles module
- keystone.common.sql.migrate_repo.versions.089_add_root_of_all_domains module
- keystone.common.sql.migrate_repo.versions.090_add_local_user_and_password_tables module
- keystone.common.sql.migrate_repo.versions.091_migrate_data_to_local_user_and_password_tables module
- keystone.common.sql.migrate_repo.versions.092_make_implied_roles_fks_cascaded module
- keystone.common.sql.migrate_repo.versions.093_migrate_domains_to_projects module
- keystone.common.sql.migrate_repo.versions.094_add_federated_user_table module
- keystone.common.sql.migrate_repo.versions.095_add_integer_pkey_to_revocation_event_table module
- keystone.common.sql.migrate_repo.versions.096_drop_role_name_constraint module
- keystone.common.sql.migrate_repo.versions.097_drop_user_name_domainid_constraint module
- keystone.common.sql.migrate_repo.versions.098_placeholder module
- keystone.common.sql.migrate_repo.versions.099_placeholder module
- keystone.common.sql.migrate_repo.versions.100_placeholder module
- keystone.common.sql.migrate_repo.versions.101_drop_role_name_constraint module
- keystone.common.sql.migrate_repo.versions.102_drop_domain_table module
- keystone.common.sql.migrate_repo.versions.103_add_nonlocal_user_table module
- keystone.common.sql.migrate_repo.versions.104_drop_user_name_domainid_constraint module
- keystone.common.sql.migrate_repo.versions.105_add_password_date_columns module
- keystone.common.sql.migrate_repo.versions.106_allow_password_column_to_be_nullable module
- keystone.common.sql.migrate_repo.versions.107_add_user_date_columns module
- keystone.common.sql.migrate_repo.versions.108_add_failed_auth_columns module
- keystone.common.sql.migrate_repo.versions.109_add_password_self_service_column module
- Module contents
- keystone.common.sql.migrate_repo.versions package
- Submodules
- keystone.common.sql.migrate_repo.manage module
- Module contents
- Subpackages
Submodules¶
keystone.common.sql.core module¶
SQL backends for the various services.
Before using this module, call initialize(). This has to be done before CONF() because it sets up configuration options.
-
class
keystone.common.sql.core.
DictBase
[source]¶ Bases:
oslo_db.sqlalchemy.models.ModelBase
-
attributes
= []¶
-
-
class
keystone.common.sql.core.
JsonBlob
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.sql.type_api.TypeDecorator
-
impl
¶ alias of
Text
-
-
keystone.common.sql.core.
filter_limit_query
(model, query, hints)[source]¶ Apply filtering and limit to a query.
Parameters: - model – table model
- query – query to apply filters to
- hints – contains the list of filters and limit details. This may be None, indicating that there are no filters or limits to be applied. If it’s not None, then any filters satisfied here will be removed so that the caller will know if any filters remain.
Returns: updated query
-
keystone.common.sql.core.
handle_conflicts
(conflict_type='object')[source]¶ Convert select sqlalchemy exceptions into HTTP 409 Conflict.
-
keystone.common.sql.core.
initialize_decorator
(init)[source]¶ Ensure that the length of string field do not exceed the limit.
This decorator check the initialize arguments, to make sure the length of string field do not exceed the length limit, or raise a ‘StringLengthExceeded’ exception.
Use decorator instead of inheritance, because the metaclass will check the __tablename__, primary key columns, etc. at the class definition.
keystone.common.sql.upgrades module¶
-
keystone.common.sql.upgrades.
contract_schema
()[source]¶ Contract the database.
This is run manually by the keystone-manage command once the keystone nodes have been upgraded to the latest release and will remove any old tables/columns that are no longer required.
-
keystone.common.sql.upgrades.
expand_schema
()[source]¶ Expand the database schema ahead of data migration.
This is run manually by the keystone-manage command before the first keystone node is migrated to the latest release.
-
keystone.common.sql.upgrades.
find_repo
(repo_name)[source]¶ Return the absolute path to the named repository.
-
keystone.common.sql.upgrades.
get_init_version
(abs_path=None)[source]¶ Get the initial version of a migrate repository.
Parameters: abs_path – Absolute path to migrate repository. Returns: initial version number or None, if DB is empty.
-
keystone.common.sql.upgrades.
migrate_data
()[source]¶ Migrate data to match the new schema.
This is run manually by the keystone-manage command once the keystone schema has been expanded for the new release.
-
keystone.common.sql.upgrades.
offline_sync_database_to_version
(version=None)[source]¶ Perform and off-line sync of the database.
Migrate the database up to the latest version, doing the equivalent of the cycle of –expand, –migrate and –contract, for when an offline upgrade is being performed.
If a version is specified then only migrate the database up to that version. Downgrading is not supported. If version is specified, then only the main database migration is carried out - and the expand, migration and contract phases will NOT be run.
-
keystone.common.sql.upgrades.
rename_tables_with_constraints
(renames, constraints, engine)[source]¶ Rename tables with foreign key constraints.
Tables are renamed after first removing constraints. The constraints are replaced after the rename is complete.
This works on databases that don’t support renaming tables that have constraints on them (DB2).
renames is a dict, mapping {‘to_table_name’: from_table, ...}