Added post_vip_plug method to the amphora driver

Fixed some doc'ed docstrings as well to satisfy someone's OCD.  I won't name
names but they're name rhymes with Hadam Arwell.

Change-Id: I0b6482cda29c556918c2b2eb8b03cdec30b0b7c3
This commit is contained in:
Brandon Logan 2015-04-10 15:14:44 -05:00
parent 1bb0402062
commit 961f304ca1
2 changed files with 43 additions and 31 deletions
octavia/amphorae/drivers
specs/version0.5

@ -121,7 +121,6 @@ class AmphoraLoadBalancerDriver(object):
def finalize_amphora(self, amphora):
"""It is called before listeners configured while amphora was built
:param amphora: amphora object, need to use its id property
:type amphora: object
:returns: return a value list (amphora.id, status flag--'ge
@ -135,10 +134,19 @@ class AmphoraLoadBalancerDriver(object):
"""
pass
def post_vip_plug(self, load_balancer):
"""Called after network driver has allocated and plugged the VIP
:param load_balancer: A load balancer that just had its vip allocated
and plugged in the network driver.
:type load_balancer: octavia.common.data_models.LoadBalancer
:returns: None
"""
pass
def post_network_plug(self, amphora):
"""Called after amphora added to network
:param amphora: amphora object, needs id and network ip(s)
:type amphora: object

@ -38,60 +38,65 @@ Establish a base class to model the desire functionality:
#return the logger to use - this is a way to inject a custom logger for testing, etc
def update(self, listener, vip):
"""
updates the amphora with a new configuration
for the listener on the vip.
"""updates the amphora with a new configuration
for the listener on the vip.
"""
raise NotImplementedError
def stop(self, listener, vip):
"""
stops the listener on the vip.
"""
"""stops the listener on the vip."""
return None
def start(self, listener, vip):
"""
starts the listener on the vip.
"""
"""starts the listener on the vip."""
return None
def delete(self, listener, vip):
"""
deletes the listener on the vip.
"""
"""deletes the listener on the vip."""
raise NotImplementedError
def get_info(self, amphora):
"""
returns information about the amphora, e.g. {"Rest Interface": "1.0", "Amphorae": "1.0",
"packages":{"ha proxy":"1.5"}, "network-interfaces": {"eth0":{"ip":...}}
some information might come from querying the amphora
"""Get detailed information about an amphora
returns information about the amphora, e.g. {"Rest Interface":
"1.0", "Amphorae": "1.0", "packages":{"ha proxy":"1.5"},
"network-interfaces": {"eth0":{"ip":...}} some information might
come from querying the amphora
"""
raise NotImplementedError
def get_diagnostics(self, amphora):
"""
OPTIONAL - run some expensive self tests to determine if the amphora and the
lbs are healthy the idea is that those tests are triggered more infrequent
than the heartbeat
"""OPTIONAL - Run diagnostics
run some expensive self tests to determine if the amphora and the
lbs are healthy the idea is that those tests are triggered more
infrequent than the heartbeat
"""
raise NotImplementedError
def finalize_amphora(self, amphora):
"""
OPTIONAL - this method is called once an amphora has been build but before
any listeners are configured. This is a hook for drivers who need to do
additional work before am amphora becomes ready to accept listeners. Please keep in
mind that amphora might be kept in am offline pool after this call.
"""OPTIONAL - called once an amphora has been build but before
any listeners are configured. This is a hook for drivers who need
to do additional work before am amphora becomes ready to accept
listeners. Please keep in mind that amphora might be kept in am
offline pool after this call.
"""
pass
def post_network_plug(self, amphora):
"""OPTIONAL - called after adding a compute instance to a network.
This will perform any necessary actions to allow for connectivity
for that network on that instance.
"""
OPTIONAL - this method will be called after adding a compute instance to a network.
This will perform any necessary actions to allow for connectivity for that network
on that instance.
def post_vip_plug(self, load_balancer):
"""OPTIONAL - called after plug_vip method of the network driver.
This is to do any additional work needed on the amphorae to plug
the vip, such as bring up interfaces.
"""
def start_health_check(self, health_mixin):
@ -108,7 +113,6 @@ Establish a base class to model the desire functionality:
def stop_health_check(self):
"""stop check health
Stop listener process and calls HealthMixin to update
databases information.
"""