-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WaitForSnapshot ILM lifecycle action
Relates: #4341 This commit adds a wait_for_snapshot ILM lifecycle action
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/Nest/XPack/Ilm/Actions/WaitForSnapshotLifecycleAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Nest | ||
{ | ||
/// <summary> | ||
/// The Wait For Snapshot Action waits for defined SLM policy to be executed to ensure that snapshot of index exists before deletion. | ||
/// <para></para> | ||
/// Available in Elasticsearch 7.6.0+ | ||
/// </summary> | ||
public interface IWaitForSnapshotLifecycleAction : ILifecycleAction | ||
{ | ||
/// <summary> | ||
/// The Snapshot Lifecycle Management (SLM) policy name that this action should wait for | ||
/// </summary> | ||
[DataMember(Name = "policy")] | ||
string Policy { get; set; } | ||
} | ||
|
||
/// <inheritdoc /> | ||
public class WaitForSnapshotLifecycleAction : IWaitForSnapshotLifecycleAction | ||
{ | ||
/// <inheritdoc /> | ||
public string Policy { get; set; } | ||
} | ||
|
||
/// <inheritdoc cref="IWaitForSnapshotLifecycleAction"/> | ||
public class WaitForSnapshotLifecycleActionDescriptor | ||
: DescriptorBase<WaitForSnapshotLifecycleActionDescriptor, IWaitForSnapshotLifecycleAction>, IWaitForSnapshotLifecycleAction | ||
{ | ||
string IWaitForSnapshotLifecycleAction.Policy { get; set; } | ||
|
||
/// <inheritdoc cref="IWaitForSnapshotLifecycleAction.Policy"/> | ||
public WaitForSnapshotLifecycleActionDescriptor Policy(string policy) => Assign(policy, (a, v) => a.Policy = policy); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters