4
4
5
5
namespace Nest
6
6
{
7
+ /// <summary>
8
+ /// Restores a snapshot
9
+ /// </summary>
7
10
public partial interface IRestoreRequest
8
11
{
12
+ /// <summary>
13
+ /// The indices to restore
14
+ /// </summary>
9
15
[ JsonProperty ( "indices" ) ]
10
16
Indices Indices { get ; set ; }
17
+
18
+ /// <summary>
19
+ /// Whether indices specified that do not exist
20
+ /// should be ignored.
21
+ /// </summary>
11
22
[ JsonProperty ( "ignore_unavailable" ) ]
12
23
bool ? IgnoreUnavailable { get ; set ; }
24
+
25
+ /// <summary>
26
+ /// Whether the cluster global state should be included
27
+ /// </summary>
13
28
[ JsonProperty ( "include_global_state" ) ]
14
29
bool ? IncludeGlobalState { get ; set ; }
30
+
31
+ /// <summary>
32
+ /// A pattern to use to rename restored indices. The pattern
33
+ /// can be used to capture parts of the original index name
34
+ /// and used within <see cref="RenameReplacement"/>
35
+ /// </summary>
15
36
[ JsonProperty ( "rename_pattern" ) ]
16
37
string RenamePattern { get ; set ; }
38
+
39
+ /// <summary>
40
+ /// A replacement to use to rename restored indices. Used
41
+ /// in conjunction with <see cref="RenamePattern"/>.
42
+ /// </summary>
17
43
[ JsonProperty ( "rename_replacement" ) ]
18
44
string RenameReplacement { get ; set ; }
45
+
46
+ /// <summary>
47
+ /// The index settings that should be applied as part of
48
+ /// the restore operation. Some settings cannot be changed
49
+ /// as part of a restore operation, for example, the number
50
+ /// of shards.
51
+ /// </summary>
19
52
[ JsonProperty ( "index_settings" ) ]
20
53
IUpdateIndexSettingsRequest IndexSettings { get ; set ; }
54
+
55
+ /// <summary>
56
+ /// The index settings to ignore as part of the restore operation
57
+ /// </summary>
21
58
[ JsonProperty ( "ignore_index_settings" ) ]
22
59
List < string > IgnoreIndexSettings { get ; set ; }
23
- }
24
60
61
+ /// <summary>
62
+ /// Whether to include aliases as part of the restore
63
+ /// </summary>
64
+ [ JsonProperty ( "include_aliases" ) ]
65
+ bool ? IncludeAliases { get ; set ; }
66
+
67
+ /// <summary>
68
+ /// Allow partial restore for indices that don't have snapshots of all shards available.
69
+ /// <para />
70
+ /// By default, the entire restore operation will fail if one or more indices participating
71
+ /// in the operation don’t have snapshots of all shards available. It can occur if some
72
+ /// shards failed to snapshot for example. It is still possible to restore such indices
73
+ /// by setting <see cref="Partial"/> to <c>true</c>. Only successfully snapshotted shards
74
+ /// will be restored in this case and all missing shards will be recreated empty.
75
+ /// </summary>
76
+ [ JsonProperty ( "partial" ) ]
77
+ bool ? Partial { get ; set ; }
78
+ }
79
+
80
+ /// <inheritdoc cref="IRestoreRequest"/>
25
81
public partial class RestoreRequest
26
82
{
83
+ /// <inheritdoc />
27
84
public Indices Indices { get ; set ; }
28
85
86
+ /// <inheritdoc />
29
87
public bool ? IgnoreUnavailable { get ; set ; }
30
88
89
+ /// <inheritdoc />
31
90
public bool ? IncludeGlobalState { get ; set ; }
32
91
92
+ /// <inheritdoc />
33
93
public string RenamePattern { get ; set ; }
34
94
95
+ /// <inheritdoc />
35
96
public string RenameReplacement { get ; set ; }
97
+
98
+ /// <inheritdoc />
36
99
public IUpdateIndexSettingsRequest IndexSettings { get ; set ; }
100
+
101
+ /// <inheritdoc />
37
102
public List < string > IgnoreIndexSettings { get ; set ; }
103
+
104
+ /// <inheritdoc />
105
+ public bool ? IncludeAliases { get ; set ; }
106
+
107
+ /// <inheritdoc />
108
+ public bool ? Partial { get ; set ; }
38
109
}
39
110
111
+ /// <inheritdoc cref="IRestoreRequest"/>
40
112
[ DescriptorFor ( "SnapshotRestore" ) ]
41
113
public partial class RestoreDescriptor
42
114
{
@@ -47,27 +119,44 @@ public partial class RestoreDescriptor
47
119
string IRestoreRequest . RenameReplacement { get ; set ; }
48
120
IUpdateIndexSettingsRequest IRestoreRequest . IndexSettings { get ; set ; }
49
121
List < string > IRestoreRequest . IgnoreIndexSettings { get ; set ; }
122
+ bool ? IRestoreRequest . IncludeAliases { get ; set ; }
123
+ bool ? IRestoreRequest . Partial { get ; set ; }
50
124
125
+ /// <inheritdoc cref="IRestoreRequest.Indices"/>
51
126
public RestoreDescriptor Index ( IndexName index ) => this . Indices ( index ) ;
52
127
128
+ /// <inheritdoc cref="IRestoreRequest.Indices"/>
53
129
public RestoreDescriptor Index < T > ( ) where T : class => this . Indices ( typeof ( T ) ) ;
54
130
131
+ /// <inheritdoc cref="IRestoreRequest.Indices"/>
55
132
public RestoreDescriptor Indices ( Indices indices ) => Assign ( a => a . Indices = indices ) ;
56
133
134
+ /// <inheritdoc cref="IRestoreRequest.IgnoreUnavailable"/>
57
135
public RestoreDescriptor IgnoreUnavailable ( bool ? ignoreUnavailable = true ) => Assign ( a => a . IgnoreUnavailable = ignoreUnavailable ) ;
58
136
137
+ /// <inheritdoc cref="IRestoreRequest.IncludeGlobalState"/>
59
138
public RestoreDescriptor IncludeGlobalState ( bool ? includeGlobalState = true ) => Assign ( a => a . IncludeGlobalState = includeGlobalState ) ;
60
139
140
+ /// <inheritdoc cref="IRestoreRequest.RenamePattern"/>
61
141
public RestoreDescriptor RenamePattern ( string renamePattern ) => Assign ( a => a . RenamePattern = renamePattern ) ;
62
142
143
+ /// <inheritdoc cref="IRestoreRequest.RenameReplacement"/>
63
144
public RestoreDescriptor RenameReplacement ( string renameReplacement ) => Assign ( a => a . RenameReplacement = renameReplacement ) ;
64
145
146
+ /// <inheritdoc cref="IRestoreRequest.IndexSettings"/>
65
147
public RestoreDescriptor IndexSettings ( Func < UpdateIndexSettingsDescriptor , IUpdateIndexSettingsRequest > settingsSelector ) =>
66
148
Assign ( a => a . IndexSettings = settingsSelector ? . Invoke ( new UpdateIndexSettingsDescriptor ( ) ) ) ;
67
149
150
+ /// <inheritdoc cref="IRestoreRequest.IgnoreIndexSettings"/>
68
151
public RestoreDescriptor IgnoreIndexSettings ( List < string > ignoreIndexSettings ) => Assign ( a => a . IgnoreIndexSettings = ignoreIndexSettings ) ;
69
152
70
- public RestoreDescriptor IgnoreIndexSettings ( params string [ ] ignoreIndexSettings ) => Assign ( a => a . IgnoreIndexSettings = ignoreIndexSettings . ToListOrNullIfEmpty ( ) ) ;
153
+ /// <inheritdoc cref="IRestoreRequest.IgnoreIndexSettings"/>
154
+ public RestoreDescriptor IgnoreIndexSettings ( params string [ ] ignoreIndexSettings ) => Assign ( a => a . IgnoreIndexSettings = ignoreIndexSettings . ToListOrNullIfEmpty ( ) ) ;
155
+
156
+ /// <inheritdoc cref="IRestoreRequest.IncludeAliases"/>
157
+ public RestoreDescriptor IncludeAliases ( bool ? includeAliases = true ) => Assign ( a => a . IncludeAliases = includeAliases ) ;
71
158
159
+ /// <inheritdoc cref="IRestoreRequest.Partial"/>
160
+ public RestoreDescriptor Partial ( bool ? partial = true ) => Assign ( a => a . Partial = partial ) ;
72
161
}
73
162
}
0 commit comments