heat.db.sqlalchemy.api module

Implementation of SQLAlchemy backend.

heat.db.sqlalchemy.api.db_decrypt_parameters_and_properties(ctxt, encryption_key, batch_size=50, verbose=False)[source]

Decrypt parameters and properties for all templates in db.

Parameters
  • ctxt – RPC context

  • encryption_key – key that will be used for parameter and property decryption

  • batch_size – number of templates requested from DB in each iteration. 50 means that heat requests 50 templates, encrypt them and proceed with next 50 items.

  • verbose – log an INFO message when processing of each raw_template or resource begins or ends

Returns

list of exceptions encountered during decryption

heat.db.sqlalchemy.api.db_encrypt_parameters_and_properties(ctxt, encryption_key, batch_size=50, verbose=False)[source]

Encrypt parameters and properties for all templates in db.

Parameters
  • ctxt – RPC context

  • encryption_key – key that will be used for parameter and property encryption

  • batch_size – number of templates requested from DB in each iteration. 50 means that heat requests 50 templates, encrypt them and proceed with next 50 items.

  • verbose – log an INFO message when processing of each raw_template or resource begins or ends

Returns

list of exceptions encountered during encryption

heat.db.sqlalchemy.api.db_properties_data_migrate(ctxt, batch_size=50)[source]

Migrate properties data from legacy columns to new location in db.

Parameters
  • ctxt – RPC context

  • batch_size – number of templates requested from DB in each iteration. 50 means that heat requests 50 templates, encrypt them and proceed with next 50 items.

heat.db.sqlalchemy.api.db_sync(engine, version=None)[source]

Migrate the database to version or the most recent version.

heat.db.sqlalchemy.api.db_version(engine)[source]

Display the current database version.

heat.db.sqlalchemy.api.delete_softly(context, obj)[source]

Mark this object as deleted.

heat.db.sqlalchemy.api.engine_get_all_locked_by_stack(context, stack_id)[source]
heat.db.sqlalchemy.api.event_count_all_by_stack(context, stack_id)[source]
heat.db.sqlalchemy.api.event_create(context, values)[source]
heat.db.sqlalchemy.api.event_get_all_by_stack(context, stack_id, limit=None, marker=None, sort_keys=None, sort_dir=None, filters=None)[source]
heat.db.sqlalchemy.api.event_get_all_by_tenant(context, limit=None, marker=None, sort_keys=None, sort_dir=None, filters=None)[source]
heat.db.sqlalchemy.api.get_engine()[source]
heat.db.sqlalchemy.api.get_facade()[source]
heat.db.sqlalchemy.api.get_session()[source]
heat.db.sqlalchemy.api.persist_state_and_release_lock(context, stack_id, engine_id, values)[source]
heat.db.sqlalchemy.api.purge_deleted(age, granularity='days', project_id=None, batch_size=20)[source]
heat.db.sqlalchemy.api.raw_template_create(context, values)[source]
heat.db.sqlalchemy.api.raw_template_delete(context, template_id)[source]
heat.db.sqlalchemy.api.raw_template_files_create(context, values)[source]
heat.db.sqlalchemy.api.raw_template_files_get(context, files_id)[source]
heat.db.sqlalchemy.api.raw_template_get(context, template_id)[source]
heat.db.sqlalchemy.api.raw_template_update(context, template_id, values)[source]
heat.db.sqlalchemy.api.reset_stack_status(context, stack_id, stack=None)[source]
heat.db.sqlalchemy.api.resource_attr_data_delete(context, resource_id, attr_id)[source]
heat.db.sqlalchemy.api.resource_attr_id_set(context, resource_id, atomic_key, attr_id)[source]
heat.db.sqlalchemy.api.resource_create(context, values)[source]
heat.db.sqlalchemy.api.resource_create_replacement(context, existing_res_id, new_res_values, atomic_key, expected_engine_id=None)[source]
heat.db.sqlalchemy.api.resource_data_delete(context, resource_id, key)[source]
heat.db.sqlalchemy.api.resource_data_get(context, resource_id, key)[source]

Lookup value of resource’s data by key.

Decrypts resource data if necessary.

heat.db.sqlalchemy.api.resource_data_get_all(context, resource_id, data=None)[source]

Looks up resource_data by resource.id.

If data is encrypted, this method will decrypt the results.

heat.db.sqlalchemy.api.resource_data_get_by_key(context, resource_id, key)[source]

Looks up resource_data by resource_id and key.

Does not decrypt resource_data.

heat.db.sqlalchemy.api.resource_data_set(context, resource_id, key, value, redact=False)[source]

Save resource’s key/value pair to database.

heat.db.sqlalchemy.api.resource_delete(context, resource_id)[source]
heat.db.sqlalchemy.api.resource_exchange_stacks(context, resource_id1, resource_id2)[source]
heat.db.sqlalchemy.api.resource_get(context, resource_id, refresh=False, refresh_data=False, eager=True)[source]
heat.db.sqlalchemy.api.resource_get_all(context)[source]
heat.db.sqlalchemy.api.resource_get_all_active_by_stack(context, stack_id)[source]
heat.db.sqlalchemy.api.resource_get_all_by_physical_resource_id(context, physical_resource_id)[source]
heat.db.sqlalchemy.api.resource_get_all_by_root_stack(context, stack_id, filters=None, stack_id_only=False)[source]
heat.db.sqlalchemy.api.resource_get_all_by_stack(context, stack_id, filters=None)[source]
heat.db.sqlalchemy.api.resource_get_by_name_and_stack(context, resource_name, stack_id)[source]
heat.db.sqlalchemy.api.resource_get_by_physical_resource_id(context, physical_resource_id)[source]
heat.db.sqlalchemy.api.resource_prop_data_create(context, values)[source]
heat.db.sqlalchemy.api.resource_prop_data_create_or_update(context, values, rpd_id=None)[source]
heat.db.sqlalchemy.api.resource_prop_data_get(context, resource_prop_data_id)[source]
heat.db.sqlalchemy.api.resource_purge_deleted(context, stack_id)[source]
heat.db.sqlalchemy.api.resource_update(context, resource_id, values, atomic_key, expected_engine_id=None)[source]
heat.db.sqlalchemy.api.resource_update_and_save(context, resource_id, values)[source]
heat.db.sqlalchemy.api.retry_on_db_error(func)[source]
heat.db.sqlalchemy.api.service_create(context, values)[source]
heat.db.sqlalchemy.api.service_delete(context, service_id, soft_delete=True)[source]
heat.db.sqlalchemy.api.service_get(context, service_id)[source]
heat.db.sqlalchemy.api.service_get_all(context)[source]
heat.db.sqlalchemy.api.service_get_all_by_args(context, host, binary, hostname)[source]
heat.db.sqlalchemy.api.service_update(context, service_id, values)[source]
heat.db.sqlalchemy.api.snapshot_create(context, values)[source]
heat.db.sqlalchemy.api.snapshot_delete(context, snapshot_id)[source]
heat.db.sqlalchemy.api.snapshot_get(context, snapshot_id)[source]
heat.db.sqlalchemy.api.snapshot_get_all(context, stack_id)[source]
heat.db.sqlalchemy.api.snapshot_get_by_stack(context, snapshot_id, stack)[source]
heat.db.sqlalchemy.api.snapshot_update(context, snapshot_id, values)[source]
heat.db.sqlalchemy.api.soft_delete_aware_query(context, *args, **kwargs)[source]

Stack query helper that accounts for context’s show_deleted field.

Parameters

show_deleted – if True, overrides context’s show_deleted field.

heat.db.sqlalchemy.api.software_config_create(context, values)[source]
heat.db.sqlalchemy.api.software_config_delete(context, config_id)[source]
heat.db.sqlalchemy.api.software_config_get(context, config_id)[source]
heat.db.sqlalchemy.api.software_config_get_all(context, limit=None, marker=None)[source]
heat.db.sqlalchemy.api.software_deployment_create(context, values)[source]
heat.db.sqlalchemy.api.software_deployment_delete(context, deployment_id)[source]
heat.db.sqlalchemy.api.software_deployment_get(context, deployment_id)[source]
heat.db.sqlalchemy.api.software_deployment_get_all(context, server_id=None)[source]
heat.db.sqlalchemy.api.software_deployment_update(context, deployment_id, values)[source]
heat.db.sqlalchemy.api.stack_count_all(context, filters=None, show_deleted=False, show_nested=False, show_hidden=False, tags=None, tags_any=None, not_tags=None, not_tags_any=None)[source]
heat.db.sqlalchemy.api.stack_count_total_resources(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_create(context, values)[source]
heat.db.sqlalchemy.api.stack_delete(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_get(context, stack_id, show_deleted=False, eager_load=True)[source]
heat.db.sqlalchemy.api.stack_get_all(context, limit=None, sort_keys=None, marker=None, sort_dir=None, filters=None, show_deleted=False, show_nested=False, show_hidden=False, tags=None, tags_any=None, not_tags=None, not_tags_any=None, eager_load=False)[source]
heat.db.sqlalchemy.api.stack_get_all_by_owner_id(context, owner_id)[source]
heat.db.sqlalchemy.api.stack_get_all_by_root_owner_id(context, owner_id)[source]
heat.db.sqlalchemy.api.stack_get_by_name(context, stack_name)[source]
heat.db.sqlalchemy.api.stack_get_by_name_and_owner_id(context, stack_name, owner_id)[source]
heat.db.sqlalchemy.api.stack_get_root_id(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_get_status(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_lock_create(context, stack_id, engine_id)[source]
heat.db.sqlalchemy.api.stack_lock_get_engine_id(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_lock_release(context, stack_id, engine_id)[source]
heat.db.sqlalchemy.api.stack_lock_steal(context, stack_id, old_engine_id, new_engine_id)[source]
heat.db.sqlalchemy.api.stack_tags_delete(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_tags_get(context, stack_id)[source]
heat.db.sqlalchemy.api.stack_tags_set(context, stack_id, tags)[source]
heat.db.sqlalchemy.api.stack_update(context, stack_id, values, exp_trvsl=None)[source]
heat.db.sqlalchemy.api.sync_point_create(context, values)[source]
heat.db.sqlalchemy.api.sync_point_delete_all_by_stack_and_traversal(context, stack_id, traversal_id)[source]
heat.db.sqlalchemy.api.sync_point_get(context, entity_id, traversal_id, is_update)[source]
heat.db.sqlalchemy.api.sync_point_update_input_data(context, entity_id, traversal_id, is_update, atomic_key, input_data)[source]
heat.db.sqlalchemy.api.update_and_save(context, obj, values)[source]
heat.db.sqlalchemy.api.user_creds_create(context)[source]
heat.db.sqlalchemy.api.user_creds_delete(context, user_creds_id)[source]
heat.db.sqlalchemy.api.user_creds_get(context, user_creds_id)[source]