1
1
using System ;
2
+ using System . Linq ;
2
3
using System . Collections . Generic ;
3
4
using Newtonsoft . Json ;
4
5
@@ -8,24 +9,47 @@ public class Snapshot
8
9
{
9
10
[ JsonProperty ( "snapshot" ) ]
10
11
public string Name { get ; internal set ; }
12
+
11
13
[ JsonProperty ( "indices" ) ]
12
14
public IEnumerable < string > Indices { get ; internal set ; }
13
15
14
16
[ JsonProperty ( "state" ) ]
15
17
public string State { get ; internal set ; }
18
+
16
19
[ JsonProperty ( "start_time" ) ]
17
20
public DateTime StartTime { get ; internal set ; }
21
+
18
22
[ JsonProperty ( "start_time_in_millis" ) ]
19
23
public long StartTimeInMilliseconds { get ; internal set ; }
24
+
20
25
[ JsonProperty ( "end_time" ) ]
21
26
public DateTime EndTime { get ; internal set ; }
27
+
22
28
[ JsonProperty ( "end_time_in_millis" ) ]
23
29
public long EndTimeInMilliseconds { get ; internal set ; }
30
+
24
31
[ JsonProperty ( "duration_in_millis" ) ]
25
32
public long DurationInMilliseconds { get ; internal set ; }
26
- [ JsonProperty ( "failures" ) ]
27
- public IEnumerable < string > Failures { get ; internal set ; }
33
+
28
34
[ JsonProperty ( "shards" ) ]
29
- public ShardsMetaData Shards { get ; internal set ; }
35
+ public ShardsMetaData Shards { get ; internal set ; }
36
+
37
+ [ JsonProperty ( "failures" ) ]
38
+ public IEnumerable < SnapshotShardFailure > ShardFailures { get ; internal set ; }
39
+
40
+ /// <summary>
41
+ /// Contains the reason for each shard failure.
42
+ /// For 2.0, remove this and rename ShardFailures => Failures
43
+ /// </summary>
44
+ public IEnumerable < string > Failures
45
+ {
46
+ get
47
+ {
48
+ if ( this . ShardFailures != null )
49
+ return this . ShardFailures . Select ( f => f . Reason ) ;
50
+ return new List < string > ( ) ;
51
+ }
52
+ }
53
+
30
54
}
31
55
}
0 commit comments