diff --git a/src/CodeGeneration/ApiGenerator/Program.cs b/src/CodeGeneration/ApiGenerator/Program.cs index 25e65806591..9549c83c711 100644 --- a/src/CodeGeneration/ApiGenerator/Program.cs +++ b/src/CodeGeneration/ApiGenerator/Program.cs @@ -40,7 +40,7 @@ private static void Main(string[] args) RestSpecDownloader.Download(downloadBranch); ApiGenerator.Generate(downloadBranch, "Core", "Graph", "License", "Security", "Watcher", "Info", "MachineLearning", "Migration", "Sql", - "Rollup", "Ssl"); + "Rollup", "Ccr", "Ssl"); } } } diff --git a/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs b/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs index fab698bd43a..e032c8e5e69 100644 --- a/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs +++ b/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs @@ -2187,6 +2187,51 @@ public partial class UpdateByQueryRequestParameters : RequestParametersThe number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. public long? Slices { get => Q("slices"); set => Q("slices", value); } } + ///Request options for CcrDeleteAutoFollowPattern
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html
+ public partial class DeleteAutoFollowPatternRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE; + } + ///Request options for CcrFollow
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html
+ public partial class CreateFollowIndexRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.PUT; + } + ///Request options for CcrFollowStats
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html
+ public partial class FollowIndexStatsRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + } + ///Request options for CcrGetAutoFollowPattern
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html
+ public partial class GetAutoFollowPatternRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + } + ///Request options for CcrPauseFollow
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html
+ public partial class PauseFollowIndexRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.POST; + } + ///Request options for CcrPutAutoFollowPattern
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html
+ public partial class CreateAutoFollowPatternRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.PUT; + } + ///Request options for CcrResumeFollow
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html
+ public partial class ResumeFollowIndexRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.POST; + } + ///Request options for CcrStats
https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html
+ public partial class CcrStatsRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + } + ///Request options for CcrUnfollow
http://www.elastic.co/guide/en/elasticsearch/reference/current
+ public partial class UnfollowIndexRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.POST; + } ///Request options for XpackGraphExplore
https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
public partial class GraphExploreRequestParameters : RequestParameters { diff --git a/src/Elasticsearch.Net/ElasticLowLevelClient.Generated.cs b/src/Elasticsearch.Net/ElasticLowLevelClient.Generated.cs index 78bb52fc131..39279aeed86 100644 --- a/src/Elasticsearch.Net/ElasticLowLevelClient.Generated.cs +++ b/src/Elasticsearch.Net/ElasticLowLevelClient.Generated.cs @@ -2930,6 +2930,108 @@ public TResponse UpdateByQuery(string index, string type, PostData bo ///A func that allows you to describe the querystring parameters & request specific connection settings. public Task UpdateByQueryAsync(string index, string type, PostData body, UpdateByQueryRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(POST, Url($"{index.NotNull("index")}/{type.NotNull("type")}/_update_by_query"), ctx, body, _params(requestParameters)); + ///DELETE on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrDeleteAutoFollowPattern(string name, DeleteAutoFollowPatternRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(DELETE, Url($"_ccr/auto_follow/{name.NotNull("name")}"), null, _params(requestParameters)); + ///DELETE on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrDeleteAutoFollowPatternAsync(string name, DeleteAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(DELETE, Url($"_ccr/auto_follow/{name.NotNull("name")}"), ctx, null, _params(requestParameters)); + ///PUT on /{index}/_ccr/follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + ///The name of the follower index + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrFollow(string index, PostData body, CreateFollowIndexRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(PUT, Url($"{index.NotNull("index")}/_ccr/follow"), body, _params(requestParameters)); + ///PUT on /{index}/_ccr/follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + ///The name of the follower index + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrFollowAsync(string index, PostData body, CreateFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(PUT, Url($"{index.NotNull("index")}/_ccr/follow"), ctx, body, _params(requestParameters)); + ///GET on /{index}/_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + ///A comma-separated list of index patterns; use `_all` to perform the operation on all indices + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrFollowStats(string index, FollowIndexStatsRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(GET, Url($"{index.NotNull("index")}/_ccr/stats"), null, _params(requestParameters)); + ///GET on /{index}/_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + ///A comma-separated list of index patterns; use `_all` to perform the operation on all indices + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrFollowStatsAsync(string index, FollowIndexStatsRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(GET, Url($"{index.NotNull("index")}/_ccr/stats"), ctx, null, _params(requestParameters)); + ///GET on /_ccr/auto_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrGetAutoFollowPattern(GetAutoFollowPatternRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(GET, Url($"_ccr/auto_follow"), null, _params(requestParameters)); + ///GET on /_ccr/auto_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrGetAutoFollowPatternAsync(GetAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(GET, Url($"_ccr/auto_follow"), ctx, null, _params(requestParameters)); + ///GET on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrGetAutoFollowPattern(string name, GetAutoFollowPatternRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(GET, Url($"_ccr/auto_follow/{name.NotNull("name")}"), null, _params(requestParameters)); + ///GET on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrGetAutoFollowPatternAsync(string name, GetAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(GET, Url($"_ccr/auto_follow/{name.NotNull("name")}"), ctx, null, _params(requestParameters)); + ///POST on /{index}/_ccr/pause_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + ///The name of the follower index that should pause following its leader index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrPauseFollow(string index, PauseFollowIndexRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(POST, Url($"{index.NotNull("index")}/_ccr/pause_follow"), null, _params(requestParameters)); + ///POST on /{index}/_ccr/pause_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + ///The name of the follower index that should pause following its leader index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrPauseFollowAsync(string index, PauseFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(POST, Url($"{index.NotNull("index")}/_ccr/pause_follow"), ctx, null, _params(requestParameters)); + ///PUT on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///The specification of the auto follow pattern + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrPutAutoFollowPattern(string name, PostData body, CreateAutoFollowPatternRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(PUT, Url($"_ccr/auto_follow/{name.NotNull("name")}"), body, _params(requestParameters)); + ///PUT on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///The specification of the auto follow pattern + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrPutAutoFollowPatternAsync(string name, PostData body, CreateAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(PUT, Url($"_ccr/auto_follow/{name.NotNull("name")}"), ctx, body, _params(requestParameters)); + ///POST on /{index}/_ccr/resume_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + ///The name of the follow index to resume following. + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrResumeFollow(string index, PostData body, ResumeFollowIndexRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(POST, Url($"{index.NotNull("index")}/_ccr/resume_follow"), body, _params(requestParameters)); + ///POST on /{index}/_ccr/resume_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + ///The name of the follow index to resume following. + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrResumeFollowAsync(string index, PostData body, ResumeFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(POST, Url($"{index.NotNull("index")}/_ccr/resume_follow"), ctx, body, _params(requestParameters)); + ///GET on /_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrStats(CcrStatsRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(GET, Url($"_ccr/stats"), null, _params(requestParameters)); + ///GET on /_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrStatsAsync(CcrStatsRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(GET, Url($"_ccr/stats"), ctx, null, _params(requestParameters)); + ///POST on /{index}/_ccr/unfollow http://www.elastic.co/guide/en/elasticsearch/reference/current + ///The name of the follower index that should be turned into a regular index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public TResponse CcrUnfollow(string index, UnfollowIndexRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequest(POST, Url($"{index.NotNull("index")}/_ccr/unfollow"), null, _params(requestParameters)); + ///POST on /{index}/_ccr/unfollow http://www.elastic.co/guide/en/elasticsearch/reference/current + ///The name of the follower index that should be turned into a regular index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + public Task CcrUnfollowAsync(string index, UnfollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) + where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync(POST, Url($"{index.NotNull("index")}/_ccr/unfollow"), ctx, null, _params(requestParameters)); ///GET on /{index}/_xpack/graph/_explore https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices ///A func that allows you to describe the querystring parameters & request specific connection settings. diff --git a/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs b/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs index 9c3ab3f798a..53e7391e819 100644 --- a/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs +++ b/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs @@ -2376,6 +2376,88 @@ public partial interface IElasticLowLevelClient ///The search definition using the Query DSL ///A func that allows you to describe the querystring parameters & request specific connection settings. Task UpdateByQueryAsync(string index, string type, PostData body, UpdateByQueryRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///DELETE on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrDeleteAutoFollowPattern(string name, DeleteAutoFollowPatternRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///DELETE on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrDeleteAutoFollowPatternAsync(string name, DeleteAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///PUT on /{index}/_ccr/follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + ///The name of the follower index + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrFollow(string index, PostData body, CreateFollowIndexRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///PUT on /{index}/_ccr/follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + ///The name of the follower index + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrFollowAsync(string index, PostData body, CreateFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /{index}/_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + ///A comma-separated list of index patterns; use `_all` to perform the operation on all indices + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrFollowStats(string index, FollowIndexStatsRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /{index}/_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + ///A comma-separated list of index patterns; use `_all` to perform the operation on all indices + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrFollowStatsAsync(string index, FollowIndexStatsRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/auto_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrGetAutoFollowPattern(GetAutoFollowPatternRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/auto_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrGetAutoFollowPatternAsync(GetAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrGetAutoFollowPattern(string name, GetAutoFollowPatternRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrGetAutoFollowPatternAsync(string name, GetAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/pause_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + ///The name of the follower index that should pause following its leader index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrPauseFollow(string index, PauseFollowIndexRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/pause_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + ///The name of the follower index that should pause following its leader index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrPauseFollowAsync(string index, PauseFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///PUT on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///The specification of the auto follow pattern + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrPutAutoFollowPattern(string name, PostData body, CreateAutoFollowPatternRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///PUT on /_ccr/auto_follow/{name} https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + ///The name of the auto follow pattern. + ///The specification of the auto follow pattern + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrPutAutoFollowPatternAsync(string name, PostData body, CreateAutoFollowPatternRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/resume_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + ///The name of the follow index to resume following. + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrResumeFollow(string index, PostData body, ResumeFollowIndexRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/resume_follow https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + ///The name of the follow index to resume following. + ///The name of the leader index and other optional ccr related parameters + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrResumeFollowAsync(string index, PostData body, ResumeFollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrStats(CcrStatsRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///GET on /_ccr/stats https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrStatsAsync(CcrStatsRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/unfollow http://www.elastic.co/guide/en/elasticsearch/reference/current + ///The name of the follower index that should be turned into a regular index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + TResponse CcrUnfollow(string index, UnfollowIndexRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_ccr/unfollow http://www.elastic.co/guide/en/elasticsearch/reference/current + ///The name of the follower index that should be turned into a regular index. + ///A func that allows you to describe the querystring parameters & request specific connection settings. + Task CcrUnfollowAsync(string index, UnfollowIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new(); ///GET on /{index}/_xpack/graph/_explore https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices ///A func that allows you to describe the querystring parameters & request specific connection settings. diff --git a/src/Nest/Cluster/ClusterSettings/ClusterPutSettings/RemoteClusterConfiguration.cs b/src/Nest/Cluster/ClusterSettings/ClusterPutSettings/RemoteClusterConfiguration.cs new file mode 100644 index 00000000000..63b7af0e9f6 --- /dev/null +++ b/src/Nest/Cluster/ClusterSettings/ClusterPutSettings/RemoteClusterConfiguration.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Nest +{ + /// + /// Simplifies the creation of remote cluster configuration, can be combined with a dictionary using the overloaded + operator + /// + public class RemoteClusterConfiguration : IsADictionaryBase + { + private readonly Dictionary _remoteDictionary = + new Dictionary(); + + public RemoteClusterConfiguration() => + BackingDictionary["cluster"] = new Dictionary() + { + { "remote", _remoteDictionary } + }; + + public void Add(string name, params Uri[] seeds) => + Add(name, seeds.Select(u => $"{u.Host}:{u.Port}").ToArray()); + + public void Add(string name, params string[] seeds) => + _remoteDictionary[name] = new Dictionary() + { + { "seeds", seeds } + }; + + public static Dictionary operator +(RemoteClusterConfiguration left, IDictionary right) => Combine(left, right); + public static Dictionary operator +(IDictionary left, RemoteClusterConfiguration right) => Combine(left, right); + + private static Dictionary Combine(IDictionary left, IDictionary right) + { + if (left == null && right == null) return null; + if (left == null) return new Dictionary(right); + if (right == null) return new Dictionary(left); + + foreach (var kv in right) left[kv.Key] = kv.Value; + return new Dictionary(left); + } + } +} diff --git a/src/Nest/IndexModules/IndexSettings/Settings/IndexSettings.cs b/src/Nest/IndexModules/IndexSettings/Settings/IndexSettings.cs index 81e95bb0091..6b3e22ab8f6 100644 --- a/src/Nest/IndexModules/IndexSettings/Settings/IndexSettings.cs +++ b/src/Nest/IndexModules/IndexSettings/Settings/IndexSettings.cs @@ -28,9 +28,7 @@ public interface IIndexSettings : IDynamicIndexSettings /// int? NumberOfShards { get; set; } - /// - /// Settings associated with queries. - /// + /// Settings associated with queries. IQueriesSettings Queries { get; set; } /// @@ -45,7 +43,8 @@ public interface IIndexSettings : IDynamicIndexSettings /// ISortingSettings Sorting { get; set; } - + /// Soft delete settings for the index + ISoftDeleteSettings SoftDeletes { get; set; } } /// @@ -72,6 +71,9 @@ public IndexSettings(IDictionary container) : base(container) { /// public ISortingSettings Sorting { get; set; } + + /// + public ISoftDeleteSettings SoftDeletes { get; set; } } /// @@ -102,5 +104,9 @@ public IndexSettingsDescriptor Queries(Func public IndexSettingsDescriptor Sorting(Func, ISortingSettings> selector) where T : class => Assign(a => a.Sorting = selector?.Invoke(new SortingSettingsDescriptor())); + + /// + public IndexSettingsDescriptor SoftDeletes(Func selector) => + Assign(a => a.SoftDeletes = selector?.Invoke(new SoftDeleteSettingsDescriptor())); } } diff --git a/src/Nest/IndexModules/IndexSettings/Settings/IndexSettingsConverter.cs b/src/Nest/IndexModules/IndexSettings/Settings/IndexSettingsConverter.cs index 6d6b94dd38f..296cb161e3f 100644 --- a/src/Nest/IndexModules/IndexSettings/Settings/IndexSettingsConverter.cs +++ b/src/Nest/IndexModules/IndexSettings/Settings/IndexSettingsConverter.cs @@ -97,6 +97,11 @@ void Set(string knownKey, object newValue) Set(NumberOfShards, indexSettings?.NumberOfShards); Set(NumberOfRoutingShards, indexSettings?.NumberOfRoutingShards); Set(RoutingPartitionSize, indexSettings?.RoutingPartitionSize); + if (indexSettings?.SoftDeletes != null) + { + Set(SoftDeletesEnabled, indexSettings?.SoftDeletes?.Enabled); + Set(SoftDeletesRetentionOperations, indexSettings?.SoftDeletes?.Retention?.Operations); + } if (indexSettings?.Sorting != null) { @@ -208,14 +213,10 @@ private static void SetKnownIndexSettings(JsonReader reader, JsonSerializer seri v => fetch.ThresholdTrace = v); var indexing = s.SlowLog.Indexing = new SlowLogIndexing(); - Set