Skip to content

Commit 00665d2

Browse files
russcamMpdreamz
authored andcommitted
Delete Indices Upgrade APIs (#3865)
This commit deletes the Indices Upgrade APIs. Both the GET and POST versions of the API are not useful since the upgrade from 2.x to 5.x and will be removed from the REST specs. Taking the opportunity now to remove them in 7.x .NET clients. Closes #3854
1 parent 0468fc0 commit 00665d2

File tree

14 files changed

+6
-497
lines changed

14 files changed

+6
-497
lines changed

src/CodeGeneration/ApiGenerator/Configuration/CodeConfiguration.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ public static class CodeConfiguration
1111
/// <summary> These API"s are not implemented yet in the low and high level client</summary>
1212
public static string[] IgnoredApis { get; } =
1313
{
14-
// these API's are not ready for primetime yet
14+
// APIs is no longer useful and will be removed
15+
"indices.upgrade.json",
16+
"indices.get_upgrade.json",
17+
18+
// these APIs are not ready for primetime yet
1519
"rank_eval.json",
1620

17-
// these API's are new and need to be mapped
21+
// these APIs are new and need to be mapped
1822
"ml.set_upgrade_mode.json",
1923
"ml.find_file_structure.json",
2024
"monitoring.bulk.json",

src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -814,35 +814,6 @@ public TimeSpan MasterTimeout
814814
}
815815
}
816816

817-
///<summary>Request options for UpgradeStatus <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
818-
public class UpgradeStatusRequestParameters : RequestParameters<UpgradeStatusRequestParameters>
819-
{
820-
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
821-
///<summary>
822-
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
823-
/// been specified)
824-
///</summary>
825-
public bool? AllowNoIndices
826-
{
827-
get => Q<bool? >("allow_no_indices");
828-
set => Q("allow_no_indices", value);
829-
}
830-
831-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
832-
public ExpandWildcards? ExpandWildcards
833-
{
834-
get => Q<ExpandWildcards? >("expand_wildcards");
835-
set => Q("expand_wildcards", value);
836-
}
837-
838-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
839-
public bool? IgnoreUnavailable
840-
{
841-
get => Q<bool? >("ignore_unavailable");
842-
set => Q("ignore_unavailable", value);
843-
}
844-
}
845-
846817
///<summary>Request options for Open <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html</para></summary>
847818
public class OpenIndexRequestParameters : RequestParameters<OpenIndexRequestParameters>
848819
{
@@ -1337,49 +1308,6 @@ public TimeSpan Timeout
13371308
}
13381309
}
13391310

1340-
///<summary>Request options for Upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
1341-
public class UpgradeRequestParameters : RequestParameters<UpgradeRequestParameters>
1342-
{
1343-
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
1344-
///<summary>
1345-
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
1346-
/// been specified)
1347-
///</summary>
1348-
public bool? AllowNoIndices
1349-
{
1350-
get => Q<bool? >("allow_no_indices");
1351-
set => Q("allow_no_indices", value);
1352-
}
1353-
1354-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
1355-
public ExpandWildcards? ExpandWildcards
1356-
{
1357-
get => Q<ExpandWildcards? >("expand_wildcards");
1358-
set => Q("expand_wildcards", value);
1359-
}
1360-
1361-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
1362-
public bool? IgnoreUnavailable
1363-
{
1364-
get => Q<bool? >("ignore_unavailable");
1365-
set => Q("ignore_unavailable", value);
1366-
}
1367-
1368-
///<summary>If true, only ancient (an older Lucene major release) segments will be upgraded</summary>
1369-
public bool? OnlyAncientSegments
1370-
{
1371-
get => Q<bool? >("only_ancient_segments");
1372-
set => Q("only_ancient_segments", value);
1373-
}
1374-
1375-
///<summary>Specify whether the request should block until the all segments are upgraded (default: false)</summary>
1376-
public bool? WaitForCompletion
1377-
{
1378-
get => Q<bool? >("wait_for_completion");
1379-
set => Q("wait_for_completion", value);
1380-
}
1381-
}
1382-
13831311
///<summary>Request options for ValidateQuery <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html</para></summary>
13841312
public class ValidateQueryRequestParameters : RequestParameters<ValidateQueryRequestParameters>
13851313
{

src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -393,24 +393,6 @@ public TResponse GetTemplateForAll<TResponse>(string name, GetIndexTemplateReque
393393
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
394394
public Task<TResponse> GetTemplateForAllAsync<TResponse>(string name, GetIndexTemplateRequestParameters requestParameters = null, CancellationToken ctx = default)
395395
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_template/{name:name}"), ctx, null, RequestParams(requestParameters));
396-
///<summary>GET on /_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
397-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
398-
public TResponse UpgradeStatusForAll<TResponse>(UpgradeStatusRequestParameters requestParameters = null)
399-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_upgrade", null, RequestParams(requestParameters));
400-
///<summary>GET on /_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
401-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
402-
public Task<TResponse> UpgradeStatusForAllAsync<TResponse>(UpgradeStatusRequestParameters requestParameters = null, CancellationToken ctx = default)
403-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_upgrade", ctx, null, RequestParams(requestParameters));
404-
///<summary>GET on /{index}/_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
405-
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
406-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
407-
public TResponse UpgradeStatus<TResponse>(string index, UpgradeStatusRequestParameters requestParameters = null)
408-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"{index:index}/_upgrade"), null, RequestParams(requestParameters));
409-
///<summary>GET on /{index}/_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
410-
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
411-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
412-
public Task<TResponse> UpgradeStatusAsync<TResponse>(string index, UpgradeStatusRequestParameters requestParameters = null, CancellationToken ctx = default)
413-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"{index:index}/_upgrade"), ctx, null, RequestParams(requestParameters));
414396
///<summary>POST on /{index}/_open <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html</para></summary>
415397
///<param name = "index">A comma separated list of indices to open</param>
416398
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
@@ -657,24 +639,6 @@ public TResponse BulkAliasForAll<TResponse>(PostData body, BulkAliasRequestParam
657639
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
658640
public Task<TResponse> BulkAliasForAllAsync<TResponse>(PostData body, BulkAliasRequestParameters requestParameters = null, CancellationToken ctx = default)
659641
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, "_aliases", ctx, body, RequestParams(requestParameters));
660-
///<summary>POST on /_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
661-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
662-
public TResponse UpgradeForAll<TResponse>(UpgradeRequestParameters requestParameters = null)
663-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, "_upgrade", null, RequestParams(requestParameters));
664-
///<summary>POST on /_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
665-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
666-
public Task<TResponse> UpgradeForAllAsync<TResponse>(UpgradeRequestParameters requestParameters = null, CancellationToken ctx = default)
667-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, "_upgrade", ctx, null, RequestParams(requestParameters));
668-
///<summary>POST on /{index}/_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
669-
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
670-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
671-
public TResponse Upgrade<TResponse>(string index, UpgradeRequestParameters requestParameters = null)
672-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_upgrade"), null, RequestParams(requestParameters));
673-
///<summary>POST on /{index}/_upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
674-
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
675-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
676-
public Task<TResponse> UpgradeAsync<TResponse>(string index, UpgradeRequestParameters requestParameters = null, CancellationToken ctx = default)
677-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_upgrade"), ctx, null, RequestParams(requestParameters));
678642
///<summary>POST on /_validate/query <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html</para></summary>
679643
///<param name = "body">The query definition specified with the Query DSL</param>
680644
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>

src/Nest/Descriptors.Indices.cs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -795,39 +795,6 @@ public GetIndexTemplateDescriptor(Names name): base(r => r.Optional("name", name
795795
public GetIndexTemplateDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
796796
}
797797

798-
///<summary>descriptor for UpgradeStatus <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
799-
public partial class UpgradeStatusDescriptor : RequestDescriptorBase<UpgradeStatusDescriptor, UpgradeStatusRequestParameters, IUpgradeStatusRequest>, IUpgradeStatusRequest
800-
{
801-
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesUpgradeStatus;
802-
///<summary>/_upgrade</summary>
803-
public UpgradeStatusDescriptor(): base()
804-
{
805-
}
806-
807-
///<summary>/{index}/_upgrade</summary>
808-
///<param name = "index">Optional, accepts null</param>
809-
public UpgradeStatusDescriptor(Indices index): base(r => r.Optional("index", index))
810-
{
811-
}
812-
813-
// values part of the url path
814-
Indices IUpgradeStatusRequest.Index => Self.RouteValues.Get<Indices>("index");
815-
///<summary>A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</summary>
816-
public UpgradeStatusDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
817-
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
818-
public UpgradeStatusDescriptor Index<TOther>()
819-
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
820-
///<summary>A shortcut into calling Index(Indices.All)</summary>
821-
public UpgradeStatusDescriptor AllIndices() => Index(Indices.All);
822-
// Request parameters
823-
///<summary>Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)</summary>
824-
public UpgradeStatusDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
825-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
826-
public UpgradeStatusDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
827-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
828-
public UpgradeStatusDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
829-
}
830-
831798
///<summary>descriptor for Open <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html</para></summary>
832799
public partial class OpenIndexDescriptor : RequestDescriptorBase<OpenIndexDescriptor, OpenIndexRequestParameters, IOpenIndexRequest>, IOpenIndexRequest
833800
{
@@ -1332,43 +1299,6 @@ public partial class BulkAliasDescriptor : RequestDescriptorBase<BulkAliasDescri
13321299
public BulkAliasDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
13331300
}
13341301

1335-
///<summary>descriptor for Upgrade <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html</para></summary>
1336-
public partial class UpgradeDescriptor : RequestDescriptorBase<UpgradeDescriptor, UpgradeRequestParameters, IUpgradeRequest>, IUpgradeRequest
1337-
{
1338-
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesUpgrade;
1339-
///<summary>/_upgrade</summary>
1340-
public UpgradeDescriptor(): base()
1341-
{
1342-
}
1343-
1344-
///<summary>/{index}/_upgrade</summary>
1345-
///<param name = "index">Optional, accepts null</param>
1346-
public UpgradeDescriptor(Indices index): base(r => r.Optional("index", index))
1347-
{
1348-
}
1349-
1350-
// values part of the url path
1351-
Indices IUpgradeRequest.Index => Self.RouteValues.Get<Indices>("index");
1352-
///<summary>A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</summary>
1353-
public UpgradeDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
1354-
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
1355-
public UpgradeDescriptor Index<TOther>()
1356-
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
1357-
///<summary>A shortcut into calling Index(Indices.All)</summary>
1358-
public UpgradeDescriptor AllIndices() => Index(Indices.All);
1359-
// Request parameters
1360-
///<summary>Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)</summary>
1361-
public UpgradeDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
1362-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
1363-
public UpgradeDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
1364-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
1365-
public UpgradeDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
1366-
///<summary>If true, only ancient (an older Lucene major release) segments will be upgraded</summary>
1367-
public UpgradeDescriptor OnlyAncientSegments(bool? onlyancientsegments = true) => Qs("only_ancient_segments", onlyancientsegments);
1368-
///<summary>Specify whether the request should block until the all segments are upgraded (default: false)</summary>
1369-
public UpgradeDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
1370-
}
1371-
13721302
///<summary>descriptor for ValidateQuery <para>http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html</para></summary>
13731303
public partial class ValidateQueryDescriptor<TDocument> : RequestDescriptorBase<ValidateQueryDescriptor<TDocument>, ValidateQueryRequestParameters, IValidateQueryRequest<TDocument>>, IValidateQueryRequest<TDocument>
13741304
{

0 commit comments

Comments
 (0)