def get_delete_health_monitor_vthunder_subflow(self): delete_hm_vthunder_subflow = linear_flow.Flow( a10constants.DELETE_HEALTH_MONITOR_VTHUNDER_SUBFLOW) delete_hm_vthunder_subflow.add( health_monitor_tasks.DeleteHealthMonitor( requires=[constants.HEALTH_MON, a10constants.VTHUNDER])) return delete_hm_vthunder_subflow
def test_health_monitor_delete_task(self): hm_task = task.DeleteHealthMonitor() hm_task.axapi_client = self.client_mock mock_hm = copy.deepcopy(HM) hm_task.execute(mock_hm, VTHUNDER) self.client_mock.slb.hm.delete.assert_called_with( a10constants.MOCK_HM_ID)
def get_delete_health_monitor_vthunder_subflow(self, health_mon=constants.HEALTH_MON): delete_hm_vthunder_subflow = linear_flow.Flow( a10constants.DELETE_HEALTH_MONITOR_VTHUNDER_SUBFLOW) delete_hm_vthunder_subflow.add(health_monitor_tasks.DeleteHealthMonitor( name="delete_health_monitor_" + health_mon, requires=[constants.HEALTH_MON, a10constants.VTHUNDER], rebind={constants.HEALTH_MON: health_mon})) return delete_hm_vthunder_subflow
def get_delete_health_monitor_flow(self): """Create a flow to delete a health monitor :returns: The flow for deleting a health monitor """ delete_hm_flow = linear_flow.Flow(constants.DELETE_HEALTH_MONITOR_FLOW) delete_hm_flow.add( lifecycle_tasks.HealthMonitorToErrorOnRevertTask(requires=[ constants.HEALTH_MON, constants.LISTENERS, constants.LOADBALANCER ])) delete_hm_flow.add( database_tasks.MarkHealthMonitorPendingDeleteInDB( requires=constants.HEALTH_MON)) delete_hm_flow.add( model_tasks.DeleteModelObject( rebind={constants.OBJECT: constants.HEALTH_MON})) delete_hm_flow.add( a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) delete_hm_flow.add( health_monitor_tasks.DeleteHealthMonitor( requires=[constants.HEALTH_MON, a10constants.VTHUNDER])) delete_hm_flow.add( database_tasks.DeleteHealthMonitorInDB( requires=constants.HEALTH_MON)) delete_hm_flow.add( database_tasks.DecrementHealthMonitorQuota( requires=constants.HEALTH_MON)) delete_hm_flow.add( database_tasks.UpdatePoolMembersOperatingStatusInDB( requires=constants.POOL, inject={constants.OPERATING_STATUS: constants.NO_MONITOR})) delete_hm_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) delete_hm_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) return delete_hm_flow
def test_health_monitor_delete_task(self): mock_hm = task.DeleteHealthMonitor() mock_hm.axapi_client = self.client_mock mock_hm.execute(HM, VTHUNDER) self.client_mock.slb.hm.delete.assert_called_with( a10constants.MOCK_HM_ID)