octavia.amphorae.drivers.noop_driver.driver

Source code for octavia.amphorae.drivers.noop_driver.driver

# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging

from octavia.amphorae.drivers import driver_base as driver_base

LOG = logging.getLogger(__name__)


[docs]class LoggingUpdate(object):
[docs] def update_stats(self, stats): LOG.debug("Amphora %s no-op, update stats %s", self.__class__.__name__, stats) self.stats = stats
[docs] def update_health(self, health): LOG.debug("Amphora %s no-op, update health %s", self.__class__.__name__, health) self.health = health
[docs]class NoopManager(object): def __init__(self): super(NoopManager, self).__init__() self.amphoraconfig = {}
[docs] def update(self, listener, vip): LOG.debug("Amphora %s no-op, update listener %s, vip %s", self.__class__.__name__, listener.protocol_port, vip.ip_address) self.amphoraconfig[(listener.protocol_port, vip.ip_address)] = (listener, vip, 'active')
[docs] def stop(self, listener, vip): LOG.debug("Amphora %s no-op, stop listener %s, vip %s", self.__class__.__name__, listener.protocol_port, vip.ip_address) self.amphoraconfig[(listener.protocol_port, vip.ip_address)] = (listener, vip, 'stop')
[docs] def start(self, listener, vip): LOG.debug("Amphora %s no-op, start listener %s, vip %s", self.__class__.__name__, listener.protocol_port, vip.ip_address) self.amphoraconfig[(listener.protocol_port, vip.ip_address)] = (listener, vip, 'start')
[docs] def delete(self, listener, vip): LOG.debug("Amphora %s no-op, delete listener %s, vip %s", self.__class__.__name__, listener.protocol_port, vip.ip_address) self.amphoraconfig[(listener.protocol_port, vip.ip_address)] = (listener, vip, 'delete')
[docs] def get_info(self, amphora): LOG.debug("Amphora %s no-op, info amphora %s", self.__class__.__name__, amphora.id) self.amphoraconfig[amphora.id] = (amphora.id, 'get_info')
[docs] def get_diagnostics(self, amphora): LOG.debug("Amphora %s no-op, get diagnostics amphora %s", self.__class__.__name__, amphora.id) self.amphoraconfig[amphora.id] = (amphora.id, 'get_diagnostics')
[docs] def finalize_amphora(self, amphora): LOG.debug("Amphora %s no-op, finalize amphora %s", self.__class__.__name__, amphora.id) self.amphoraconfig[amphora.id] = (amphora.id, 'finalize amphora')
[docs] def post_network_plug(self, amphora, port): LOG.debug("Amphora %s no-op, post network plug amphora %s, port %s", self.__class__.__name__, amphora.id, port.id) self.amphoraconfig[amphora.id, port.id] = (amphora.id, port.id, 'post_network_plug')
[docs] def post_vip_plug(self, amphora, load_balancer, amphorae_network_config): LOG.debug("Amphora %s no-op, post vip plug load balancer %s", self.__class__.__name__, load_balancer.id) self.amphoraconfig[(load_balancer.id, id(amphorae_network_config))] = ( load_balancer.id, amphorae_network_config, 'post_vip_plug')
[docs] def upload_cert_amp(self, amphora, pem_file): LOG.debug("Amphora %s no-op, upload cert amphora %s,with pem fle %s", self.__class__.__name__, amphora.id, pem_file) self.amphoraconfig[amphora.id, pem_file] = (amphora.id, pem_file, 'update_amp_cert_file')
[docs]class NoopAmphoraLoadBalancerDriver( driver_base.AmphoraLoadBalancerDriver, driver_base.VRRPDriverMixin): def __init__(self): super(NoopAmphoraLoadBalancerDriver, self).__init__() self.driver = NoopManager()
[docs] def update(self, listener, vip): self.driver.update(listener, vip)
[docs] def stop(self, listener, vip): self.driver.stop(listener, vip)
[docs] def start(self, listener, vip): self.driver.start(listener, vip)
[docs] def delete(self, listener, vip): self.driver.delete(listener, vip)
[docs] def get_info(self, amphora): self.driver.get_info(amphora)
[docs] def get_diagnostics(self, amphora): self.driver.get_diagnostics(amphora)
[docs] def finalize_amphora(self, amphora): self.driver.finalize_amphora(amphora)
[docs] def post_network_plug(self, amphora, port): self.driver.post_network_plug(amphora, port)
[docs] def post_vip_plug(self, amphora, load_balancer, amphorae_network_config): self.driver.post_vip_plug(amphora, load_balancer, amphorae_network_config)
[docs] def upload_cert_amp(self, amphora, pem_file): self.driver.upload_cert_amp(amphora, pem_file)
[docs] def update_vrrp_conf(self, loadbalancer): pass
[docs] def stop_vrrp_service(self, loadbalancer): pass
[docs] def start_vrrp_service(self, loadbalancer): pass
[docs] def reload_vrrp_service(self, loadbalancer): pass
[docs] def get_vrrp_interface(self, amphora): pass
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.