This Page

The quantum.plugins.bigswitch.plugin Module

Quantum REST Proxy Plug-in for Big Switch and FloodLight Controllers

QuantumRestProxy provides a generic quantum plugin that translates all plugin function calls to equivalent authenticated REST calls to a set of redundant external network controllers. It also keeps persistent store for all quantum state to allow for re-sync of the external controller(s), if required.

The local state on the plugin also allows for local response and fast-fail semantics where it can be determined based on the local persistent store.

Network controller specific code is decoupled from this plugin and expected to reside on the controller itself (via the REST interface).

This allows for:
  • independent authentication and redundancy schemes between quantum and the network controller
  • independent upgrade/development cycles between quantum and the controller as it limits the proxy code upgrade requirement to quantum release cycle and the controller specific code upgrade requirement to controller code
  • ability to sync the controller with quantum for independent recovery/reset

External REST API used by proxy is the same API as defined for quantum (JSON subset) with some additional parameters (gateway on network-create and macaddr on port-attach) on an additional PUT to do a bulk dump of all persistent data.

class quantum.plugins.bigswitch.plugin.QuantumRestProxyV2

Bases: quantum.db.db_base_plugin_v2.QuantumDbPluginV2, quantum.db.l3_db.L3_NAT_db_mixin

add_router_interface(context, router_id, interface_info)
binding_set = 'extension:port_binding:set'
binding_view = 'extension:port_binding:view'
create_floatingip(context, floatingip)
create_network(context, network)

Create a network, which represents an L2 network segment which can have a set of subnets and ports associated with it. :param context: quantum api request context :param network: dictionary describing the network

Returns:a sequence of mappings with the following signature:
{

“id”: UUID representing the network. “name”: Human-readable name identifying the network. “tenant_id”: Owner of network. NOTE: only admin user can specify

a tenant_id other than its own.
“admin_state_up”: Sets admin state of network.
if down, network does not forward packets.
“status”: Indicates whether network is currently operational
(values are “ACTIVE”, “DOWN”, “BUILD”, and “ERROR”)

“subnets”: Subnets associated with this network.

}

Raises :RemoteRestError
create_port(context, port)

Create a port, which is a connection point of a device (e.g., a VM NIC) to attach to a L2 Quantum network. :param context: quantum api request context :param port: dictionary describing the port

Returns:
{

“id”: uuid represeting the port. “network_id”: uuid of network. “tenant_id”: tenant_id “mac_address”: mac address to use on this port. “admin_state_up”: Sets admin state of port. if down, port

does not forward packets.
“status”: dicates whether port is currently operational
(limit values to “ACTIVE”, “DOWN”, “BUILD”, and “ERROR”)
“fixed_ips”: list of subnet ID”s and IP addresses to be used on
this port
“device_id”: identifies the device (e.g., virtual server) using
this port.

}

Raises :exceptions.NetworkNotFound
Raises :exceptions.StateInvalid
Raises :RemoteRestError
create_router(context, router)
create_subnet(context, subnet)
delete_floatingip(context, id)
delete_network(context, net_id)

Delete a network. :param context: quantum api request context :param id: UUID representing the network to delete.

Returns:None
Raises :exceptions.NetworkInUse
Raises :exceptions.NetworkNotFound
Raises :RemoteRestError
delete_port(context, port_id, l3_port_check=True)

Delete a port. :param context: quantum api request context :param id: UUID representing the port to delete.

Raises :exceptions.PortInUse
Raises :exceptions.PortNotFound
Raises :exceptions.NetworkNotFound
Raises :RemoteRestError
delete_router(context, router_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_port(context, id, fields=None)
get_ports(context, filters=None, fields=None)
remove_router_interface(context, router_id, interface_info)
supported_extension_aliases = ['router', 'binding']
update_floatingip(context, id, floatingip)
update_network(context, net_id, network)

Updates the properties of a particular Virtual Network. :param context: quantum api request context :param net_id: uuid of the network to update :param network: dictionary describing the updates

Returns:a sequence of mappings with the following signature:
{

“id”: UUID representing the network. “name”: Human-readable name identifying the network. “tenant_id”: Owner of network. NOTE: only admin user can

specify a tenant_id other than its own.
“admin_state_up”: Sets admin state of network.
if down, network does not forward packets.
“status”: Indicates whether network is currently operational
(values are “ACTIVE”, “DOWN”, “BUILD”, and “ERROR”)

“subnets”: Subnets associated with this network.

}

Raises :exceptions.NetworkNotFound
Raises :RemoteRestError
update_port(context, port_id, port)

Update values of a port. :param context: quantum api request context :param id: UUID representing the port to update. :param port: dictionary with keys indicating fields to update.

Returns:a mapping sequence with the following signature:
{

“id”: uuid represeting the port. “network_id”: uuid of network. “tenant_id”: tenant_id “mac_address”: mac address to use on this port. “admin_state_up”: sets admin state of port. if down, port

does not forward packets.
“status”: dicates whether port is currently operational
(limit values to “ACTIVE”, “DOWN”, “BUILD”, and “ERROR”)
“fixed_ips”: list of subnet ID’s and IP addresses to be used on
this port
“device_id”: identifies the device (e.g., virtual server) using
this port.

}

Raises :exceptions.StateInvalid
Raises :exceptions.PortNotFound
Raises :RemoteRestError
update_router(context, router_id, router)
update_subnet(context, id, subnet)
exception quantum.plugins.bigswitch.plugin.RemoteRestError(message)

Bases: quantum.common.exceptions.QuantumException

class quantum.plugins.bigswitch.plugin.RpcProxy

Bases: quantum.db.dhcp_rpc_base.DhcpRpcCallbackMixin

RPC_API_VERSION = '1.0'
create_rpc_dispatcher()
class quantum.plugins.bigswitch.plugin.ServerPool(servers, ssl, auth, quantum_id, timeout=10, base_uri='/quantum/v1.0', name='QuantumRestProxy')

Bases: object

action_success(resp)

Defining success codes as required. Note: We assume any valid 2xx as being successful response.

delete(resource, data='', headers=None, ignore_codes=[])
get(resource, data='', headers=None, ignore_codes=[])
post(resource, data, headers=None, ignore_codes=[])
put(resource, data, headers=None, ignore_codes=[])
rest_call(*args, **kwargs)
server_failure(resp, ignore_codes=[])

Define failure codes as required. Note: We assume 301-303 is a failure, and try the next server in the server pool.

server_proxy_for(server, port)
class quantum.plugins.bigswitch.plugin.ServerProxy(server, port, ssl, auth, quantum_id, timeout, base_uri, name)

Bases: object

REST server proxy to a network controller.

rest_call(action, resource, data, headers)