This Page

The quantum.db.db_base_plugin_v2 Module

class quantum.db.db_base_plugin_v2.QuantumDbPluginV2

Bases: quantum.quantum_plugin_base_v2.QuantumPluginBaseV2

A class that implements the v2 Quantum plugin interface using SQLAlchemy models. Whenever a non-read call happens the plugin will call an event handler class method (e.g., network_created()). The result is that this class can be sub-classed by other classes that add custom behaviors on certain events.

create_network(context, network)

handle creation of a single network

create_network_bulk(context, networks)
create_port(context, port)
create_port_bulk(context, ports)
create_subnet(context, subnet)
create_subnet_bulk(context, subnets)
delete_network(context, id)
delete_port(context, id)
delete_subnet(context, id)
get_network(context, id, fields=None)
get_networks(context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False)
get_networks_count(context, filters=None)
get_port(context, id, fields=None)
get_ports(context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False)
get_ports_count(context, filters=None)
get_subnet(context, id, fields=None)
get_subnets(context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False)
get_subnets_count(context, filters=None)
classmethod register_model_query_hook(model, name, query_hook, filter_hook, result_filters=None)

register an hook to be invoked when a query is executed.

Add the hooks to the _model_query_hooks dict. Models are the keys of this dict, whereas the value is another dict mapping hook names to callables performing the hook. Each hook has a “query” component, used to build the query expression and a “filter” component, which is used to build the filter expression.

Query hooks take as input the query being built and return a transformed query expression.

Filter hooks take as input the filter expression being built and return a transformed filter expression

update_fixed_ip_lease_expiration(context, network_id, ip_address, lease_remaining)
update_network(context, id, network)
update_port(context, id, port)
update_subnet(context, id, subnet)

Update the subnet with new info. The change however will not be realized until the client renew the dns lease or we support gratuitous DHCP offers