Skip to content

Commit c119792

Browse files
committed
Merge pull request #1493 from elastic/fix/snapshot-version
fix #1485 add support for version on snapshot info
2 parents fa4b51e + a2fbf6a commit c119792

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Nest/Domain/Repository/Snapshot.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public class Snapshot
3737
[JsonProperty("failures")]
3838
public IEnumerable<SnapshotShardFailure> ShardFailures { get; internal set; }
3939

40+
[JsonProperty("version_id")]
41+
public int VersionId { get; internal set; }
42+
43+
[JsonProperty("version")]
44+
public string Version { get; internal set; }
45+
4046
/// <summary>
4147
/// Contains the reason for each shard failure.
4248
/// </summary>

src/Tests/Nest.Tests.Integration/Core/Repository/RestoreTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public void SnapshotRestore()
7171
snapshotResponse.IsValid.Should().BeTrue();
7272
snapshotResponse.Accepted.Should().BeTrue();
7373
snapshotResponse.Snapshot.Should().NotBeNull();
74+
if (ElasticsearchConfiguration.CurrentVersion >= new Version("1.7.0"))
75+
snapshotResponse.Snapshot.VersionId.Should().BeGreaterThan(0);
76+
7477
snapshotResponse.Snapshot.EndTimeInMilliseconds.Should().BeGreaterThan(0);
7578
snapshotResponse.Snapshot.StartTime.Should().BeAfter(DateTime.UtcNow.AddDays(-1));
7679

0 commit comments

Comments
 (0)