Skip to content

Commit 6c279e8

Browse files
committed
Implement snapshot records for last_success and last_failure on SnapshotLifecyclePolicyMetadata. (#4162)
Implement snapshot records for last_success and last_failure on SnapshotLifecyclePolicyMetadata. Do not map TimeString property, instead prefer to use the Time property and convert from epoch milliseconds.
1 parent 1bb1c81 commit 6c279e8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Nest/XPack/Slm/SnapshotLifecyclePolicyMetadata.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ public class SnapshotLifecyclePolicyMetadata
5252
/// </summary>
5353
[DataMember(Name = "in_progress")]
5454
public LifecycleSnapshotInProgress InProgress { get; internal set; }
55+
56+
/// <summary>
57+
/// Information about the last time the policy successfully initiated a snapshot.
58+
/// </summary>
59+
[DataMember(Name = "last_success")]
60+
public SnapshotLifecycleInvocationRecord LastSuccess { get; set; }
61+
62+
/// <summary>
63+
/// Information about the last time the policy failed to initiate a snapshot
64+
/// </summary>
65+
[DataMember(Name = "last_failure")]
66+
public SnapshotLifecycleInvocationRecord LastFailure { get; set; }
67+
}
68+
69+
public class SnapshotLifecycleInvocationRecord
70+
{
71+
[DataMember(Name = "snapshot_name")]
72+
public string SnapshotName { get; set; }
73+
74+
[JsonFormatter(typeof(DateTimeOffsetEpochMillisecondsFormatter))]
75+
[DataMember(Name = "time")]
76+
public DateTimeOffset Time { get; set; }
5577
}
5678

5779
/// <summary>

0 commit comments

Comments
 (0)