def get_delete_listener_internal_flow(self, listener_name): """Create a flow to delete a listener and l7policies internally (will skip deletion on the amp and marking LB active) :returns: The flow for deleting a listener """ delete_listener_flow = linear_flow.Flow(constants.DELETE_LISTENER_FLOW) # Should cascade delete all L7 policies delete_listener_flow.add( network_tasks.UpdateVIPForDelete(name='delete_update_vip_' + listener_name, requires=constants.LOADBALANCER)) delete_listener_flow.add( database_tasks.DeleteListenerInDB( name='delete_listener_in_db_' + listener_name, requires=constants.LISTENER, rebind={constants.LISTENER: listener_name})) delete_listener_flow.add( database_tasks.DecrementListenerQuota( name='decrement_listener_quota_' + listener_name, requires=constants.LISTENER, rebind={constants.LISTENER: listener_name})) return delete_listener_flow
def get_delete_listener_flow(self): """Create a flow to delete a listener :returns: The flow for deleting a listener """ delete_listener_flow = linear_flow.Flow(constants.DELETE_LISTENER_FLOW) delete_listener_flow.add(lifecycle_tasks.ListenerToErrorOnRevertTask( requires=constants.LISTENER)) # update delete flow task here # Get VThunder details from database delete_listener_flow.add(a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) delete_listener_flow.add(handler_virtual_port.ListenerDelete( requires=[constants.LOADBALANCER, constants.LISTENER, a10constants.VTHUNDER])) delete_listener_flow.add(network_tasks.UpdateVIPForDelete( requires=constants.LOADBALANCER)) delete_listener_flow.add(database_tasks.DeleteListenerInDB( requires=constants.LISTENER)) delete_listener_flow.add(database_tasks.DecrementListenerQuota( requires=constants.LISTENER)) delete_listener_flow.add(database_tasks.MarkLBActiveInDB( requires=constants.LOADBALANCER)) return delete_listener_flow
def get_delete_listener_flow(self): """Create a flow to delete a listener :returns: The flow for deleting a listener """ delete_listener_flow = linear_flow.Flow(constants.DELETE_LISTENER_FLOW) delete_listener_flow.add( lifecycle_tasks.ListenerToErrorOnRevertTask( requires=constants.LISTENER)) delete_listener_flow.add( amphora_driver_tasks.ListenerDelete(requires=constants.LISTENER)) delete_listener_flow.add( network_tasks.UpdateVIPForDelete(requires=constants.LOADBALANCER)) delete_listener_flow.add( database_tasks.DeleteListenerInDB(requires=constants.LISTENER)) delete_listener_flow.add( database_tasks.DecrementListenerQuota(requires=constants.LISTENER)) delete_listener_flow.add( database_tasks.MarkLBActiveInDB(requires=constants.LOADBALANCER)) return delete_listener_flow