# octavia.amphorae.backends.agent.api_server package

## Submodules

## octavia.amphorae.backends.agent.api_server.amphora_info module

class AmphoraInfo(osutils)

  Bases: `object`

  compile_amphora_details(extend_lvs_driver=None)
  compile_amphora_info(extend_lvs_driver=None)
  get_interface(ip_addr)

## octavia.amphorae.backends.agent.api_server.certificate_update module

upload_server_cert()

## octavia.amphorae.backends.agent.api_server.haproxy_compatibility module

get_haproxy_versions()

  Get major and minor version number from haproxy

  Returns major_version:

    The major version digit

  Returns minor_version:

    The minor version digit

process_cfg_for_version_compat(haproxy_cfg)

## octavia.amphorae.backends.agent.api_server.keepalived module

class Keepalived

  Bases: `object`

  manager_keepalived_service(action)
  upload_keepalived_config()

## octavia.amphorae.backends.agent.api_server.keepalivedlvs module

class KeepalivedLvs

  Bases: `LvsListenerApiServerBase`

  delete_lvs_listener(listener_id)

    Delete a LVS Listener from a amphora

    Parameters:

      listener_id – The id of the listener

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If unsupported initial system of amphora.

  get_all_lvs_listeners_status()

    Gets the status of all UDP listeners

    Gets the status of all UDP listeners on the amphora.

  get_lvs_listener_config(listener_id)

    Gets the keepalivedlvs config

    Parameters:

      listener_id – the id of the listener

  manage_lvs_listener(listener_id, action)

    Gets the LVS Listener configuration details

    Parameters:

      - listener_id – the id of the LVS Listener

      - action – the operation type.

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If the listener is failed to find.

  upload_lvs_listener_config(listener_id)

    Upload the configuration for LVS.

    Parameters:

      listener_id – The id of a LVS Listener

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If any file / directory is not found or fail to create.

## octavia.amphorae.backends.agent.api_server.loadbalancer module

class Loadbalancer

  Bases: `object`

  delete_certificate(lb_id, filename)
  delete_lb(lb_id)
  get_all_listeners_status(other_listeners=None)

    Gets the status of all listeners

    This method will not consult the stats socket so a listener might show as ACTIVE but still be in ERROR

    Currently type==SSL is also not detected

  get_certificate_md5(lb_id, filename)
  get_haproxy_config(lb_id)

    Gets the haproxy config

    Parameters:

      listener_id – the id of the listener

  start_stop_lb(lb_id, action)
  upload_certificate(lb_id, filename)
  upload_haproxy_config(amphora_id, lb_id)

    Upload the haproxy config

    Parameters:

      - amphora_id – The id of the amphora to update

      - lb_id – The id of the loadbalancer

class Wrapped(stream_)

  Bases: `object`

  get_md5()
  read(line)

## octavia.amphorae.backends.agent.api_server.lvs_listener_base module

class LvsListenerApiServerBase

  Bases: `object`

  Base LVS Listener Server API

  abstract delete_lvs_listener(listener_id)

    Delete a LVS Listener from a amphora

    Parameters:

      listener_id – The id of the listener

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If unsupported initial system of amphora.

  abstract get_all_lvs_listeners_status()

    Gets the status of all LVS Listeners

    This method will not consult the stats socket so a listener might show as ACTIVE but still be in ERROR

    Returns:

      a list of LVS Listener status

    Raises:

      Exception – If the listener pid located directory is not exist

  abstract get_lvs_listener_config(listener_id)

    Gets the LVS Listener configuration details

    Parameters:

      listener_id – the id of the LVS Listener

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If the listener is failed to find.

  get_subscribed_amp_compile_info()
  abstract manage_lvs_listener(listener_id, action)

    Gets the LVS Listener configuration details

    Parameters:

      - listener_id – the id of the LVS Listener

      - action – the operation type.

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If the listener is failed to find.

  abstract upload_lvs_listener_config(listener_id)

    Upload the configuration for LVS.

    Parameters:

      listener_id – The id of a LVS Listener

    Returns:

      HTTP response with status code.

    Raises:

      Exception – If any file / directory is not found or fail to create.

## octavia.amphorae.backends.agent.api_server.osutils module

class BaseOS(os_name)

  Bases: `object`

  classmethod bring_interface_up(interface, name)
  classmethod get_os_util()
  write_interface_file(interface, ip_address, prefixlen)
  write_port_interface_file(interface, fixed_ips, mtu, is_sriov=False)
  write_vip_interface_file(interface, vips, mtu, vrrp_info, fixed_ips=None, is_sriov=False)

class CentOS(os_name)

  Bases: `RH`

  classmethod is_os_name(os_name)

class RH(os_name)

  Bases: `BaseOS`

  cmd_get_version_of_installed_package(package_name)
  classmethod is_os_name(os_name)

class Ubuntu(os_name)

  Bases: `BaseOS`

  cmd_get_version_of_installed_package(package_name)
  classmethod is_os_name(os_name)

## octavia.amphorae.backends.agent.api_server.plug module

class Plug(osutils)

  Bases: `object`

  build_vrrp_info(vrrp_ip, subnet_cidr, gateway, host_routes)
  plug_lo()
  plug_network(mac_address, fixed_ips, mtu=None, vip_net_info=None, is_sriov=False)
  plug_vip(vip, subnet_cidr, gateway, mac_address, mtu=None, vrrp_ip=None, host_routes=(), additional_vips=(), is_sriov=False)
  render_vips(vips)

## octavia.amphorae.backends.agent.api_server.rules_schema module

## octavia.amphorae.backends.agent.api_server.server module

class Server

  Bases: `object`

  delete_certificate(lb_id, filename)
  delete_lb_object(object_id)
  get_all_listeners_status()
  get_certificate_md5(lb_id, filename)
  get_details()
  get_haproxy_config(lb_id)
  get_info()
  get_interface(ip_addr)
  get_lvs_listener_config(listener_id)
  manage_service_vrrp(action)
  plug_network()
  plug_vip(vip)
  set_interface_rules(ip_addr)
  start_stop_lb_object(object_id, action)
  upload_cert()
  upload_certificate(lb_id, filename)
  upload_config()
  upload_haproxy_config(amphora_id, lb_id)
  upload_lvs_listener_config(amphora_id, listener_id)
  upload_vrrp_config()
  version_discovery()

make_json_error(ex)

register_app_error_handler(app)

## octavia.amphorae.backends.agent.api_server.util module

exception ParsingError

  Bases: `Exception`

config_path(lb_id)

get_backend_for_lb_object(object_id)

  Returns the backend for a listener.

  If the listener is a TCP based listener return ‘HAPROXY’. If the listener is a UDP or SCTP based listener return ‘LVS’ If the listener is not identifiable, return None.

  Parameters:

    listener_id – The ID of the listener to identify.

  Returns:

    HAPROXY_BACKEND, LVS_BACKEND or None

get_haproxy_pid(lb_id)

get_haproxy_vip_addresses(lb_id)

  Get the VIP addresses for a load balancer.

  Parameters:

    lb_id – The load balancer ID to get VIP addresses from.

  Returns:

    List of VIP addresses (IPv4 and IPv6)

get_keepalivedlvs_pid(listener_id)

get_listeners()

  Get Listeners

  Returns:

    An array with the ids of all listeners, e.g. [‘123’, ‘456’, …] or [] if no listeners exist

get_loadbalancers()

  Get Load balancers

  Returns:

    An array with the uuids of all load balancers, e.g. [‘123’, ‘456’, …] or [] if no loadbalancers exist

get_lvs_listeners()

get_lvs_vip_addresses(listener_id: str) → list[str]

  Get the VIP addresses for a LVS load balancer.

  Parameters:

    listener_id – The listener ID to get VIP addresses from.

  Returns:

    List of VIP addresses (IPv4 and IPv6)

haproxy_check_script_path()

haproxy_dir(lb_id)

haproxy_sock_path(lb_id)

init_path(lb_id)

install_netns_systemd_service()

is_lb_running(lb_id)

is_lvs_listener_running(listener_id)

keepalived_backend_check_script_dir()

keepalived_backend_check_script_path()

keepalived_cfg_path()

keepalived_check_script_path()

keepalived_check_scripts_dir()

keepalived_dir()

keepalived_init_path()

keepalived_log_path()

keepalived_lvs_cfg_path(listener_id)

keepalived_lvs_dir()

keepalived_lvs_init_path(listener_id)

keepalived_lvs_pids_path(listener_id)

keepalived_pid_path()

parse_haproxy_file(lb_id)

pid_path(lb_id)

run_systemctl_command(command, service, raise_error=True)

send_member_advertisements(fixed_ips: Iterable[Dict[str, str]])

  Sends advertisements for each fixed_ip of a list

  This method will send either GARP (IPv4) or neighbor advertisements (IPv6) for the addresses of the subnets of the members.

  Parameters:

    fixed_ips – a list of dicts that contain ‘ip_address’ elements

  Returns:

    None

send_vip_advertisements(lb_id: str | None = None, listener_id: str | None = None)

  Sends address advertisements for each load balancer VIP.

  This method will send either GARP (IPv4) or neighbor advertisements (IPv6) for the VIP addresses on a load balancer.

  Parameters:

    lb_id – The load balancer ID to send advertisements for.

  Returns:

    None

state_file_path(lb_id)

vrrp_check_script_update(lb_id, action)

## Module contents

this page last updated: 2025-04-03 17:35:57

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

found an error? report a bug