octavia.api.drivers package

octavia.api.drivers package

Submodules

octavia.api.drivers.data_models module

class BaseDataModel[source]

Bases: object

classmethod from_dict(dict)[source]
to_dict(calling_classes=None, recurse=False, render_unsets=False, **kwargs)[source]

Converts a data model to a dictionary.

class HealthMonitor(admin_state_up=Unset, delay=Unset, expected_codes=Unset, healthmonitor_id=Unset, http_method=Unset, max_retries=Unset, max_retries_down=Unset, name=Unset, pool_id=Unset, timeout=Unset, type=Unset, url_path=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class L7Policy(action=Unset, admin_state_up=Unset, description=Unset, l7policy_id=Unset, listener_id=Unset, name=Unset, position=Unset, redirect_pool_id=Unset, redirect_url=Unset, rules=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class L7Rule(admin_state_up=Unset, compare_type=Unset, invert=Unset, key=Unset, l7policy_id=Unset, l7rule_id=Unset, type=Unset, value=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class Listener(admin_state_up=Unset, connection_limit=Unset, default_pool=Unset, default_pool_id=Unset, default_tls_container_ref=Unset, default_tls_container_data=Unset, description=Unset, insert_headers=Unset, l7policies=Unset, listener_id=Unset, loadbalancer_id=Unset, name=Unset, protocol=Unset, protocol_port=Unset, sni_container_refs=Unset, sni_container_data=Unset, timeout_client_data=Unset, timeout_member_connect=Unset, timeout_member_data=Unset, timeout_tcp_inspect=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class LoadBalancer(admin_state_up=Unset, description=Unset, flavor=Unset, listeners=Unset, loadbalancer_id=Unset, name=Unset, pools=Unset, project_id=Unset, vip_address=Unset, vip_network_id=Unset, vip_port_id=Unset, vip_subnet_id=Unset, vip_qos_policy_id=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class Member(address=Unset, admin_state_up=Unset, member_id=Unset, monitor_address=Unset, monitor_port=Unset, name=Unset, pool_id=Unset, protocol_port=Unset, subnet_id=Unset, weight=Unset, backup=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class Pool(admin_state_up=Unset, description=Unset, healthmonitor=Unset, lb_algorithm=Unset, loadbalancer_id=Unset, members=Unset, name=Unset, pool_id=Unset, listener_id=Unset, protocol=Unset, session_persistence=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

class UnsetType[source]

Bases: object

class VIP(vip_address=Unset, vip_network_id=Unset, vip_port_id=Unset, vip_subnet_id=Unset, vip_qos_policy_id=Unset)[source]

Bases: octavia.api.drivers.data_models.BaseDataModel

octavia.api.drivers.driver_factory module

get_driver(provider)[source]

octavia.api.drivers.driver_lib module

class DriverLibrary(**kwargs)[source]

Bases: object

update_listener_statistics(statistics)[source]

Update listener statistics.

Parameters:statistics (dict) – Statistics for listeners: id (string): ID for listener. active_connections (int): Number of currently active connections. bytes_in (int): Total bytes received. bytes_out (int): Total bytes sent. request_errors (int): Total requests not fulfilled. total_connections (int): The total connections handled.
Raises:UpdateStatisticsError
Returns:None
update_loadbalancer_status(status)[source]

Update load balancer status.

Parameters:status (dict) – dictionary defining the provisioning status and operating status for load balancer objects, including pools, members, listeners, L7 policies, and L7 rules. iod (string): ID for the object. provisioning_status (string): Provisioning status for the object. operating_status (string): Operating status for the object.
Raises:UpdateStatusError
Returns:None

octavia.api.drivers.exceptions module

exception DriverError(*args, **kwargs)[source]

Bases: Exception

Catch all exception that drivers can raise.

This exception includes two strings: The user fault string and the optional operator fault string. The user fault string, “user_fault_string”, will be provided to the API requester. The operator fault string, “operator_fault_string”, will be logged in the Octavia API log file for the operator to use when debugging.

Parameters:
  • user_fault_string (string) – String provided to the API requester.
  • operator_fault_string (string) – Optional string logged by the Octavia API for the operator to use when debugging.
operator_fault_string = 'An unknown driver error occurred.'
user_fault_string = 'An unknown driver error occurred.'
exception NotImplementedError(*args, **kwargs)[source]

Bases: Exception

Exception raised when a driver does not implement an API function.

Parameters:
  • user_fault_string (string) – String provided to the API requester.
  • operator_fault_string (string) – Optional string logged by the Octavia API for the operator to use when debugging.
operator_fault_string = 'This feature is not implemented by this provider.'
user_fault_string = 'This feature is not implemented by the provider.'
exception UnsupportedOptionError(*args, **kwargs)[source]

Bases: Exception

Exception raised when a driver does not support an option.

Provider drivers will validate that they can complete the request – that all options are supported by the driver. If the request fails validation, drivers will raise an UnsupportedOptionError exception. For example, if a driver does not support a flavor passed as an option to load balancer create(), the driver will raise an UnsupportedOptionError and include a message parameter providing an explanation of the failure.

Parameters:
  • user_fault_string (string) – String provided to the API requester.
  • operator_fault_string (string) – Optional string logged by the Octavia API for the operator to use when debugging.
operator_fault_string = 'A specified option is not supported by this provider.'
user_fault_string = 'A specified option is not supported by this provider.'
exception UpdateStatisticsError(*args, **kwargs)[source]

Bases: Exception

Exception raised when a statistics update fails.

Each exception will include a message field that describes the error and references to the failed record if available. :param fault_string: String describing the fault. :type fault_string: string :param status_object: The object the fault occurred on. :type status_object: string :param status_object_id: The ID of the object that failed stats update. :type status_object_id: string :param status_record: The stats update record that caused the fault. :type status_record: string

fault_string = 'The statistics update had an unknown error.'
stats_object = None
stats_object_id = None
stats_record = None
exception UpdateStatusError(*args, **kwargs)[source]

Bases: Exception

Exception raised when a status update fails.

Each exception will include a message field that describes the error and references to the failed record if available. :param fault_string: String describing the fault. :type fault_string: string :param status_object: The object the fault occurred on. :type status_object: string :param status_object_id: The ID of the object that failed status update. :type status_object_id: string :param status_record: The status update record that caused the fault. :type status_record: string

fault_string = 'The status update had an unknown error.'
status_object = None
status_object_id = None
status_record = None

octavia.api.drivers.provider_base module

class ProviderDriver[source]

Bases: object

create_vip_port(loadbalancer_id, project_id, vip_dictionary)[source]

Creates a port for a load balancer VIP.

If the driver supports creating VIP ports, the driver will create a VIP port and return the vip_dictionary populated with the vip_port_id. If the driver does not support port creation, the driver will raise a NotImplementedError.

Parameters:
  • loadbalancer_id (string) – ID of loadbalancer.
  • project_id (string) – The project ID to create the VIP under.
Param:

vip_dictionary: The VIP dictionary.

Returns:

VIP dictionary with vip_port_id.

Raises:
get_supported_flavor_metadata()[source]

Returns a dict of flavor metadata keys supported by this driver.

The returned dictionary will include key/value pairs, ‘name’ and ‘description.’

Returns:

The flavor metadata dictionary

Raises:
health_monitor_create(healthmonitor)[source]

Creates a new health monitor.

Parameters:

healthmonitor (object) – The health monitor object.

Returns:

Nothing if the create request was accepted.

Raises:
health_monitor_delete(healthmonitor)[source]

Deletes a healthmonitor_id.

Parameters:

healthmonitor (object) – The monitor to delete.

Returns:

Nothing if the create request was accepted.

Raises:
health_monitor_update(old_healthmonitor, new_healthmonitor)[source]

Updates a health monitor.

Parameters:
  • old_healthmonitor (object) – The baseline health monitor object.
  • new_healthmonitor (object) – The updated health monitor object.
Returns:

Nothing if the create request was accepted.

Raises:
l7policy_create(l7policy)[source]

Creates a new L7 policy.

Parameters:

l7policy (object) – The L7 policy object.

Returns:

Nothing if the create request was accepted.

Raises:
l7policy_delete(l7policy)[source]

Deletes an L7 policy.

Parameters:

l7policy (object) – The L7 policy to delete.

Returns:

Nothing if the delete request was accepted.

Raises:
l7policy_update(old_l7policy, new_l7policy)[source]

Updates an L7 policy.

Parameters:
  • old_l7policy (object) – The baseline L7 policy object.
  • new_l7policy (object) – The updated L7 policy object.
Returns:

Nothing if the update request was accepted.

Raises:
l7rule_create(l7rule)[source]

Creates a new L7 rule.

Parameters:

l7rule (object) – The L7 rule object.

Returns:

Nothing if the create request was accepted.

Raises:
l7rule_delete(l7rule)[source]

Deletes an L7 rule.

Parameters:

l7rule (object) – The L7 rule to delete.

Returns:

Nothing if the delete request was accepted.

Raises:
l7rule_update(old_l7rule, new_l7rule)[source]

Updates an L7 rule.

Parameters:
  • old_l7rule (object) – The baseline L7 rule object.
  • new_l7rule (object) – The updated L7 rule object.
Returns:

Nothing if the update request was accepted.

Raises:
listener_create(listener)[source]

Creates a new listener.

Parameters:

listener (object) – The listener object.

Returns:

Nothing if the create request was accepted.

Raises:
listener_delete(listener)[source]

Deletes a listener.

Parameters:

listener (object) – The listener to delete.

Returns:

Nothing if the delete request was accepted.

Raises:
listener_update(old_listener, new_listener)[source]

Updates a listener.

Parameters:
  • old_listener (object) – The baseline listener object.
  • new_listener (object) – The updated listener object.
Returns:

Nothing if the update request was accepted.

Raises:
loadbalancer_create(loadbalancer)[source]

Creates a new load balancer.

Parameters:

loadbalancer (object) – The load balancer object.

Returns:

Nothing if the create request was accepted.

Raises:
loadbalancer_delete(loadbalancer, cascade=False)[source]

Deletes a load balancer.

Parameters:
  • loadbalancer (object) – The load balancer to delete.
  • cascade (bool) – If True, deletes all child objects (listeners, pools, etc.) in addition to the load balancer.
Returns:

Nothing if the delete request was accepted.

Raises:
loadbalancer_failover(loadbalancer_id)[source]

Performs a fail over of a load balancer.

Parameters:loadbalancer_id (string) – ID of the load balancer to failover.
Returns:Nothing if the failover request was accepted.
Raises:DriverError – An unexpected error occurred in the driver.
Raises:NotImplementedError if driver does not support request.
loadbalancer_update(old_loadbalancer, new_loadbalncer)[source]

Updates a load balancer.

Parameters:
  • old_loadbalancer (object) – The baseline load balancer object.
  • new_loadbalancer (object) – The updated load balancer object.
Returns:

Nothing if the update request was accepted.

Raises:
member_batch_update(members)[source]

Creates, updates, or deletes a set of pool members.

Parameters:

members (list) – List of member objects.

Returns:

Nothing if the create request was accepted.

Raises:
member_create(member)[source]

Creates a new member for a pool.

Parameters:

member (object) – The member object.

Returns:

Nothing if the create request was accepted.

Raises:
member_delete(member)[source]

Deletes a pool member.

Parameters:

member (object) – The member to delete.

Returns:

Nothing if the create request was accepted.

Raises:
member_update(old_member, new_member)[source]

Updates a pool member.

Parameters:
  • old_member (object) – The baseline member object.
  • new_member (object) – The updated member object.
Returns:

Nothing if the create request was accepted.

Raises:
name = None
pool_create(pool)[source]

Creates a new pool.

Parameters:

pool (object) – The pool object.

Returns:

Nothing if the create request was accepted.

Raises:
pool_delete(pool)[source]

Deletes a pool and its members.

Parameters:

pool (object) – The pool to delete.

Returns:

Nothing if the create request was accepted.

Raises:
pool_update(old_pool, new_pool)[source]

Updates a pool.

Parameters:
  • pool (object) – The baseline pool object.
  • pool – The updated pool object.
Returns:

Nothing if the create request was accepted.

Raises:
validate_flavor(flavor_metadata)[source]

Validates if driver can support the flavor.

Parameters:

flavor_metadata (dict) – Dictionary with flavor metadata.

Returns:

Nothing if the flavor is valid and supported.

Raises:

octavia.api.drivers.utils module

call_provider(provider, driver_method, *args, **kwargs)[source]

Wrap calls to the provider driver to handle driver errors.

This allows Octavia to return user friendly errors when a provider driver has an issue.

Parameters:

driver_method – Method in the driver to call.

Raises:
db_HM_to_provider_HM(db_hm)[source]
db_l7policies_to_provider_l7policies(db_l7policies)[source]
db_l7policy_to_provider_l7policy(db_l7policy)[source]
db_l7rule_to_provider_l7rule(db_l7rule)[source]
db_l7rules_to_provider_l7rules(db_l7rules)[source]
db_listener_to_provider_listener(db_listener)[source]
db_listeners_to_provider_listeners(db_listeners)[source]
db_loadbalancer_to_provider_loadbalancer(db_loadbalancer)[source]
db_member_to_provider_member(db_member)[source]
db_members_to_provider_members(db_members)[source]
db_pool_to_provider_pool(db_pool)[source]
db_pools_to_provider_pools(db_pools)[source]
hm_dict_to_provider_dict(hm_dict)[source]
l7policy_dict_to_provider_dict(l7policy_dict)[source]
l7rule_dict_to_provider_dict(l7rule_dict)[source]
lb_dict_to_provider_dict(lb_dict, vip=None, db_pools=None, db_listeners=None)[source]
listener_dict_to_provider_dict(listener_dict)[source]
member_dict_to_provider_dict(member_dict)[source]
pool_dict_to_provider_dict(pool_dict)[source]
provider_vip_dict_to_vip_obj(vip_dictionary)[source]
vip_dict_to_provider_dict(vip_dict)[source]

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.