Skip to content

Commit 7a30c91

Browse files
committed
Expose index age in ILM explain output
addresses elastic/elasticsearch#44457
1 parent 0ddb54f commit 7a30c91

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Nest/XPack/Ilm/ExplainLifecycle/ExplainLifecycleResponse.cs

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public class LifecycleExplain
7878
[DataMember(Name = "step_time_millis")]
7979
[JsonFormatter(typeof(DateTimeOffsetEpochMillisecondsFormatter))]
8080
public DateTimeOffset StepTime { get; internal set; }
81+
82+
/// <summary>
83+
/// The age of the index, useful to guage when the next phase will trigger based on <see cref="IPhase.MinimumAge"/>
84+
/// </summary>
85+
[DataMember(Name = "age")]
86+
public Time Age { get; internal set; }
8187
}
8288

8389
public class PhaseExecution

src/Tests/Tests/XPack/Ilm/IlmApiTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ [I] public async Task IlmExplainLifecycleResponse() => await Assert<ExplainLifec
176176

177177
indexDict.Index.Should().Be("project");
178178
indexDict.Managed.Should().Be(false);
179-
179+
indexDict.Age.Should().BeNull();
180180
});
181181

182182
[I] public async Task IlmStopResponse() => await Assert<StopIlmResponse>(IlmStopStep, (v, r) =>

0 commit comments

Comments
 (0)