Jump to: navigation, search

Neutron/LBaaS/DriverAPI

< Neutron‎ | LBaaS

Scope

LBaaS driver is a module that translates abstract model into vendor-specific and configures load balancing devices. This document describes API for drivers.

API

create_vip (device, vip)
update_vip (device, new_vip, old_vip)
delete_vip (device, vip)

create_pool (device, pool)
update_pool (device, new_pool, old_pool)
delete_pool (device, pool)

create_member (device, member)
update_member (device, new_member, old_member)
delete_member (device, member)

create_health_monitor (device, health_monitor, pool_id)
delete_health_monitor (device, health_monitor, pool_id)

get_pool_stats (device, pool_id)


All update methods receive both new and old objects. It's up to driver implementors how to apply changes to the actual configuration. For some devices (like HAProxy) it would be easier to replace the old part of config with newer one. For other devices (like Cisco ACE LB) it would be easier to calculate diff between new and old object and apply diff only.

Health monitoring operations are used to associate and disassociate health monitors to pool specified by pool_id. As of Grizzly health monitor cannot be updated by driver. Member and Vip objects has 'pool_id' attribute, it is used for finding which pool these objects relate to. Statistics is returned as dictionary, driver may set 'update_time' attribute to tell when the data was actual.

get_service_type(self)

Return the service type handled by the driver, i.e. "LOADBALANCER".

get_type(self)

Return the type of the driver, that value used for identification.

get_version(self)

Return the version of the driver, i.e. "1.0".

create_vip(self, device, vip)

Create loadbalancer Vip.

  •  :param device: dict that holds info about load balancing device
  •  :param vip: dict that holds Vip

update_vip(self, device, new_vip, old_vip)

Update loadbalancer Vip.

  •  :param device: dict that holds info about load balancing device
  •  :param new_vip: dict that holds updated Vip
  •  :param old_vip: dict that holds previous version of Vip

delete_vip(self, device, vip)

Delete loadbalancer Vip.

  •  :param device: dict that holds info about load balancing device
  •  :param vip: dict that holds Vip to be deleted

create_pool(self, device, pool)

Create loadbalancer Pool.

In case of virtual load balancing device this method may also do provision. If needed it may update device details, i.e. management settings.

  •  :param device: dict that holds info about load balancing device
  •  :param pool: dict that holds Pool

update_pool(self, device, new_pool, old_pool)

Update loadbalancer Pool.

  •  :param device: dict that holds info about load balancing device
  •  :param new_pool: dict that holds updated Pool
  •  :param old_pool: dict that holds previous version of Pool

delete_pool(self, device, pool)

Delete loadbalancer Pool.

In case of virtual load balancing device this method may shutdown VM.

  •  :param device: dict that holds info about load balancing device
  •  :param pool: dict that holds Pool to be deleted

create_member(self, device, member)

Create loadbalancer Member.

  •  :param device: dict that holds info about load balancing device
  •  :param member: dict that holds Member

update_member(self, device, new_member, old_member)

Update loadbalancer Member.

  •  :param device: dict that holds info about load balancing device
  •  :param new_member: dict that holds updated Member
  •  :param old_member: dict that holds previous version of Member

delete_member(self, device, member)

Delete loadbalancer Member.

  •  :param device: dict that holds info about load balancing device
  •  :param member: dict that holds Member to be deleted

create_health_monitor(self, device, health_monitor, pool_id)

Create Health Monitor in the specified Pool.

  •  :param device: dict that holds info about load balancing device
  •  :param health_monitor: dict that holds Health Monitor
  •  :param pool_id: the id of the Pool

delete_health_monitor(self, device, health_monitor, pool_id)

Delete Health Monitor in the specified Pool.

  •  :param device: dict that holds info about load balancing device
  •  :param health_monitor: dict that holds Health Monitor
  •  :param pool_id: the id of the Pool

get_pool_stats(self, device, pool_id)

Get statistics for the specified Pool.

  •  :param device: dict that holds info about load balancing device
  •  :param pool_id: the id of the Pool
  •  :return: dict that holds statistics data

Error Handling

Driver reports errors by raising an exception. The following types of exceptions are supported by framework:

UnsupportedFeature

The exception is raised when some feature is not supported by driver.

Example: driver is asked to configure session persistence, but it doesn't support it.

Parameters:

  • name - the name of feature

UnsupportedOption

The exception is raised when an unsupported option is requested.

Example: driver is asked to configure 'lb_method' of type 'some_exotic' and it doesn't support it.

Parameters:

  • feature - the name of feature
  • option - the name of option

AttributeRequired

The exception is raised when object misses some mandatory attribute.

Example: driver is asked to configure cookie-based session persistence, but name of cookie is missing.

Parameters:

  • name - the name of attribute

ConfigError

The exception is raised when any error occured during device configuration.

Parameters:

  • msg - the description of the error