diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj
index 9d3eb5100b0..9f7547b9d65 100644
--- a/src/ApiGenerator/ApiGenerator.csproj
+++ b/src/ApiGenerator/ApiGenerator.csproj
@@ -8,6 +8,11 @@
CS1591;NU1701
true
+
+
+
+
+
@@ -21,6 +26,5 @@
-
\ No newline at end of file
diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs
index 3f8301a5644..d2b564d0091 100644
--- a/src/ApiGenerator/Configuration/CodeConfiguration.cs
+++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs
@@ -45,14 +45,8 @@ public static class CodeConfiguration
"autoscaling.put_autoscaling_policy.json", // experimental
"autoscaling.delete_autoscaling_policy.json", // experimental
-
- "indices.delete_index_template.json",
- "indices.exists_index_template.json",
- "indices.get_index_template.json",
- "indices.put_index_template.json",
"indices.simulate_index_template.json",
"indices.simulate_template.json",
-
"searchable_snapshots.stats.json",
"searchable_snapshots.clear_cache.json",
"searchable_snapshots.mount.json",
@@ -89,7 +83,8 @@ public static class CodeConfiguration
{
{ "indices.delete_index_template", "DeleteIndexTemplateV2" },
{ "indices.get_index_template", "GetIndexTemplateV2" },
- { "indices.put_index_template", "PutIndexTemplateV2" }
+ { "indices.put_index_template", "PutIndexTemplateV2" },
+ { "indices.exists_index_template", "IndexTemplateV2Exists" }
};
///
diff --git a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs
index e5660bc39b8..1957282af6e 100644
--- a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs
+++ b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs
@@ -521,8 +521,8 @@ public bool? Local
}
}
- ///Request options for ExistsTemplate https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
- public class ExistsIndexTemplateRequestParameters : RequestParameters
+ ///Request options for TemplateV2Exists https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public class IndexTemplateV2ExistsRequestParameters : RequestParameters
{
public override HttpMethod DefaultHttpMethod => HttpMethod.HEAD;
public override bool SupportsBody => false;
diff --git a/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs b/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs
index d69516d1d51..777e7e45249 100644
--- a/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs
+++ b/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs
@@ -281,13 +281,13 @@ public Task AliasExistsAsync(string index, string name, Al
///HEAD on /_index_template/{name} https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
///The name of the template
///Request specific configuration such as querystring parameters & request specific connection settings.
- public TResponse ExistsTemplateForAll(string name, ExistsIndexTemplateRequestParameters requestParameters = null)
+ public TResponse TemplateV2ExistsForAll(string name, IndexTemplateV2ExistsRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest(HEAD, Url($"_index_template/{name:name}"), null, RequestParams(requestParameters));
///HEAD on /_index_template/{name} https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
///The name of the template
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("indices.exists_index_template", "name")]
- public Task ExistsTemplateForAllAsync(string name, ExistsIndexTemplateRequestParameters requestParameters = null, CancellationToken ctx = default)
+ public Task TemplateV2ExistsForAllAsync(string name, IndexTemplateV2ExistsRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync(HEAD, Url($"_index_template/{name:name}"), ctx, null, RequestParams(requestParameters));
///HEAD on /_template/{name} https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
///The comma separated names of the index templates
diff --git a/src/Nest/Descriptors.Indices.cs b/src/Nest/Descriptors.Indices.cs
index f565d19e512..9f5d244299e 100644
--- a/src/Nest/Descriptors.Indices.cs
+++ b/src/Nest/Descriptors.Indices.cs
@@ -388,6 +388,31 @@ protected DeleteDataStreamDescriptor(): base()
public DeleteDataStreamDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
}
+ ///Descriptor for DeleteTemplateV2 https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public partial class DeleteIndexTemplateV2Descriptor : RequestDescriptorBase, IDeleteIndexTemplateV2Request
+ {
+ internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesDeleteTemplateV2;
+ ////_index_template/{name}
+ ///this parameter is required
+ public DeleteIndexTemplateV2Descriptor(Name name): base(r => r.Required("name", name))
+ {
+ }
+
+ ///Used for serialization purposes, making sure we have a parameterless constructor
+ [SerializationConstructor]
+ protected DeleteIndexTemplateV2Descriptor(): base()
+ {
+ }
+
+ // values part of the url path
+ Name IDeleteIndexTemplateV2Request.Name => Self.RouteValues.Get("name");
+ // Request parameters
+ ///Specify timeout for connection to master
+ public DeleteIndexTemplateV2Descriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
+ ///Explicit operation timeout
+ public DeleteIndexTemplateV2Descriptor Timeout(Time timeout) => Qs("timeout", timeout);
+ }
+
///Descriptor for DeleteTemplate https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
public partial class DeleteIndexTemplateDescriptor : RequestDescriptorBase, IDeleteIndexTemplateRequest
{
@@ -497,6 +522,33 @@ public AliasExistsDescriptor Index()
public AliasExistsDescriptor Local(bool? local = true) => Qs("local", local);
}
+ ///Descriptor for TemplateV2Exists https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public partial class IndexTemplateV2ExistsDescriptor : RequestDescriptorBase, IIndexTemplateV2ExistsRequest
+ {
+ internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesTemplateV2Exists;
+ ////_index_template/{name}
+ ///this parameter is required
+ public IndexTemplateV2ExistsDescriptor(Name name): base(r => r.Required("name", name))
+ {
+ }
+
+ ///Used for serialization purposes, making sure we have a parameterless constructor
+ [SerializationConstructor]
+ protected IndexTemplateV2ExistsDescriptor(): base()
+ {
+ }
+
+ // values part of the url path
+ Name IIndexTemplateV2ExistsRequest.Name => Self.RouteValues.Get("name");
+ // Request parameters
+ ///Return settings in flat format (default: false)
+ public IndexTemplateV2ExistsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings);
+ ///Return local information, do not retrieve the state from master node (default: false)
+ public IndexTemplateV2ExistsDescriptor Local(bool? local = true) => Qs("local", local);
+ ///Explicit operation timeout for connection to master node
+ public IndexTemplateV2ExistsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
+ }
+
///Descriptor for TemplateExists https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
public partial class IndexTemplateExistsDescriptor : RequestDescriptorBase, IIndexTemplateExistsRequest
{
@@ -876,6 +928,34 @@ public GetFieldMappingDescriptor Index()
public GetFieldMappingDescriptor Local(bool? local = true) => Qs("local", local);
}
+ ///Descriptor for GetTemplateV2 https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public partial class GetIndexTemplateV2Descriptor : RequestDescriptorBase, IGetIndexTemplateV2Request
+ {
+ internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetTemplateV2;
+ ////_index_template
+ public GetIndexTemplateV2Descriptor(): base()
+ {
+ }
+
+ ////_index_template/{name}
+ ///Optional, accepts null
+ public GetIndexTemplateV2Descriptor(Name name): base(r => r.Optional("name", name))
+ {
+ }
+
+ // values part of the url path
+ Name IGetIndexTemplateV2Request.Name => Self.RouteValues.Get("name");
+ ///A pattern that returned template names must match
+ public GetIndexTemplateV2Descriptor Name(Name name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v));
+ // Request parameters
+ ///Return settings in flat format (default: false)
+ public GetIndexTemplateV2Descriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings);
+ ///Return local information, do not retrieve the state from master node (default: false)
+ public GetIndexTemplateV2Descriptor Local(bool? local = true) => Qs("local", local);
+ ///Explicit operation timeout for connection to master node
+ public GetIndexTemplateV2Descriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
+ }
+
///Descriptor for GetMapping https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
public partial class GetMappingDescriptor : RequestDescriptorBase, GetMappingRequestParameters, IGetMappingRequest>, IGetMappingRequest
{
@@ -1119,6 +1199,33 @@ public PutAliasDescriptor Index()
public PutAliasDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}
+ ///Descriptor for PutTemplateV2 https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public partial class PutIndexTemplateV2Descriptor : RequestDescriptorBase, IPutIndexTemplateV2Request
+ {
+ internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesPutTemplateV2;
+ ////_index_template/{name}
+ ///this parameter is required
+ public PutIndexTemplateV2Descriptor(Name name): base(r => r.Required("name", name))
+ {
+ }
+
+ ///Used for serialization purposes, making sure we have a parameterless constructor
+ [SerializationConstructor]
+ protected PutIndexTemplateV2Descriptor(): base()
+ {
+ }
+
+ // values part of the url path
+ Name IPutIndexTemplateV2Request.Name => Self.RouteValues.Get("name");
+ // Request parameters
+ ///User defined reason for creating/updating the index template
+ public PutIndexTemplateV2Descriptor Cause(string cause) => Qs("cause", cause);
+ ///Whether the index template should only be added if new or can also replace an existing one
+ public PutIndexTemplateV2Descriptor Create(bool? create = true) => Qs("create", create);
+ ///Specify timeout for connection to master
+ public PutIndexTemplateV2Descriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
+ }
+
///Descriptor for PutMapping https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
public partial class PutMappingDescriptor : RequestDescriptorBase, PutMappingRequestParameters, IPutMappingRequest>, IPutMappingRequest
{
diff --git a/src/Nest/ElasticClient.Indices.cs b/src/Nest/ElasticClient.Indices.cs
index 061da411c05..bc4b986d4d8 100644
--- a/src/Nest/ElasticClient.Indices.cs
+++ b/src/Nest/ElasticClient.Indices.cs
@@ -304,6 +304,30 @@ internal IndicesNamespace(ElasticClient client): base(client)
///
public Task DeleteDataStreamAsync(IDeleteDataStreamRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
///
+ /// DELETE request to the indices.delete_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public DeleteIndexTemplateV2Response DeleteTemplateV2(Name name, Func selector = null) => DeleteTemplateV2(selector.InvokeOrDefault(new DeleteIndexTemplateV2Descriptor(name: name)));
+ ///
+ /// DELETE request to the indices.delete_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task DeleteTemplateV2Async(Name name, Func selector = null, CancellationToken ct = default) => DeleteTemplateV2Async(selector.InvokeOrDefault(new DeleteIndexTemplateV2Descriptor(name: name)), ct);
+ ///
+ /// DELETE request to the indices.delete_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public DeleteIndexTemplateV2Response DeleteTemplateV2(IDeleteIndexTemplateV2Request request) => DoRequest(request, request.RequestParameters);
+ ///
+ /// DELETE request to the indices.delete_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task DeleteTemplateV2Async(IDeleteIndexTemplateV2Request request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
+ ///
/// DELETE request to the indices.delete_template API, read more about this API online:
///
/// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
@@ -376,6 +400,30 @@ internal IndicesNamespace(ElasticClient client): base(client)
///
public Task AliasExistsAsync(IAliasExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
///
+ /// HEAD request to the indices.exists_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public ExistsResponse TemplateV2Exists(Name name, Func selector = null) => TemplateV2Exists(selector.InvokeOrDefault(new IndexTemplateV2ExistsDescriptor(name: name)));
+ ///
+ /// HEAD request to the indices.exists_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task TemplateV2ExistsAsync(Name name, Func selector = null, CancellationToken ct = default) => TemplateV2ExistsAsync(selector.InvokeOrDefault(new IndexTemplateV2ExistsDescriptor(name: name)), ct);
+ ///
+ /// HEAD request to the indices.exists_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public ExistsResponse TemplateV2Exists(IIndexTemplateV2ExistsRequest request) => DoRequest(request, request.RequestParameters);
+ ///
+ /// HEAD request to the indices.exists_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task TemplateV2ExistsAsync(IIndexTemplateV2ExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
+ ///
/// HEAD request to the indices.exists_template API, read more about this API online:
///
/// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
@@ -618,6 +666,30 @@ public Task GetFieldMappingAsync(Fields fiel
///
public Task GetFieldMappingAsync(IGetFieldMappingRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
///
+ /// GET request to the indices.get_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public GetIndexTemplateV2Response GetTemplateV2(Name name = null, Func selector = null) => GetTemplateV2(selector.InvokeOrDefault(new GetIndexTemplateV2Descriptor().Name(name: name)));
+ ///
+ /// GET request to the indices.get_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task GetTemplateV2Async(Name name = null, Func selector = null, CancellationToken ct = default) => GetTemplateV2Async(selector.InvokeOrDefault(new GetIndexTemplateV2Descriptor().Name(name: name)), ct);
+ ///
+ /// GET request to the indices.get_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public GetIndexTemplateV2Response GetTemplateV2(IGetIndexTemplateV2Request request) => DoRequest(request, request.RequestParameters);
+ ///
+ /// GET request to the indices.get_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task GetTemplateV2Async(IGetIndexTemplateV2Request request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
+ ///
/// GET request to the indices.get_mapping API, read more about this API online:
///
/// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
@@ -788,6 +860,30 @@ public Task GetMappingAsync(Func
public Task PutAliasAsync(IPutAliasRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
///
+ /// PUT request to the indices.put_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public PutIndexTemplateV2Response PutTemplateV2(Name name, Func selector) => PutTemplateV2(selector.InvokeOrDefault(new PutIndexTemplateV2Descriptor(name: name)));
+ ///
+ /// PUT request to the indices.put_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task PutTemplateV2Async(Name name, Func selector, CancellationToken ct = default) => PutTemplateV2Async(selector.InvokeOrDefault(new PutIndexTemplateV2Descriptor(name: name)), ct);
+ ///
+ /// PUT request to the indices.put_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public PutIndexTemplateV2Response PutTemplateV2(IPutIndexTemplateV2Request request) => DoRequest(request, request.RequestParameters);
+ ///
+ /// PUT request to the indices.put_index_template API, read more about this API online:
+ ///
+ /// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ ///
+ public Task PutTemplateV2Async(IPutIndexTemplateV2Request request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct);
+ ///
/// PUT request to the indices.put_mapping API, read more about this API online:
///
/// https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
diff --git a/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Request.cs b/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Request.cs
new file mode 100644
index 00000000000..de436eef7c8
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Request.cs
@@ -0,0 +1,13 @@
+// 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
+{
+ [MapsApi("indices.delete_index_template.json")]
+ public partial interface IDeleteIndexTemplateV2Request { }
+
+ public partial class DeleteIndexTemplateV2Request { }
+
+ public partial class DeleteIndexTemplateV2Descriptor { }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Response.cs b/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Response.cs
new file mode 100644
index 00000000000..8f9960fde17
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/DeleteIndexTemplate/DeleteIndexTemplateV2Response.cs
@@ -0,0 +1,8 @@
+// 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 DeleteIndexTemplateV2Response : AcknowledgedResponseBase { }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Request.cs b/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Request.cs
new file mode 100644
index 00000000000..6e99b914c59
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Request.cs
@@ -0,0 +1,13 @@
+// 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
+{
+ [MapsApi("indices.get_index_template.json")]
+ public partial interface IGetIndexTemplateV2Request { }
+
+ public partial class GetIndexTemplateV2Request { }
+
+ public partial class GetIndexTemplateV2Descriptor { }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Response.cs b/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Response.cs
new file mode 100644
index 00000000000..b4010671069
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/GetIndexTemplate/GetIndexTemplateV2Response.cs
@@ -0,0 +1,54 @@
+// 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.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace Nest
+{
+ [DataContract]
+ public class GetIndexTemplateV2Response : ResponseBase
+ {
+ [DataMember(Name = "index_templates")]
+ public IReadOnlyCollection IndexTemplates { get; set; }
+ }
+
+ [DataContract]
+ public class IndexTemplateItem
+ {
+ [DataMember(Name = "name")]
+ public string Name { get; set; }
+
+ [DataMember(Name = "index_template")]
+ public IndexTemplate IndexTemplate { get; set; }
+ }
+
+ [DataContract]
+ public class IndexTemplate
+ {
+ [DataMember(Name = "index_patterns")]
+ public IEnumerable IndexPatterns { get; set; }
+
+ [DataMember(Name = "composed_of")]
+ public IEnumerable ComposedOf { get; set; }
+
+ [DataMember(Name = "template")]
+ public ITemplate Template { get; set; }
+
+ [DataMember(Name = "data_stream")]
+ public DataStream DataStream { get; set; }
+
+ [DataMember(Name = "priority")]
+ public int? Priority { get; set; }
+
+ [DataMember(Name = "version")]
+ public long? Version { get; set; }
+
+ [DataMember(Name = "_meta")]
+ public IDictionary Meta { get; set; }
+
+ [DataMember(Name = "allow_auto_create")]
+ public bool? AllowAutoCreate { get; set; }
+ }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsRequest.cs b/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsRequest.cs
new file mode 100644
index 00000000000..ae7dd52cbac
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsRequest.cs
@@ -0,0 +1,13 @@
+// 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
+{
+ [MapsApi("indices.exists_index_template.json")]
+ public partial interface IIndexTemplateV2ExistsRequest { }
+
+ public partial class IndexTemplateV2ExistsRequest { }
+
+ public partial class IndexTemplateV2ExistsDescriptor { }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsResponse.cs b/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsResponse.cs
new file mode 100644
index 00000000000..320d01c4243
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/IndexTemplateExists/IndexTemplateV2ExistsResponse.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 IndexTemplateV2ExistsResponse : ExistsResponse
+ {
+ }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Request.cs b/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Request.cs
new file mode 100644
index 00000000000..ed53d4cc9a1
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Request.cs
@@ -0,0 +1,96 @@
+// 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;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+
+namespace Nest
+{
+ [MapsApi("indices.put_index_template.json")]
+ public partial interface IPutIndexTemplateV2Request
+ {
+ [DataMember(Name = "index_patterns")]
+ IEnumerable IndexPatterns { get; set; }
+
+ [DataMember(Name = "composed_of")]
+ IEnumerable ComposedOf { get; set; }
+
+ [DataMember(Name = "template")]
+ ITemplate Template { get; set; }
+
+ [DataMember(Name = "data_stream")]
+ DataStream DataStream { get; set; }
+
+ [DataMember(Name = "priority")]
+ int? Priority { get; set; }
+
+ [DataMember(Name = "version")]
+ long? Version { get; set; }
+
+ ///
+ /// Optional user metadata about the component template. May have any contents.
+ /// This map is not automatically generated by Elasticsearch.
+ ///
+ [DataMember(Name = "_meta")]
+ IDictionary Meta { get; set; }
+ }
+
+ public partial class PutIndexTemplateV2Request
+ {
+ public IEnumerable IndexPatterns { get; set; }
+
+ public IEnumerable ComposedOf { get; set; }
+
+ public ITemplate Template { get; set; }
+
+ public DataStream DataStream { get; set; }
+
+ public int? Priority { get; set; }
+
+ public long? Version { get; set; }
+
+ ///
+ public IDictionary Meta { get; set; }
+ }
+
+ public partial class PutIndexTemplateV2Descriptor
+ {
+ IEnumerable IPutIndexTemplateV2Request.IndexPatterns { get; set; }
+ IEnumerable IPutIndexTemplateV2Request.ComposedOf { get; set; }
+ ITemplate IPutIndexTemplateV2Request.Template { get; set; }
+ DataStream IPutIndexTemplateV2Request.DataStream { get; set; }
+ int? IPutIndexTemplateV2Request.Priority { get; set; }
+ long? IPutIndexTemplateV2Request.Version { get; set; }
+ IDictionary IPutIndexTemplateV2Request.Meta { get; set; }
+
+ public PutIndexTemplateV2Descriptor IndexPatterns(params string[] patterns) => Assign(patterns, (a, v) => a.IndexPatterns = v);
+
+ public PutIndexTemplateV2Descriptor IndexPatterns(IEnumerable patterns) => Assign(patterns?.ToArray(), (a, v) => a.IndexPatterns = v);
+
+ public PutIndexTemplateV2Descriptor ComposedOf(params string[] composedOf) => Assign(composedOf, (a, v) => a.ComposedOf = v);
+
+ public PutIndexTemplateV2Descriptor ComposedOf(IEnumerable composedOf) => Assign(composedOf?.ToArray(), (a, v) => a.ComposedOf = v);
+
+ public PutIndexTemplateV2Descriptor Template(Func selector) =>
+ Assign(selector?.Invoke(new TemplateDescriptor()), (a, v) => a.Template = v);
+
+ public PutIndexTemplateV2Descriptor DataStream(DataStream dataStream) => Assign(dataStream, (a, v) => a.DataStream = v);
+
+ public PutIndexTemplateV2Descriptor Priority(int? priority) => Assign(priority, (a, v) => a.Priority = v);
+
+ public PutIndexTemplateV2Descriptor Version(long? version) => Assign(version, (a, v) => a.Version = v);
+
+ ///
+ public PutIndexTemplateV2Descriptor Meta(Func, FluentDictionary> selector) =>
+ Assign(selector, (a, v) => a.Meta = v?.Invoke(new FluentDictionary()));
+ }
+
+ public class DataStream
+ {
+ [DataMember(Name = "hidden")]
+ public bool? Hidden { get; set; }
+ }
+}
diff --git a/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Response.cs b/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Response.cs
new file mode 100644
index 00000000000..2d4a36d75ad
--- /dev/null
+++ b/src/Nest/Indices/IndexTemplatesV2/PutIndexTemplate/PutIndexTemplateV2Response.cs
@@ -0,0 +1,8 @@
+// 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 PutIndexTemplateV2Response : AcknowledgedResponseBase { }
+}
diff --git a/src/Nest/Requests.Indices.cs b/src/Nest/Requests.Indices.cs
index 01915c71715..42570a7f188 100644
--- a/src/Nest/Requests.Indices.cs
+++ b/src/Nest/Requests.Indices.cs
@@ -656,6 +656,52 @@ public ExpandWildcards? ExpandWildcards
}
}
+ [InterfaceDataContract]
+ public partial interface IDeleteIndexTemplateV2Request : IRequest
+ {
+ [IgnoreDataMember]
+ Name Name
+ {
+ get;
+ }
+ }
+
+ ///Request for DeleteTemplateV2 https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+ public partial class DeleteIndexTemplateV2Request : PlainRequestBase, IDeleteIndexTemplateV2Request
+ {
+ protected IDeleteIndexTemplateV2Request Self => this;
+ internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesDeleteTemplateV2;
+ ////_index_template/{name}
+ ///this parameter is required
+ public DeleteIndexTemplateV2Request(Name name): base(r => r.Required("name", name))
+ {
+ }
+
+ ///Used for serialization purposes, making sure we have a parameterless constructor
+ [SerializationConstructor]
+ protected DeleteIndexTemplateV2Request(): base()
+ {
+ }
+
+ // values part of the url path
+ [IgnoreDataMember]
+ Name IDeleteIndexTemplateV2Request.Name => Self.RouteValues.Get("name");
+ // Request parameters
+ ///Specify timeout for connection to master
+ public Time MasterTimeout
+ {
+ get => Q