Skip to content

Commit f601b94

Browse files
authored
Regen and clean up after remove of freeze API (elastic#6040)
* Regen and cleanup after remove of freeze API * Fix license header
1 parent 0610f8e commit f601b94

24 files changed

+137
-307
lines changed

src/Nest/Descriptors.Cluster.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public ClusterHealthDescriptor Index<TOther>()
113113
public ClusterHealthDescriptor Local(bool? local = true) => Qs("local", local);
114114
///<summary>Explicit operation timeout for connection to master node</summary>
115115
public ClusterHealthDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
116+
///<summary>Whether to return HTTP 200 instead of 408 in case of a cluster health timeout from the server side</summary>
117+
public ClusterHealthDescriptor Return200ForClusterHealthTimeout(bool? return200forclusterhealthtimeout = true) => Qs("return_200_for_cluster_health_timeout", return200forclusterhealthtimeout);
116118
///<summary>Explicit operation timeout</summary>
117119
public ClusterHealthDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
118120
///<summary>Wait until the specified number of shards is active</summary>

src/Nest/Descriptors.Indices.cs

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public DeleteIndexDescriptor Index<TOther>()
338338
// Request parameters
339339
///<summary>Ignore if a wildcard expression resolves to no concrete indices (default: false)</summary>
340340
public DeleteIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
341-
///<summary>Whether wildcard expressions should get expanded to open or closed indices (default: open)</summary>
341+
///<summary>Whether wildcard expressions should get expanded to open, closed, or hidden indices</summary>
342342
public DeleteIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
343343
///<summary>Ignore unavailable indexes (default: false)</summary>
344344
public DeleteIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
@@ -633,46 +633,6 @@ public ForceMergeDescriptor Index<TOther>()
633633
public ForceMergeDescriptor OnlyExpungeDeletes(bool? onlyexpungedeletes = true) => Qs("only_expunge_deletes", onlyexpungedeletes);
634634
}
635635

636-
///<summary>Descriptor for Freeze <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</para></summary>
637-
public partial class FreezeIndexDescriptor : RequestDescriptorBase<FreezeIndexDescriptor, FreezeIndexRequestParameters, IFreezeIndexRequest>, IFreezeIndexRequest
638-
{
639-
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesFreeze;
640-
protected override HttpMethod HttpMethod => HttpMethod.POST;
641-
protected override bool SupportsBody => false;
642-
///<summary>/{index}/_freeze</summary>
643-
///<param name = "index">this parameter is required</param>
644-
public FreezeIndexDescriptor(IndexName index): base(r => r.Required("index", index))
645-
{
646-
}
647-
648-
///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
649-
[SerializationConstructor]
650-
protected FreezeIndexDescriptor(): base()
651-
{
652-
}
653-
654-
// values part of the url path
655-
IndexName IFreezeIndexRequest.Index => Self.RouteValues.Get<IndexName>("index");
656-
///<summary>The name of the index to freeze</summary>
657-
public FreezeIndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
658-
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
659-
public FreezeIndexDescriptor Index<TOther>()
660-
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
661-
// Request parameters
662-
///<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>
663-
public FreezeIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
664-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
665-
public FreezeIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
666-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
667-
public FreezeIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
668-
///<summary>Specify timeout for connection to master</summary>
669-
public FreezeIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
670-
///<summary>Explicit operation timeout</summary>
671-
public FreezeIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
672-
///<summary>Sets the number of active shards to wait for before the operation returns.</summary>
673-
public FreezeIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
674-
}
675-
676636
///<summary>Descriptor for Get <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html</para></summary>
677637
public partial class GetIndexDescriptor : RequestDescriptorBase<GetIndexDescriptor, GetIndexRequestParameters, IGetIndexRequest>, IGetIndexRequest
678638
{
@@ -1411,7 +1371,8 @@ public SegmentsDescriptor Index<TOther>()
14111371
public SegmentsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
14121372
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
14131373
public SegmentsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
1414-
///<summary>Includes detailed memory usage by Lucene.</summary>
1374+
///<summary>Includes detailed memory usage by Lucene.</summary>
1375+
[Obsolete("Scheduled to be removed in 8.0, Deprecated as of: 8.0.0, reason: lucene no longer keeps track of segment memory overhead as it is largely off-heap")]
14151376
public SegmentsDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose);
14161377
}
14171378

src/Nest/Descriptors.Ingest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ protected PutPipelineDescriptor(): base()
120120
// values part of the url path
121121
Id IPutPipelineRequest.Id => Self.RouteValues.Get<Id>("id");
122122
// Request parameters
123+
///<summary>Required version for optimistic concurrency control for pipeline updates</summary>
124+
public PutPipelineDescriptor IfVersion(int? ifversion) => Qs("if_version", ifversion);
123125
///<summary>Explicit operation timeout for connection to master node</summary>
124126
public PutPipelineDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
125127
///<summary>Explicit operation timeout</summary>

src/Nest/Descriptors.NoNamespace.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,24 +1161,25 @@ public partial class OpenPointInTimeDescriptor : RequestDescriptorBase<OpenPoint
11611161
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceOpenPointInTime;
11621162
protected override HttpMethod HttpMethod => HttpMethod.POST;
11631163
protected override bool SupportsBody => false;
1164-
///<summary>/_pit</summary>
1165-
public OpenPointInTimeDescriptor(): base()
1164+
///<summary>/{index}/_pit</summary>
1165+
///<param name = "index">this parameter is required</param>
1166+
public OpenPointInTimeDescriptor(Indices index): base(r => r.Required("index", index))
11661167
{
11671168
}
11681169

1169-
///<summary>/{index}/_pit</summary>
1170-
///<param name = "index">Optional, accepts null</param>
1171-
public OpenPointInTimeDescriptor(Indices index): base(r => r.Optional("index", index))
1170+
///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
1171+
[SerializationConstructor]
1172+
protected OpenPointInTimeDescriptor(): base()
11721173
{
11731174
}
11741175

11751176
// values part of the url path
11761177
Indices IOpenPointInTimeRequest.Index => Self.RouteValues.Get<Indices>("index");
11771178
///<summary>A comma-separated list of index names to open point in time; use the special string `_all` or Indices.All to perform the operation on all indices</summary>
1178-
public OpenPointInTimeDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
1179+
public OpenPointInTimeDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
11791180
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
11801181
public OpenPointInTimeDescriptor Index<TOther>()
1181-
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
1182+
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v));
11821183
///<summary>A shortcut into calling Index(Indices.All)</summary>
11831184
public OpenPointInTimeDescriptor AllIndices() => Index(Indices.All);
11841185
// Request parameters

src/Nest/Descriptors.Nodes.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public NodesHotThreadsDescriptor(NodeIds nodeId): base(r => r.Optional("node_id"
6262
public NodesHotThreadsDescriptor Interval(Time interval) => Qs("interval", interval);
6363
///<summary>Number of samples of thread stacktrace (default: 10)</summary>
6464
public NodesHotThreadsDescriptor Snapshots(long? snapshots) => Qs("snapshots", snapshots);
65+
///<summary>The sort order for 'cpu' type (default: total)</summary>
66+
public NodesHotThreadsDescriptor Sort(Sort? sort) => Qs("sort", sort);
6567
///<summary>The type to sample (default: cpu)</summary>
6668
public NodesHotThreadsDescriptor ThreadType(ThreadType? threadtype) => Qs("type", threadtype);
6769
///<summary>Specify the number of threads to provide information for (default: 3)</summary>
@@ -105,7 +107,7 @@ public NodesInfoDescriptor(NodeIds nodeId, Metrics metric): base(r => r.Optional
105107
Metrics INodesInfoRequest.Metric => Self.RouteValues.Get<Metrics>("metric");
106108
///<summary>A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes</summary>
107109
public NodesInfoDescriptor NodeId(NodeIds nodeId) => Assign(nodeId, (a, v) => a.RouteValues.Optional("node_id", v));
108-
///<summary>A comma-separated list of metrics you wish returned. Leave empty to return all.</summary>
110+
///<summary>A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics.</summary>
109111
public NodesInfoDescriptor Metric(Metrics metric) => Assign(metric, (a, v) => a.RouteValues.Optional("metric", v));
110112
// Request parameters
111113
///<summary>Return settings in flat format (default: false)</summary>

src/Nest/Descriptors.Sql.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// ReSharper disable RedundantNameQualifier
3535
namespace Nest
3636
{
37-
///<summary>Descriptor for ClearCursor <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html</para></summary>
37+
///<summary>Descriptor for ClearCursor <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html</para></summary>
3838
public partial class ClearSqlCursorDescriptor : RequestDescriptorBase<ClearSqlCursorDescriptor, ClearSqlCursorRequestParameters, IClearSqlCursorRequest>, IClearSqlCursorRequest
3939
{
4040
internal override ApiUrls ApiUrls => ApiUrlsLookups.SqlClearCursor;
@@ -121,7 +121,7 @@ protected SqlSearchStatusDescriptor(): base()
121121
// Request parameters
122122
}
123123

124-
///<summary>Descriptor for Query <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html</para></summary>
124+
///<summary>Descriptor for Query <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html</para></summary>
125125
public partial class QuerySqlDescriptor : RequestDescriptorBase<QuerySqlDescriptor, QuerySqlRequestParameters, IQuerySqlRequest>, IQuerySqlRequest
126126
{
127127
internal override ApiUrls ApiUrls => ApiUrlsLookups.SqlQuery;
@@ -133,7 +133,7 @@ public partial class QuerySqlDescriptor : RequestDescriptorBase<QuerySqlDescript
133133
public QuerySqlDescriptor Format(string format) => Qs("format", format);
134134
}
135135

136-
///<summary>Descriptor for Translate <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html</para></summary>
136+
///<summary>Descriptor for Translate <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html</para></summary>
137137
public partial class TranslateSqlDescriptor : RequestDescriptorBase<TranslateSqlDescriptor, TranslateSqlRequestParameters, ITranslateSqlRequest>, ITranslateSqlRequest
138138
{
139139
internal override ApiUrls ApiUrls => ApiUrlsLookups.SqlTranslate;

src/Nest/Descriptors.Transform.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,21 @@ public partial class PreviewTransformDescriptor<TDocument> : RequestDescriptorBa
126126
internal override ApiUrls ApiUrls => ApiUrlsLookups.TransformPreview;
127127
protected override HttpMethod HttpMethod => HttpMethod.POST;
128128
protected override bool SupportsBody => true;
129-
// values part of the url path
129+
///<summary>/_transform/{transform_id}/_preview</summary>
130+
///<param name = "transformId">Optional, accepts null</param>
131+
public PreviewTransformDescriptor(Id transformId): base(r => r.Optional("transform_id", transformId))
132+
{
133+
}
134+
135+
///<summary>/_transform/_preview</summary>
136+
public PreviewTransformDescriptor(): base()
137+
{
138+
}
139+
140+
// values part of the url path
141+
Id IPreviewTransformRequest.TransformId => Self.RouteValues.Get<Id>("transform_id");
142+
///<summary>The id of the transform to preview.</summary>
143+
public PreviewTransformDescriptor<TDocument> TransformId(Id transformId) => Assign(transformId, (a, v) => a.RouteValues.Optional("transform_id", v));
130144
// Request parameters
131145
}
132146

src/Nest/ElasticClient.Indices.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -448,30 +448,6 @@ internal IndicesNamespace(ElasticClient client): base(client)
448448
/// </summary>
449449
public Task<ForceMergeResponse> ForceMergeAsync(IForceMergeRequest request, CancellationToken ct = default) => DoRequestAsync<IForceMergeRequest, ForceMergeResponse>(request, request.RequestParameters, ct);
450450
/// <summary>
451-
/// <c>POST</c> request to the <c>indices.freeze</c> API, read more about this API online:
452-
/// <para></para>
453-
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</a>
454-
/// </summary>
455-
public FreezeIndexResponse Freeze(IndexName index, Func<FreezeIndexDescriptor, IFreezeIndexRequest> selector = null) => Freeze(selector.InvokeOrDefault(new FreezeIndexDescriptor(index: index)));
456-
/// <summary>
457-
/// <c>POST</c> request to the <c>indices.freeze</c> API, read more about this API online:
458-
/// <para></para>
459-
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</a>
460-
/// </summary>
461-
public Task<FreezeIndexResponse> FreezeAsync(IndexName index, Func<FreezeIndexDescriptor, IFreezeIndexRequest> selector = null, CancellationToken ct = default) => FreezeAsync(selector.InvokeOrDefault(new FreezeIndexDescriptor(index: index)), ct);
462-
/// <summary>
463-
/// <c>POST</c> request to the <c>indices.freeze</c> API, read more about this API online:
464-
/// <para></para>
465-
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</a>
466-
/// </summary>
467-
public FreezeIndexResponse Freeze(IFreezeIndexRequest request) => DoRequest<IFreezeIndexRequest, FreezeIndexResponse>(request, request.RequestParameters);
468-
/// <summary>
469-
/// <c>POST</c> request to the <c>indices.freeze</c> API, read more about this API online:
470-
/// <para></para>
471-
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</a>
472-
/// </summary>
473-
public Task<FreezeIndexResponse> FreezeAsync(IFreezeIndexRequest request, CancellationToken ct = default) => DoRequestAsync<IFreezeIndexRequest, FreezeIndexResponse>(request, request.RequestParameters, ct);
474-
/// <summary>
475451
/// <c>GET</c> request to the <c>indices.get</c> API, read more about this API online:
476452
/// <para></para>
477453
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html">https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html</a>

src/Nest/ElasticClient.NoNamespace.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,13 @@ public Task<IndexResponse> IndexAsync<TDocument>(IIndexRequest<TDocument> reques
814814
/// <para></para>
815815
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html</a>
816816
/// </summary>
817-
public OpenPointInTimeResponse OpenPointInTime(Indices index = null, Func<OpenPointInTimeDescriptor, IOpenPointInTimeRequest> selector = null) => OpenPointInTime(selector.InvokeOrDefault(new OpenPointInTimeDescriptor().Index(index: index)));
817+
public OpenPointInTimeResponse OpenPointInTime(Indices index, Func<OpenPointInTimeDescriptor, IOpenPointInTimeRequest> selector = null) => OpenPointInTime(selector.InvokeOrDefault(new OpenPointInTimeDescriptor(index: index)));
818818
/// <summary>
819819
/// <c>POST</c> request to the <c>open_point_in_time</c> API, read more about this API online:
820820
/// <para></para>
821821
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html">https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html</a>
822822
/// </summary>
823-
public Task<OpenPointInTimeResponse> OpenPointInTimeAsync(Indices index = null, Func<OpenPointInTimeDescriptor, IOpenPointInTimeRequest> selector = null, CancellationToken ct = default) => OpenPointInTimeAsync(selector.InvokeOrDefault(new OpenPointInTimeDescriptor().Index(index: index)), ct);
823+
public Task<OpenPointInTimeResponse> OpenPointInTimeAsync(Indices index, Func<OpenPointInTimeDescriptor, IOpenPointInTimeRequest> selector = null, CancellationToken ct = default) => OpenPointInTimeAsync(selector.InvokeOrDefault(new OpenPointInTimeDescriptor(index: index)), ct);
824824
/// <summary>
825825
/// <c>POST</c> request to the <c>open_point_in_time</c> API, read more about this API online:
826826
/// <para></para>

0 commit comments

Comments
 (0)