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)
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_metadata_add(*args, **kwargs)
aggregate_metadata_delete(*args, **kwargs)
aggregate_metadata_get(*args, **kwargs)
aggregate_metadata_get_by_host(*args, **kwargs)
aggregate_metadata_get_item(*args, **kwargs)
aggregate_update(*args, **kwargs)
authorize_project_context(context, project_id)

Ensures a request has permission to access the given project.

authorize_quota_class_context(context, class_name)

Ensures a request has permission to access the given quota class.

authorize_user_context(context, user_id)

Ensures a request has permission to access the given user.

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_by_uuids(*args, **kwargs)
bw_usage_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_get(context, compute_id, session=None)
compute_node_get_all(*args, **kwargs)
compute_node_get_by_host(context, host)

Get all capacity entries for the given host.

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)
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_instance(*args, **kwargs)
fixed_ip_get_by_network_host(*args, **kwargs)
fixed_ip_get_network(*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_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_get(*args, **kwargs)
instance_get_active_by_window(*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_not_type(*args, **kwargs)
instance_get_all_by_project(*args, **kwargs)
instance_get_all_by_reservation(*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_create(*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_get_item(*args, **kwargs)
instance_metadata_update(*args, **kwargs)
instance_remove_security_group(*args, **kwargs)
instance_system_metadata_delete(*args, **kwargs)
instance_system_metadata_get(*args, **kwargs)
instance_system_metadata_update(*args, **kwargs)
instance_test_and_set(*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_get_item(*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)
is_admin_context(context)

Indicates if the request context is an administrator.

is_user_context(context)

Indicates if the request context is a normal user.

iscsi_target_count_by_host(*args, **kwargs)
iscsi_target_create_safe(*args, **kwargs)
key_pair_count_by_user(context, user_id)
key_pair_create(*args, **kwargs)
key_pair_destroy(*args, **kwargs)
key_pair_destroy_all_by_user(*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_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.
network_associate(*args, **kwargs)
network_count(*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_bridge(*args, **kwargs)
network_get_by_cidr(*args, **kwargs)
network_get_by_instance(*args, **kwargs)
network_get_by_uuid(*args, **kwargs)
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_destroy(*args, **kwargs)
quota_class_destroy_all_by_name(*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(*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_create(*args, **kwargs)
quota_usage_destroy(*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 authorize_project_context() and authorize_user_context().

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

require_instance_exists(f)

Decorator to require the specified instance to exist.

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

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.

require_volume_exists(f)

Decorator to require the specified volume to exist.

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

reservation_commit(*args, **kwargs)
reservation_create(*args, **kwargs)
reservation_destroy(*args, **kwargs)
reservation_expire(*args, **kwargs)
reservation_get(*args, **kwargs)
reservation_get_all_by_project(*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_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_all_compute_by_host(*args, **kwargs)
service_get_all_compute_sorted(*args, **kwargs)
service_get_all_volume_sorted(*args, **kwargs)
service_get_by_args(*args, **kwargs)
service_get_by_host_and_topic(*args, **kwargs)
service_update(*args, **kwargs)
sm_backend_conf_create(*args, **kwargs)
sm_backend_conf_delete(*args, **kwargs)
sm_backend_conf_get(*args, **kwargs)
sm_backend_conf_get_all(*args, **kwargs)
sm_backend_conf_get_by_sr(*args, **kwargs)
sm_backend_conf_update(*args, **kwargs)
sm_flavor_create(*args, **kwargs)
sm_flavor_delete(*args, **kwargs)
sm_flavor_get(*args, **kwargs)
sm_flavor_get_all(*args, **kwargs)
sm_flavor_get_by_label(*args, **kwargs)
sm_flavor_update(*args, **kwargs)
sm_volume_create(context, values)
sm_volume_delete(context, volume_id)
sm_volume_get(context, volume_id)
sm_volume_get_all(context)
sm_volume_update(context, volume_id, values)
snapshot_create(*args, **kwargs)
snapshot_destroy(*args, **kwargs)
snapshot_get(*args, **kwargs)
snapshot_get_all(*args, **kwargs)
snapshot_get_all_by_project(*args, **kwargs)
snapshot_get_all_for_volume(*args, **kwargs)
snapshot_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(*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)
volume_allocate_iscsi_target(*args, **kwargs)
volume_attached(*args, **kwargs)
volume_create(*args, **kwargs)
volume_data_get_for_project(*args, **kwargs)
volume_destroy(*args, **kwargs)
volume_detached(*args, **kwargs)
volume_get(*args, **kwargs)
volume_get_active_by_window(*args, **kwargs)
volume_get_all(*args, **kwargs)
volume_get_all_by_host(*args, **kwargs)
volume_get_all_by_instance_uuid(*args, **kwargs)
volume_get_all_by_project(*args, **kwargs)
volume_get_iscsi_target_num(*args, **kwargs)
volume_metadata_delete(*args, **kwargs)
volume_metadata_get(*args, **kwargs)
volume_metadata_get_item(*args, **kwargs)
volume_metadata_update(*args, **kwargs)
volume_type_create(*args, **kwargs)
volume_type_destroy(*args, **kwargs)
volume_type_extra_specs_delete(*args, **kwargs)
volume_type_extra_specs_get(*args, **kwargs)
volume_type_extra_specs_get_item(*args, **kwargs)
volume_type_extra_specs_update_or_create(*args, **kwargs)
volume_type_get(*args, **kwargs)
volume_type_get_all(*args, **kwargs)
volume_type_get_by_name(*args, **kwargs)
volume_update(*args, **kwargs)

Previous topic

The nova.db.migration Module

Next topic

The nova.db.sqlalchemy.migrate_repo.manage Module

This Page