Skip to content

Commit 9e4f171

Browse files
Add various indices APIs (#6223) (#6224)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 2f74494 commit 9e4f171

40 files changed

+4175
-0
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,23 @@ internal static class ApiUrlsLookups
5555
internal static ApiUrls IndexLifecycleManagementRetry = new ApiUrls(new[] { "/{index}/_ilm/retry" });
5656
internal static ApiUrls IndexLifecycleManagementStart = new ApiUrls(new[] { "/_ilm/start" });
5757
internal static ApiUrls IndexLifecycleManagementStop = new ApiUrls(new[] { "/_ilm/stop" });
58+
internal static ApiUrls IndexManagementGetAlias = new ApiUrls(new[] { "/_alias", "/_alias/{name}", "/{index}/_alias/{name}", "/{index}/_alias" });
59+
internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "/{index}/_close" });
60+
internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "/_data_stream/{name}" });
61+
internal static ApiUrls IndexManagementGetDataStream = new ApiUrls(new[] { "/_data_stream", "/_data_stream/{name}" });
62+
internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "/{index}/_alias/{name}" });
63+
internal static ApiUrls IndexManagementDeleteDataStream = new ApiUrls(new[] { "/_data_stream/{name}" });
5864
internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "/{index}" });
65+
internal static ApiUrls IndexManagementExistsAlias = new ApiUrls(new[] { "/_alias/{name}", "/{index}/_alias/{name}" });
5966
internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "/{index}" });
67+
internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "/_data_stream/_migrate/{name}" });
68+
internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "/{index}/_open" });
69+
internal static ApiUrls IndexManagementPromoteDataStream = new ApiUrls(new[] { "/_data_stream/_promote/{name}" });
70+
internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "/{index}/_alias/{name}" });
6071
internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "/_refresh", "/{index}/_refresh" });
72+
internal static ApiUrls IndexManagementShrink = new ApiUrls(new[] { "/{index}/_shrink/{target}" });
73+
internal static ApiUrls IndexManagementSplit = new ApiUrls(new[] { "/{index}/_split/{target}" });
74+
internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "/_aliases" });
6175
internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[] { "/{index}/_doc/{id}", "/{index}/_doc" });
6276
internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "/_ingest/pipeline/{id}" });
6377
internal static ApiUrls IngestGeoIpStats = new ApiUrls(new[] { "/_ingest/geoip/stats" });
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.IndexManagement
27+
{
28+
public class AliasRequestParameters : RequestParameters<AliasRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
32+
33+
[JsonIgnore]
34+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
35+
36+
[JsonIgnore]
37+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
38+
39+
[JsonIgnore]
40+
public bool? Local { get => Q<bool?>("local"); set => Q("local", value); }
41+
}
42+
43+
public partial class AliasRequest : PlainRequestBase<AliasRequestParameters>
44+
{
45+
public AliasRequest()
46+
{
47+
}
48+
49+
public AliasRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name))
50+
{
51+
}
52+
53+
public AliasRequest(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name))
54+
{
55+
}
56+
57+
public AliasRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
58+
{
59+
}
60+
61+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementGetAlias;
62+
protected override HttpMethod HttpMethod => HttpMethod.GET;
63+
protected override bool SupportsBody => false;
64+
[JsonIgnore]
65+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
66+
67+
[JsonIgnore]
68+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
69+
70+
[JsonIgnore]
71+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
72+
73+
[JsonIgnore]
74+
public bool? Local { get => Q<bool?>("local"); set => Q("local", value); }
75+
}
76+
77+
public sealed partial class AliasRequestDescriptor<TDocument> : RequestDescriptorBase<AliasRequestDescriptor<TDocument>, AliasRequestParameters>
78+
{
79+
internal AliasRequestDescriptor(Action<AliasRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
80+
public AliasRequestDescriptor()
81+
{
82+
}
83+
84+
public AliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name))
85+
{
86+
}
87+
88+
public AliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
89+
{
90+
}
91+
92+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementGetAlias;
93+
protected override HttpMethod HttpMethod => HttpMethod.GET;
94+
protected override bool SupportsBody => false;
95+
public AliasRequestDescriptor<TDocument> AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
96+
public AliasRequestDescriptor<TDocument> ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
97+
public AliasRequestDescriptor<TDocument> IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
98+
public AliasRequestDescriptor<TDocument> Local(bool? local = true) => Qs("local", local);
99+
public AliasRequestDescriptor<TDocument> Name(Elastic.Clients.Elasticsearch.Names? name)
100+
{
101+
RouteValues.Optional("name", name);
102+
return Self;
103+
}
104+
105+
public AliasRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.Indices? indices)
106+
{
107+
RouteValues.Optional("index", indices);
108+
return Self;
109+
}
110+
111+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
112+
{
113+
}
114+
}
115+
116+
public sealed partial class AliasRequestDescriptor : RequestDescriptorBase<AliasRequestDescriptor, AliasRequestParameters>
117+
{
118+
internal AliasRequestDescriptor(Action<AliasRequestDescriptor> configure) => configure.Invoke(this);
119+
public AliasRequestDescriptor()
120+
{
121+
}
122+
123+
public AliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name))
124+
{
125+
}
126+
127+
public AliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
128+
{
129+
}
130+
131+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementGetAlias;
132+
protected override HttpMethod HttpMethod => HttpMethod.GET;
133+
protected override bool SupportsBody => false;
134+
public AliasRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
135+
public AliasRequestDescriptor ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
136+
public AliasRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
137+
public AliasRequestDescriptor Local(bool? local = true) => Qs("local", local);
138+
public AliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name)
139+
{
140+
RouteValues.Optional("name", name);
141+
return Self;
142+
}
143+
144+
public AliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices)
145+
{
146+
RouteValues.Optional("index", indices);
147+
return Self;
148+
}
149+
150+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
151+
{
152+
}
153+
}
154+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.IndexManagement
24+
{
25+
public partial class AliasResponse : ElasticsearchResponseBase
26+
{
27+
}
28+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.IndexManagement
27+
{
28+
public class CloseRequestParameters : RequestParameters<CloseRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
32+
33+
[JsonIgnore]
34+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
35+
36+
[JsonIgnore]
37+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
38+
39+
[JsonIgnore]
40+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
41+
42+
[JsonIgnore]
43+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
44+
45+
[JsonIgnore]
46+
public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q<Elastic.Clients.Elasticsearch.WaitForActiveShards?>("wait_for_active_shards"); set => Q("wait_for_active_shards", value); }
47+
}
48+
49+
public partial class CloseRequest : PlainRequestBase<CloseRequestParameters>
50+
{
51+
public CloseRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices))
52+
{
53+
}
54+
55+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementClose;
56+
protected override HttpMethod HttpMethod => HttpMethod.POST;
57+
protected override bool SupportsBody => false;
58+
[JsonIgnore]
59+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
60+
61+
[JsonIgnore]
62+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
63+
64+
[JsonIgnore]
65+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
66+
67+
[JsonIgnore]
68+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
69+
70+
[JsonIgnore]
71+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
72+
73+
[JsonIgnore]
74+
public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q<Elastic.Clients.Elasticsearch.WaitForActiveShards?>("wait_for_active_shards"); set => Q("wait_for_active_shards", value); }
75+
}
76+
77+
public sealed partial class CloseRequestDescriptor<TDocument> : RequestDescriptorBase<CloseRequestDescriptor<TDocument>, CloseRequestParameters>
78+
{
79+
internal CloseRequestDescriptor(Action<CloseRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
80+
public CloseRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices))
81+
{
82+
}
83+
84+
internal CloseRequestDescriptor()
85+
{
86+
}
87+
88+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementClose;
89+
protected override HttpMethod HttpMethod => HttpMethod.POST;
90+
protected override bool SupportsBody => false;
91+
public CloseRequestDescriptor<TDocument> AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
92+
public CloseRequestDescriptor<TDocument> ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
93+
public CloseRequestDescriptor<TDocument> IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
94+
public CloseRequestDescriptor<TDocument> MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
95+
public CloseRequestDescriptor<TDocument> Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
96+
public CloseRequestDescriptor<TDocument> WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards);
97+
public CloseRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.Indices indices)
98+
{
99+
RouteValues.Required("index", indices);
100+
return Self;
101+
}
102+
103+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
104+
{
105+
}
106+
}
107+
108+
public sealed partial class CloseRequestDescriptor : RequestDescriptorBase<CloseRequestDescriptor, CloseRequestParameters>
109+
{
110+
internal CloseRequestDescriptor(Action<CloseRequestDescriptor> configure) => configure.Invoke(this);
111+
public CloseRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices))
112+
{
113+
}
114+
115+
internal CloseRequestDescriptor()
116+
{
117+
}
118+
119+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexManagementClose;
120+
protected override HttpMethod HttpMethod => HttpMethod.POST;
121+
protected override bool SupportsBody => false;
122+
public CloseRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
123+
public CloseRequestDescriptor ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
124+
public CloseRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
125+
public CloseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
126+
public CloseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
127+
public CloseRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards);
128+
public CloseRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices)
129+
{
130+
RouteValues.Required("index", indices);
131+
return Self;
132+
}
133+
134+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
135+
{
136+
}
137+
}
138+
}

0 commit comments

Comments
 (0)