# 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_udp_driver=None)
  `compile_amphora_info`(extend_udp_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: `octavia.amphorae.backends.agent.api_server.udp_listener_base.UdpListenerApiServerBase`

  `delete_udp_listener`(listener_id)

    Delete a UDP Listener from a amphora

    Parameters: | listener_id – The id of the listener
    Returns: | HTTP response with status code.
    Raises: | Exception – If unsupport initial system of amphora.

  `get_all_udp_listeners_status`()

    Gets the status of all UDP listeners

    Gets the status of all UDP listeners on the amphora.

  `get_udp_listener_config`(listener_id)

    Gets the keepalivedlvs config

    Parameters: | listener_id – the id of the listener

  `manage_udp_listener`(listener_id, action)

    Gets the UDP Listener configuration details

    Parameters:

    - listener_id – the id of the UDP Listener
    - action – the operation type.

    Returns: | HTTP response with status code.
    Raises: | Exception – If the listener is failed to find.

  `upload_udp_listener_config`(listener_id)

    Upload the configuration for UDP.

    Parameters: | listener_id – The id of a UDP 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

  `vrrp_check_script_update`(lb_id, action)

class `Wrapped`(stream_)

  Bases: `object`

  `get_md5`()
  `read`(l)

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

class `BaseOS`(os_name)

  Bases: `object`

  classmethod `bring_interfaces_up`(ip, primary_interface, secondary_interface)
  `create_netns_dir`(network_dir, netns_network_dir, ignore=None)
  classmethod `get_host_routes`(fixed_ip)
  `get_network_interface_file`(interface)
  classmethod `get_os_util`()
  `has_ifup_all`()
  `write_port_interface_file`(netns_interface, fixed_ips, mtu, interface_file_path, template_port)
  `write_vip_interface_file`(interface_file_path, primary_interface, vip, ip, broadcast, netmask, gateway, mtu, vrrp_ip, vrrp_version, render_host_routes, template_vip)

class `CentOS`(os_name)

  Bases: `octavia.amphorae.backends.agent.api_server.osutils.RH`

  classmethod `is_os_name`(os_name)

class `RH`(os_name)

  Bases: `octavia.amphorae.backends.agent.api_server.osutils.BaseOS`

  `ETH_IFDOWN_LOCAL_SCRIPT` = 'rh_plug_port_eth_ifdown_local.conf.j2'
  `ETH_IFUP_LOCAL_SCRIPT` = 'rh_plug_port_eth_ifup_local.conf.j2'
  `ETH_X_ALIAS_VIP_CONF` = 'rh_plug_vip_ethX_alias.conf.j2'
  `ETH_X_PORT_CONF` = 'rh_plug_port_ethX.conf.j2'
  `ETH_X_VIP_CONF` = 'rh_plug_vip_ethX.conf.j2'
  `ROUTE_ETH_X_CONF` = 'rh_route_ethX.conf.j2'
  `RULE_ETH_X_CONF` = 'rh_rule_ethX.conf.j2'
  classmethod `bring_interfaces_up`(ip, primary_interface, secondary_interface)
  `cmd_get_version_of_installed_package`(package_name)
  `create_netns_dir`(network_dir=None, netns_network_dir=None, ignore=None)
  `get_alias_network_interface_file`(interface)
  `get_netns_network_dir`()
  `get_network_interface_file`(interface)
  `get_network_path`()
  `get_route_rules_interface_file`(interface, version)
  `get_static_routes_interface_file`(interface, version)
  `has_ifup_all`()
  classmethod `is_os_name`(os_name)
  `write_interfaces_file`()
  `write_port_interface_file`(netns_interface, fixed_ips, mtu, interface_file_path=None, template_port=None)
  `write_port_interface_if_local_scripts`(template_script, ifup=True)
  `write_static_routes_interface_file`(interface_file_path, interface, host_routes, template_routes, gateway, vip, netmask)
  `write_vip_interface_file`(interface_file_path, primary_interface, vip, ip, broadcast, netmask, gateway, mtu, vrrp_ip, vrrp_version, render_host_routes, template_vip=None)

class `Ubuntu`(os_name)

  Bases: `octavia.amphorae.backends.agent.api_server.osutils.BaseOS`

  `ETH_X_PORT_CONF` = 'plug_port_ethX.conf.j2'
  `ETH_X_VIP_CONF` = 'plug_vip_ethX.conf.j2'
  `cmd_get_version_of_installed_package`(package_name)
  `create_netns_dir`(network_dir=None, netns_network_dir=None, ignore=None)
  `get_netns_network_dir`()
  `get_network_interface_file`(interface)
  `get_network_path`()
  `has_ifup_all`()
  classmethod `is_os_name`(os_name)
  `write_interfaces_file`()
  `write_port_interface_file`(netns_interface, fixed_ips, mtu, interface_file_path=None, template_port=None)
  `write_vip_interface_file`(interface_file_path, primary_interface, vip, ip, broadcast, netmask, gateway, mtu, vrrp_ip, vrrp_version, render_host_routes, template_vip=None)

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

class `Plug`(osutils)

  Bases: `object`

  `plug_network`(mac_address, fixed_ips, mtu=None)
  `plug_vip`(vip, subnet_cidr, gateway, mac_address, mtu=None, vrrp_ip=None, host_routes=None)

## 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_udp_listener_config`(listener_id)
  `manage_service_vrrp`(action)
  `plug_network`()
  `plug_vip`(vip)
  `start_stop_lb_object`(object_id, action)
  `upload_cert`()
  `upload_certificate`(lb_id, filename)
  `upload_config`()
  `upload_haproxy_config`(amphora_id, lb_id)
  `upload_udp_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.udp_listener_base module

class `UdpListenerApiServerBase`

  Bases: `object`

  Base UDP Listener Server API

  `SERVER_INSTANCE` = None
  `delete_udp_listener`(listener_id)

    Delete a UDP Listener from a amphora

    Parameters: | listener_id – The id of the listener
    Returns: | HTTP response with status code.
    Raises: | Exception – If unsupport initial system of amphora.

  `get_all_udp_listeners_status`()

    Gets the status of all UDP 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 UDP Listener status
    Raises: | Exception – If the listener pid located directory is not exist

  classmethod `get_server_driver`()
  `get_subscribed_amp_compile_info`()
  `get_udp_listener_config`(listener_id)

    Gets the UDP Listener configuration details

    Parameters: | listener_id – the id of the UDP Listener
    Returns: | HTTP response with status code.
    Raises: | Exception – If the listener is failed to find.

  `manage_udp_listener`(listener_id, action)

    Gets the UDP Listener configuration details

    Parameters:

    - listener_id – the id of the UDP Listener
    - action – the operation type.

    Returns: | HTTP response with status code.
    Raises: | Exception – If the listener is failed to find.

  `upload_udp_listener_config`(listener_id)

    Upload the configuration for UDP.

    Parameters: | listener_id – The id of a UDP 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.util module

exception `ParsingError`

  Bases: `Exception`

exception `UnknownInitError`

  Bases: `Exception`

`config_path`(lb_id)

`get_haproxy_pid`(lb_id)

`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 ids of all load balancers, e.g. [‘123’, ‘456’, …] or [] if no loadbalancers exist

`get_os_init_system`()

`get_protocol_for_lb_object`(object_id)

  Returns the L4 protocol for a listener.

  If the listener is a TCP based listener (haproxy) return TCP. If the listener is a UDP based listener (lvs) return UDP. If the listener is not identifiable, return None.

  Parameters: | listener_id – The ID of the listener to identify.
  Returns: | TCP, UDP, or None

`get_udp_listeners`()

`haproxy_check_script_path`()

`haproxy_dir`(lb_id)

`haproxy_sock_path`(lb_id)

`init_path`(lb_id, init_system)

`install_netns_systemd_service`()

`is_lb_running`(lb_id)

`is_udp_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`(init_system)

`keepalived_log_path`()

`keepalived_lvs_cfg_path`(listener_id)

`keepalived_lvs_dir`()

`keepalived_lvs_init_path`(init_system, 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)

## Module contents

this page last updated: 2020-04-10 18:17:54

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 questions?