def __init__(self, c, context, pool, old_pool=None, deprecated_arg=None): self.c = c self.context = context self.pool = pool self.c_pers = None self.s_pers = None # self.old_pool = old_pool self.sp_obj_dict = { 'HTTP_COOKIE': "cookie_persistence", 'APP_COOKIE': "cookie_persistence", 'SOURCE_IP': "src_ip_persistence", } if pool: self.name = pool.id if pool and pool.session_persistence: self.sp = pool.session_persistence if self.sp.type == 'HTTP_COOKIE' or self.sp.type == 'APP_COOKIE': self.c_pers = self.name elif self.sp.type == 'SOURCE_IP': self.s_pers = self.name else: raise a10_ex.UnsupportedFeature() else: self.sp = None
def create(self): methods = { 'HTTP_COOKIE': self.c.client.slb.template.cookie_persistence.create, 'SOURCE_IP': self.c.client.slb.template.src_ip_persistence.create, } if self.sp.type in methods: try: methods[self.sp.type](self.name) except acos_errors.Exists: pass else: raise a10_ex.UnsupportedFeature() if self.pool.listener: self.pool_handler.a10_driver.listener._update( self.c, self.context, self.pool.listener)
def _persistence_get(self, c, context, listener): if (not listener.default_pool or not listener.default_pool.sessionpersistence): return [None, None] sp = listener.default_pool.sessionpersistence name = listener.default_pool.id c_pers = None s_pers = None if sp.type == 'HTTP_COOKIE': c_pers = name elif sp.type == 'SOURCE_IP': s_pers = name else: raise a10_ex.UnsupportedFeature() return [c_pers, s_pers]
def __init__(self, c, context, vip, vip_name): self.c = c self.context = context self.vip = vip self.c_pers = None self.s_pers = None self.name = vip_name if vip.get('session_persistence', None) is not None: self.sp = vip['session_persistence'] if self.sp['type'] == 'HTTP_COOKIE': self.c_pers = self.name elif self.sp['type'] == 'SOURCE_IP': self.s_pers = self.name else: raise a10_ex.UnsupportedFeature() else: self.sp = None
def __init__(self, c, context, pool, deprecated_arg=None): self.c = c self.context = context self.pool = pool self.c_pers = None self.s_pers = None if pool: self.name = pool.id if pool and pool.sessionpersistence: self.sp = pool.sessionpersistence if self.sp.type == 'HTTP_COOKIE' or self.sp.type == 'APP_COOKIE': self.c_pers = self.name elif self.sp.type == 'SOURCE_IP': self.s_pers = self.name else: raise a10_ex.UnsupportedFeature() else: self.sp = None
def __init__(self, c, context, vip, vip_name, old_vip=None): self.c = c self.context = context self.vip = vip self.c_pers = None self.s_pers = None self.name = vip_name self.old_vip = old_vip self.sp_obj_dict = { 'HTTP_COOKIE': "cookie_persistence", 'SOURCE_IP': "src_ip_persistence", } self.sp = vip.get("session_persistence") if self.sp is not None: if self.sp['type'] == 'HTTP_COOKIE': self.c_pers = self.name elif self.sp['type'] == 'SOURCE_IP': self.s_pers = self.name else: raise a10_ex.UnsupportedFeature()
def refresh(self, context, lb_obj, force=False): raise a10_ex.UnsupportedFeature()