Example #1
0
    def get_delete_l7policy_flow(self):
        """Create a flow to delete an L7 policy

        :returns: The flow for deleting an L7 policy
        """
        delete_l7policy_flow = linear_flow.Flow(constants.DELETE_L7POLICY_FLOW)
        delete_l7policy_flow.add(
            lifecycle_tasks.L7PolicyToErrorOnRevertTask(requires=[
                constants.L7POLICY, constants.LISTENERS, constants.LOADBALANCER
            ]))
        delete_l7policy_flow.add(
            database_tasks.MarkL7PolicyPendingDeleteInDB(
                requires=constants.L7POLICY))
        delete_l7policy_flow.add(
            model_tasks.DeleteModelObject(
                rebind={constants.OBJECT: constants.L7POLICY}))
        #delete_l7policy_flow.add(amphora_driver_tasks.ListenersUpdate(
        #    requires=[constants.LOADBALANCER, constants.LISTENERS]))
        delete_l7policy_flow.add(
            a10_database_tasks.GetVThunderByLoadBalancer(
                requires=constants.LOADBALANCER,
                provides=a10constants.VTHUNDER))
        delete_l7policy_flow.add(
            handler_l7policy.DeleteL7Policy(
                requires=[constants.L7POLICY, a10constants.VTHUNDER]))
        delete_l7policy_flow.add(
            database_tasks.DeleteL7PolicyInDB(requires=constants.L7POLICY))
        delete_l7policy_flow.add(
            database_tasks.MarkLBAndListenersActiveInDB(
                requires=[constants.LOADBALANCER, constants.LISTENERS]))

        return delete_l7policy_flow
Example #2
0
    def get_delete_l7policy_flow(self):
        """Create a flow to delete an L7 policy

        :returns: The flow for deleting an L7 policy
        """
        delete_l7policy_flow = linear_flow.Flow(constants.DELETE_L7POLICY_FLOW)
        delete_l7policy_flow.add(
            lifecycle_tasks.L7PolicyToErrorOnRevertTask(requires=[
                constants.L7POLICY, constants.LISTENERS,
                constants.LOADBALANCER_ID
            ]))
        delete_l7policy_flow.add(
            database_tasks.MarkL7PolicyPendingDeleteInDB(
                requires=constants.L7POLICY))
        delete_l7policy_flow.add(
            amphora_driver_tasks.ListenersUpdate(
                requires=constants.LOADBALANCER_ID))
        delete_l7policy_flow.add(
            database_tasks.DeleteL7PolicyInDB(requires=constants.L7POLICY))
        delete_l7policy_flow.add(
            database_tasks.DecrementL7policyQuota(requires=constants.L7POLICY))
        delete_l7policy_flow.add(
            database_tasks.MarkLBAndListenersActiveInDB(
                requires=(constants.LOADBALANCER_ID, constants.LISTENERS)))

        return delete_l7policy_flow