diff --git a/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsRequest.cs b/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsRequest.cs new file mode 100644 index 00000000000..d34a0a0fabd --- /dev/null +++ b/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsRequest.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Elasticsearch.Net; +using Elasticsearch.Net.Specification.ClusterApi; + +namespace Nest +{ + [MapsApi("cluster.delete_voting_config_exclusions")] + public partial interface IDeleteVotingConfigExclusionsRequest { } + + public partial class DeleteVotingConfigExclusionsRequest + { + protected sealed override void RequestDefaults(DeleteVotingConfigExclusionsRequestParameters parameters) => + parameters.CustomResponseBuilder = new DeleteVotingConfigExclusionsResponseBuilder(); + } + + public partial class DeleteVotingConfigExclusionsDescriptor + { + protected sealed override void RequestDefaults(DeleteVotingConfigExclusionsRequestParameters parameters) => + parameters.CustomResponseBuilder = new DeleteVotingConfigExclusionsResponseBuilder(); + } + + /// + /// Response is a single newline character, so skip trying to deserialize to an object + /// + internal class DeleteVotingConfigExclusionsResponseBuilder : CustomResponseBuilderBase + { + public override object DeserializeResponse(IElasticsearchSerializer builtInSerializer, IApiCallDetails response, Stream stream) => + new DeleteVotingConfigExclusionsResponse(); + + public override Task DeserializeResponseAsync(IElasticsearchSerializer builtInSerializer, IApiCallDetails response, Stream stream, CancellationToken ctx = default) => + Task.FromResult(new DeleteVotingConfigExclusionsResponse()); + } +} diff --git a/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsResponse.cs b/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsResponse.cs new file mode 100644 index 00000000000..33c7f1b4d61 --- /dev/null +++ b/src/Nest/Cluster/VotingConfigExclusions/DeleteVotingConfigExclusions/DeleteVotingConfigExclusionsResponse.cs @@ -0,0 +1,10 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +namespace Nest +{ + public class DeleteVotingConfigExclusionsResponse : ResponseBase + { + } +} diff --git a/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsRequest.cs b/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsRequest.cs new file mode 100644 index 00000000000..94ff82133b3 --- /dev/null +++ b/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsRequest.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Elasticsearch.Net; +using Elasticsearch.Net.Specification.ClusterApi; + +namespace Nest +{ + [MapsApi("cluster.post_voting_config_exclusions")] + public partial interface IPostVotingConfigExclusionsRequest { } + + public partial class PostVotingConfigExclusionsRequest + { + protected sealed override void RequestDefaults(PostVotingConfigExclusionsRequestParameters parameters) => + parameters.CustomResponseBuilder = new PostVotingConfigExclusionsResponseBuilder(); + } + + public partial class PostVotingConfigExclusionsDescriptor + { + protected sealed override void RequestDefaults(PostVotingConfigExclusionsRequestParameters parameters) => + parameters.CustomResponseBuilder = new PostVotingConfigExclusionsResponseBuilder(); + } + + /// + /// Response is a single newline character, so skip trying to deserialize to an object + /// + internal class PostVotingConfigExclusionsResponseBuilder : CustomResponseBuilderBase + { + public override object DeserializeResponse(IElasticsearchSerializer builtInSerializer, IApiCallDetails response, Stream stream) => + new PostVotingConfigExclusionsResponse(); + + public override Task DeserializeResponseAsync(IElasticsearchSerializer builtInSerializer, IApiCallDetails response, Stream stream, CancellationToken ctx = default) => + Task.FromResult(new PostVotingConfigExclusionsResponse()); + } +} diff --git a/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsResponse.cs b/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsResponse.cs new file mode 100644 index 00000000000..bc93f3e7ad7 --- /dev/null +++ b/src/Nest/Cluster/VotingConfigExclusions/PostVotingConfigExclusions/PostVotingConfigExclusionsResponse.cs @@ -0,0 +1,10 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +namespace Nest +{ + public class PostVotingConfigExclusionsResponse : ResponseBase + { + } +} diff --git a/src/Nest/Descriptors.Cluster.cs b/src/Nest/Descriptors.Cluster.cs index c1aa3d83e0b..ac3b811366e 100644 --- a/src/Nest/Descriptors.Cluster.cs +++ b/src/Nest/Descriptors.Cluster.cs @@ -42,6 +42,16 @@ public partial class ClusterAllocationExplainDescriptor : RequestDescriptorBase< public ClusterAllocationExplainDescriptor IncludeYesDecisions(bool? includeyesdecisions = true) => Qs("include_yes_decisions", includeyesdecisions); } + ///Descriptor for DeleteVotingConfigExclusions https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + public partial class DeleteVotingConfigExclusionsDescriptor : RequestDescriptorBase, IDeleteVotingConfigExclusionsRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterDeleteVotingConfigExclusions; + // values part of the url path + // Request parameters + ///Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. + public DeleteVotingConfigExclusionsDescriptor WaitForRemoval(bool? waitforremoval = true) => Qs("wait_for_removal", waitforremoval); + } + ///Descriptor for GetSettings https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html public partial class ClusterGetSettingsDescriptor : RequestDescriptorBase, IClusterGetSettingsRequest { @@ -119,6 +129,20 @@ public partial class ClusterPendingTasksDescriptor : RequestDescriptorBase Qs("master_timeout", mastertimeout); } + ///Descriptor for PostVotingConfigExclusions https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + public partial class PostVotingConfigExclusionsDescriptor : RequestDescriptorBase, IPostVotingConfigExclusionsRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterPostVotingConfigExclusions; + // values part of the url path + // Request parameters + ///A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. + public PostVotingConfigExclusionsDescriptor NodeIds(string nodeids) => Qs("node_ids", nodeids); + ///A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. + public PostVotingConfigExclusionsDescriptor NodeNames(string nodenames) => Qs("node_names", nodenames); + ///Explicit operation timeout + public PostVotingConfigExclusionsDescriptor Timeout(Time timeout) => Qs("timeout", timeout); + } + ///Descriptor for PutSettings https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html public partial class ClusterPutSettingsDescriptor : RequestDescriptorBase, IClusterPutSettingsRequest { diff --git a/src/Nest/ElasticClient.Cluster.cs b/src/Nest/ElasticClient.Cluster.cs index b77a8c018f5..dc398dab4be 100644 --- a/src/Nest/ElasticClient.Cluster.cs +++ b/src/Nest/ElasticClient.Cluster.cs @@ -61,6 +61,30 @@ internal ClusterNamespace(ElasticClient client): base(client) /// public Task AllocationExplainAsync(IClusterAllocationExplainRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); /// + /// DELETE request to the cluster.delete_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions(Func selector = null) => DeleteVotingConfigExclusions(selector.InvokeOrDefault(new DeleteVotingConfigExclusionsDescriptor())); + /// + /// DELETE request to the cluster.delete_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public Task DeleteVotingConfigExclusionsAsync(Func selector = null, CancellationToken ct = default) => DeleteVotingConfigExclusionsAsync(selector.InvokeOrDefault(new DeleteVotingConfigExclusionsDescriptor()), ct); + /// + /// DELETE request to the cluster.delete_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions(IDeleteVotingConfigExclusionsRequest request) => DoRequest(request, request.RequestParameters); + /// + /// DELETE request to the cluster.delete_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public Task DeleteVotingConfigExclusionsAsync(IDeleteVotingConfigExclusionsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); + /// /// GET request to the cluster.get_settings API, read more about this API online: /// /// https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html @@ -133,6 +157,30 @@ internal ClusterNamespace(ElasticClient client): base(client) /// public Task PendingTasksAsync(IClusterPendingTasksRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); /// + /// POST request to the cluster.post_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public PostVotingConfigExclusionsResponse PostVotingConfigExclusions(Func selector = null) => PostVotingConfigExclusions(selector.InvokeOrDefault(new PostVotingConfigExclusionsDescriptor())); + /// + /// POST request to the cluster.post_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public Task PostVotingConfigExclusionsAsync(Func selector = null, CancellationToken ct = default) => PostVotingConfigExclusionsAsync(selector.InvokeOrDefault(new PostVotingConfigExclusionsDescriptor()), ct); + /// + /// POST request to the cluster.post_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public PostVotingConfigExclusionsResponse PostVotingConfigExclusions(IPostVotingConfigExclusionsRequest request) => DoRequest(request, request.RequestParameters); + /// + /// POST request to the cluster.post_voting_config_exclusions API, read more about this API online: + /// + /// https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + /// + public Task PostVotingConfigExclusionsAsync(IPostVotingConfigExclusionsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); + /// /// PUT request to the cluster.put_settings API, read more about this API online: /// /// https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html diff --git a/src/Nest/Requests.Cluster.cs b/src/Nest/Requests.Cluster.cs index 9eeb09d792f..18ef232f202 100644 --- a/src/Nest/Requests.Cluster.cs +++ b/src/Nest/Requests.Cluster.cs @@ -58,6 +58,26 @@ public bool? IncludeYesDecisions } } + [InterfaceDataContract] + public partial interface IDeleteVotingConfigExclusionsRequest : IRequest + { + } + + ///Request for DeleteVotingConfigExclusions https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + public partial class DeleteVotingConfigExclusionsRequest : PlainRequestBase, IDeleteVotingConfigExclusionsRequest + { + protected IDeleteVotingConfigExclusionsRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterDeleteVotingConfigExclusions; + // values part of the url path + // Request parameters + ///Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. + public bool? WaitForRemoval + { + get => Q("wait_for_removal"); + set => Q("wait_for_removal", value); + } + } + [InterfaceDataContract] public partial interface IClusterGetSettingsRequest : IRequest { @@ -234,6 +254,46 @@ public Time MasterTimeout } } + [InterfaceDataContract] + public partial interface IPostVotingConfigExclusionsRequest : IRequest + { + } + + ///Request for PostVotingConfigExclusions https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + public partial class PostVotingConfigExclusionsRequest : PlainRequestBase, IPostVotingConfigExclusionsRequest + { + protected IPostVotingConfigExclusionsRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterPostVotingConfigExclusions; + // values part of the url path + // Request parameters + /// + /// A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify + /// ?node_names. + /// + public string NodeIds + { + get => Q("node_ids"); + set => Q("node_ids", value); + } + + /// + /// A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify + /// ?node_ids. + /// + public string NodeNames + { + get => Q("node_names"); + set => Q("node_names", value); + } + + ///Explicit operation timeout + public Time Timeout + { + get => Q