The nova.db.sqlalchemy.api Module

Implementation of SQLAlchemy backend.

class Constraint(conditions)

Bases: object

apply(model, query)
class EqualityCondition(values)

Bases: object

clauses(field)
class InequalityCondition(values)

Bases: object

clauses(field)
action_event_finish(context, values)

Finish an event on an instance action.

action_event_get_by_id(context, action_id, event_id)
action_event_start(context, values)

Start an event on an instance action.

action_events_get(context, action_id)
action_finish(context, values)
action_get_by_request_id(context, instance_uuid, request_id)

Get the action by request_id and given instance.

action_start(context, values)
actions_get(context, instance_uuid)

Get all instance actions for the provided uuid.

agent_build_create(*args, **kwargs)
agent_build_destroy(*args, **kwargs)
agent_build_get_all(*args, **kwargs)
agent_build_get_by_triple(*args, **kwargs)
agent_build_update(*args, **kwargs)
aggregate_create(*args, **kwargs)
aggregate_delete(*args, **kwargs)
aggregate_get(*args, **kwargs)
aggregate_get_all(*args, **kwargs)
aggregate_get_by_host(*args, **kwargs)
aggregate_host_add(*args, **kwargs)
aggregate_host_delete(*args, **kwargs)
aggregate_host_get_all(*args, **kwargs)
aggregate_host_get_by_metadata_key(*args, **kwargs)
aggregate_metadata_add(*args, **kwargs)
aggregate_metadata_delete(*args, **kwargs)
aggregate_metadata_get(*args, **kwargs)
aggregate_metadata_get_by_host(*args, **kwargs)
aggregate_metadata_get_query(*args, **kwargs)
aggregate_update(*args, **kwargs)
archive_deleted_rows(*args, **kwargs)
archive_deleted_rows_for_table(*args, **kwargs)
block_device_mapping_create(*args, **kwargs)
block_device_mapping_destroy(*args, **kwargs)
block_device_mapping_destroy_by_instance_and_device(*args, **kwargs)
block_device_mapping_destroy_by_instance_and_volume(*args, **kwargs)
block_device_mapping_get_all_by_instance(*args, **kwargs)
block_device_mapping_update(*args, **kwargs)
block_device_mapping_update_or_create(*args, **kwargs)
bw_usage_get(*args, **kwargs)
bw_usage_get_by_uuids(*args, **kwargs)
bw_usage_update(*args, **kwargs)
cell_create(*args, **kwargs)
cell_delete(*args, **kwargs)
cell_get(*args, **kwargs)
cell_get_all(*args, **kwargs)
cell_update(*args, **kwargs)
certificate_create(*args, **kwargs)
certificate_get(*args, **kwargs)
certificate_get_all_by_project(*args, **kwargs)
certificate_get_all_by_user(*args, **kwargs)
certificate_get_all_by_user_and_project(*args, **kwargs)
compute_node_create(*args, **kwargs)
compute_node_delete(*args, **kwargs)
compute_node_get(context, compute_id)
compute_node_get_all(*args, **kwargs)
compute_node_search_by_hypervisor(*args, **kwargs)
compute_node_statistics(context)

Compute statistics over all compute nodes.

compute_node_update(*args, **kwargs)
console_create(context, values)
console_delete(context, console_id)
console_get(context, console_id, instance_uuid=None)
console_get_all_by_instance(context, instance_uuid)
console_get_by_pool_instance(context, pool_id, instance_uuid)
console_pool_create(context, values)
console_pool_get_all_by_host_type(context, host, console_type)
console_pool_get_by_host_type(context, compute_host, host, console_type)
constraint(**conditions)
convert_datetimes(values, *datetime_keys)
dnsdomain_get(*args, **kwargs)
dnsdomain_list(*args, **kwargs)
dnsdomain_register_for_project(*args, **kwargs)
dnsdomain_register_for_zone(*args, **kwargs)
dnsdomain_unregister(*args, **kwargs)
ec2_instance_create(*args, **kwargs)
ec2_snapshot_create(*args, **kwargs)
ec2_volume_create(*args, **kwargs)
equal_any(*values)
exact_filter(query, model, filters, legal_keys)

Applies exact match filtering to a query.

Returns the updated query. Modifies filters argument to remove filters consumed.

Parameters:
  • query – query to apply filters to
  • model – model object the query applies to, for IN-style filtering
  • filters – dictionary of filters; values that are lists, tuples, sets, or frozensets cause an ‘IN’ test to be performed, while exact matching (‘==’ operator) is used for other values
  • legal_keys – list of keys to apply exact filtering to
fixed_ip_associate(*args, **kwargs)
fixed_ip_associate_pool(*args, **kwargs)
fixed_ip_bulk_create(*args, **kwargs)
fixed_ip_count_by_project(*args, **kwargs)
fixed_ip_create(*args, **kwargs)
fixed_ip_disassociate(*args, **kwargs)
fixed_ip_disassociate_all_by_timeout(*args, **kwargs)
fixed_ip_get(*args, **kwargs)
fixed_ip_get_all(*args, **kwargs)
fixed_ip_get_by_address(*args, **kwargs)
fixed_ip_get_by_address_detailed(*args, **kwargs)
fixed_ip_get_by_floating_address(*args, **kwargs)
fixed_ip_get_by_host(*args, **kwargs)
fixed_ip_get_by_instance(*args, **kwargs)
fixed_ip_get_by_network_host(*args, **kwargs)
fixed_ip_update(*args, **kwargs)
fixed_ips_by_virtual_interface(*args, **kwargs)
floating_ip_allocate_address(*args, **kwargs)
floating_ip_bulk_create(*args, **kwargs)
floating_ip_bulk_destroy(*args, **kwargs)
floating_ip_count_by_project(*args, **kwargs)
floating_ip_create(*args, **kwargs)
floating_ip_deallocate(*args, **kwargs)
floating_ip_destroy(*args, **kwargs)
floating_ip_disassociate(*args, **kwargs)
floating_ip_fixed_ip_associate(*args, **kwargs)
floating_ip_get(*args, **kwargs)
floating_ip_get_all(*args, **kwargs)
floating_ip_get_all_by_host(*args, **kwargs)
floating_ip_get_all_by_project(*args, **kwargs)
floating_ip_get_by_address(*args, **kwargs)
floating_ip_get_by_fixed_address(*args, **kwargs)
floating_ip_get_by_fixed_ip_id(*args, **kwargs)
floating_ip_get_pools(*args, **kwargs)
floating_ip_set_auto_assigned(*args, **kwargs)
floating_ip_update(*args, **kwargs)
get_backend()

The backend is this module itself.

get_ec2_instance_id_by_uuid(*args, **kwargs)
get_ec2_snapshot_id_by_uuid(*args, **kwargs)
get_ec2_volume_id_by_uuid(*args, **kwargs)
get_instance_uuid_by_ec2_id(*args, **kwargs)
get_snapshot_uuid_by_ec2_id(*args, **kwargs)
get_volume_uuid_by_ec2_id(*args, **kwargs)
instance_add_security_group(context, instance_uuid, security_group_id)

Associate the given security group with the given instance.

instance_create(*args, **kwargs)
instance_data_get_for_project(*args, **kwargs)
instance_destroy(*args, **kwargs)
instance_fault_create(context, values)

Create a new InstanceFault.

instance_fault_get_by_instance_uuids(context, instance_uuids)

Get all instance faults for the provided instance_uuids.

instance_floating_address_get_all(*args, **kwargs)
instance_get(*args, **kwargs)
instance_get_active_by_window_joined(*args, **kwargs)
instance_get_all(*args, **kwargs)
instance_get_all_by_filters(*args, **kwargs)
instance_get_all_by_host(*args, **kwargs)
instance_get_all_by_host_and_node(*args, **kwargs)
instance_get_all_by_host_and_not_type(*args, **kwargs)
instance_get_all_hung_in_rebooting(*args, **kwargs)
instance_get_by_uuid(*args, **kwargs)
instance_get_floating_address(*args, **kwargs)
instance_info_cache_delete(*args, **kwargs)
instance_info_cache_get(*args, **kwargs)
instance_info_cache_update(*args, **kwargs)
instance_metadata_delete(*args, **kwargs)
instance_metadata_get(*args, **kwargs)
instance_metadata_update(*args, **kwargs)
instance_remove_security_group(*args, **kwargs)
instance_system_metadata_get(*args, **kwargs)
instance_system_metadata_update(*args, **kwargs)
instance_type_access_add(*args, **kwargs)
instance_type_access_get_by_flavor_id(*args, **kwargs)
instance_type_access_remove(*args, **kwargs)
instance_type_create(*args, **kwargs)
instance_type_destroy(*args, **kwargs)
instance_type_extra_specs_delete(*args, **kwargs)
instance_type_extra_specs_get(*args, **kwargs)
instance_type_extra_specs_update_or_create(*args, **kwargs)
instance_type_get(*args, **kwargs)
instance_type_get_all(*args, **kwargs)
instance_type_get_by_flavor_id(*args, **kwargs)
instance_type_get_by_name(*args, **kwargs)
instance_update(*args, **kwargs)
instance_update_and_get_original(*args, **kwargs)
key_pair_count_by_user(context, user_id)
key_pair_create(*args, **kwargs)
key_pair_destroy(*args, **kwargs)
key_pair_get(*args, **kwargs)
key_pair_get_all_by_user(*args, **kwargs)
migration_create(*args, **kwargs)
migration_get(*args, **kwargs)
migration_get_by_instance_and_status(*args, **kwargs)
migration_get_in_progress_by_host_and_node(*args, **kwargs)
migration_get_unconfirmed_by_dest_compute(*args, **kwargs)
migration_update(*args, **kwargs)
model_query(context, model, *args, **kwargs)

Query helper that accounts for context’s read_deleted field.

Parameters:
  • context – context to query under
  • session – if present, the session to use
  • read_deleted – if present, overrides context’s read_deleted field.
  • project_only – if present and context is user-type, then restrict query to match the context’s project_id. If set to ‘allow_none’, restriction includes project_id = None.
  • base_model – Where model_query is passed a “model” parameter which is not a subclass of NovaBase, we should pass an extra base_model parameter that is a subclass of NovaBase and corresponds to the model parameter.
network_associate(*args, **kwargs)
network_count_reserved_ips(*args, **kwargs)
network_create_safe(*args, **kwargs)
network_delete_safe(*args, **kwargs)
network_disassociate(*args, **kwargs)
network_get(*args, **kwargs)
network_get_all(*args, **kwargs)
network_get_all_by_host(*args, **kwargs)
network_get_all_by_instance(*args, **kwargs)
network_get_all_by_uuids(*args, **kwargs)
network_get_associated_fixed_ips(*args, **kwargs)
network_get_by_cidr(*args, **kwargs)
network_get_by_uuid(*args, **kwargs)
network_in_use_on_host(context, network_id, host)
network_set_host(*args, **kwargs)
network_update(*args, **kwargs)
not_equal(*values)
project_get_networks(*args, **kwargs)
provider_fw_rule_create(*args, **kwargs)
provider_fw_rule_destroy(*args, **kwargs)
provider_fw_rule_get_all(*args, **kwargs)
quota_class_create(*args, **kwargs)
quota_class_get(*args, **kwargs)
quota_class_get_all_by_name(*args, **kwargs)
quota_class_update(*args, **kwargs)
quota_create(*args, **kwargs)
quota_destroy_all_by_project(*args, **kwargs)
quota_get(*args, **kwargs)
quota_get_all_by_project(*args, **kwargs)
quota_reserve(*args, **kwargs)
quota_update(*args, **kwargs)
quota_usage_get(*args, **kwargs)
quota_usage_get_all_by_project(*args, **kwargs)
quota_usage_update(*args, **kwargs)
regex_filter(query, model, filters)

Applies regular expression filtering to a query.

Returns the updated query.

Parameters:
  • query – query to apply filters to
  • model – model object the query applies to
  • filters – dictionary of filters with regex values
require_admin_context(f)

Decorator to require admin request context.

The first argument to the wrapped function must be the context.

require_aggregate_exists(f)

Decorator to require the specified aggregate to exist.

Requires the wrapped function to use context and aggregate_id as their first two arguments.

require_context(f)

Decorator to require any user or admin context.

This does no authorization for user or project access matching, see nova.context.authorize_project_context() and nova.context.authorize_user_context().

The first argument to the wrapped function must be the context.

require_instance_exists_using_uuid(f)

Decorator to require the specified instance to exist.

Requires the wrapped function to use context and instance_uuid as their first two arguments.

reservation_commit(*args, **kwargs)
reservation_create(*args, **kwargs)
reservation_expire(*args, **kwargs)
reservation_get(*args, **kwargs)
reservation_rollback(*args, **kwargs)
s3_image_create(context, image_uuid)

Create local s3 image represented by provided uuid.

s3_image_get(context, image_id)

Find local s3 image represented by the provided id.

s3_image_get_by_uuid(context, image_uuid)

Find local s3 image represented by the provided uuid.

security_group_count_by_project(*args, **kwargs)
security_group_create(*args, **kwargs)
security_group_default_rule_create(*args, **kwargs)
security_group_default_rule_destroy(*args, **kwargs)
security_group_default_rule_get(*args, **kwargs)
security_group_default_rule_list(*args, **kwargs)
security_group_destroy(*args, **kwargs)
security_group_ensure_default(context, session=None)

Ensure default security group exists for a project_id.

Returns a tuple with the first element being a bool indicating if the default security group previously existed. Second element is the dict used to create the default security group.

security_group_exists(*args, **kwargs)
security_group_get(*args, **kwargs)
security_group_get_all(*args, **kwargs)
security_group_get_by_instance(*args, **kwargs)
security_group_get_by_name(*args, **kwargs)
security_group_get_by_project(*args, **kwargs)
security_group_in_use(*args, **kwargs)
security_group_rule_count_by_group(*args, **kwargs)
security_group_rule_create(*args, **kwargs)
security_group_rule_destroy(*args, **kwargs)
security_group_rule_get(*args, **kwargs)
security_group_rule_get_by_security_group(*args, **kwargs)
security_group_rule_get_by_security_group_grantee(*args, **kwargs)
service_create(*args, **kwargs)
service_destroy(*args, **kwargs)
service_get(*args, **kwargs)
service_get_all(*args, **kwargs)
service_get_all_by_host(*args, **kwargs)
service_get_all_by_topic(*args, **kwargs)
service_get_by_args(*args, **kwargs)
service_get_by_compute_host(*args, **kwargs)
service_get_by_host_and_topic(*args, **kwargs)
service_update(*args, **kwargs)
task_log_begin_task(*args, **kwargs)
task_log_end_task(*args, **kwargs)
task_log_get(*args, **kwargs)
task_log_get_all(*args, **kwargs)
virtual_interface_create(*args, **kwargs)
virtual_interface_delete_by_instance(*args, **kwargs)
virtual_interface_get(*args, **kwargs)
virtual_interface_get_all(*args, **kwargs)
virtual_interface_get_by_address(*args, **kwargs)
virtual_interface_get_by_instance(*args, **kwargs)
virtual_interface_get_by_instance_and_network(*args, **kwargs)
virtual_interface_get_by_uuid(*args, **kwargs)
vol_get_usage_by_time(*args, **kwargs)
vol_usage_update(*args, **kwargs)

Previous topic

The nova.db.migration Module

Next topic

The nova.db.sqlalchemy.migrate_repo.manage Module

This Page