-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for the clone index API, introduced in Elasticsearch 7.4.0
- Loading branch information
Showing
11 changed files
with
372 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/Nest/Indices/IndexManagement/CloneIndex/CloneIndexRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Nest | ||
{ | ||
/// <summary> | ||
/// A request to the clone index API | ||
/// </summary> | ||
[MapsApi("indices.clone")] | ||
[ReadAs(typeof(CloneIndexRequest))] | ||
public partial interface ICloneIndexRequest | ||
{ | ||
/// <summary> | ||
/// The aliases to apply to the target index | ||
/// </summary> | ||
[DataMember(Name ="aliases")] | ||
IAliases Aliases { get; set; } | ||
|
||
/// <summary> | ||
/// The settings to apply to the target index | ||
/// </summary> | ||
[DataMember(Name ="settings")] | ||
IIndexSettings Settings { get; set; } | ||
} | ||
|
||
/// <inheritdoc cref="ICloneIndexRequest" /> | ||
public partial class CloneIndexRequest | ||
{ | ||
/// <inheritdoc /> | ||
public IAliases Aliases { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public IIndexSettings Settings { get; set; } | ||
} | ||
|
||
/// <inheritdoc cref="ICloneIndexRequest" /> | ||
public partial class CloneIndexDescriptor | ||
{ | ||
IAliases ICloneIndexRequest.Aliases { get; set; } | ||
IIndexSettings ICloneIndexRequest.Settings { get; set; } | ||
|
||
/// <inheritdoc cref="ICloneIndexRequest.Settings"/> | ||
public CloneIndexDescriptor Settings(Func<IndexSettingsDescriptor, IPromise<IIndexSettings>> selector) => | ||
Assign(selector, (a, v) => a.Settings = v?.Invoke(new IndexSettingsDescriptor())?.Value); | ||
|
||
/// <inheritdoc cref="ICloneIndexRequest.Aliases"/> | ||
public CloneIndexDescriptor Aliases(Func<AliasesDescriptor, IPromise<IAliases>> selector) => | ||
Assign(selector, (a, v) => a.Aliases = v?.Invoke(new AliasesDescriptor())?.Value); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Nest/Indices/IndexManagement/CloneIndex/CloneIndexResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Nest | ||
{ | ||
public class CloneIndexResponse : AcknowledgedResponseBase | ||
{ | ||
[DataMember(Name = "shards_acknowledged")] | ||
public bool ShardsAcknowledged { get; set; } | ||
|
||
/// <summary> | ||
/// The target index created | ||
/// </summary> | ||
[DataMember(Name = "index")] | ||
public string Index { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.