Interface LifecycleAction

All Superinterfaces:
NamedWriteable, ToXContent, ToXContentObject, Writeable
All Known Implementing Classes:
AllocateAction, DeleteAction, DownsampleAction, ForceMergeAction, FreezeAction, MigrateAction, ReadOnlyAction, RolloverAction, SearchableSnapshotAction, SetPriorityAction, ShrinkAction, UnfollowAction, WaitForSnapshotAction

public interface LifecycleAction extends ToXContentObject, NamedWriteable
Executes an action on an index related to its lifecycle.
  • Method Details

    • toSteps

      List<Step> toSteps(Client client, String phase, @Nullable Step.StepKey nextStepKey)
      converts the LifecycleAction's execution plan into a series of Steps that reference each other to preserve order of operations.
      Parameters:
      client - the client that will be used by AsyncActionStep and AsyncWaitStep steps
      phase - the name of the phase this action is being executed within
      nextStepKey - the next step to execute after this action's steps. If null, then there are no further steps to run. It is the responsibility of each LifecycleAction to implement this correctly and not forget to link to this final step so that the policy can continue.
      Returns:
      an ordered list of steps that represent the execution plan of the action
    • toSteps

      default List<Step> toSteps(Client client, String phase, @Nullable Step.StepKey nextStepKey, XPackLicenseState licenseState)
      converts the LifecycleAction's execution plan into a series of Steps that reference each other to preserve order of operations. This overload allows access to license state.
      Parameters:
      client - the client that will be used by AsyncActionStep and AsyncWaitStep steps
      phase - the name of the phase this action is being executed within
      nextStepKey - the next step to execute after this action's steps. If null, then there are no further steps to run. It is the responsibility of each LifecycleAction to implement this correctly and not forget to link to this final step so that the policy can continue.
      licenseState - the license state to use for actions that need license checks.
      Returns:
      an ordered list of steps that represent the execution plan of the action
    • isSafeAction

      boolean isSafeAction()
      Returns:
      true if this action is considered safe. An action is not safe if it will produce unwanted side effects or will get stuck when the action configuration is changed while an index is in this action