Skip to content

Commit b501237

Browse files
authored
Add ILM APIs (#6206) (#6207)
(cherry picked from commit b17de24)
1 parent bb2c4d2 commit b501237

31 files changed

+2193
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ internal static class ApiUrlsLookups
4444
internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "/{index}/_doc/{id}" });
4545
internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "/{index}/_doc/{id}" });
4646
internal static ApiUrls GraphExplore = new ApiUrls(new[] { "/{index}/_graph/explore" });
47+
internal static ApiUrls IndexLifecycleManagementDeleteLifecycle = new ApiUrls(new[] { "/_ilm/policy/{policy}" });
48+
internal static ApiUrls IndexLifecycleManagementExplainLifecycle = new ApiUrls(new[] { "/{index}/_ilm/explain" });
49+
internal static ApiUrls IndexLifecycleManagementGetLifecycle = new ApiUrls(new[] { "/_ilm/policy/{policy}", "/_ilm/policy" });
50+
internal static ApiUrls IndexLifecycleManagementGetStatus = new ApiUrls(new[] { "/_ilm/status" });
51+
internal static ApiUrls IndexLifecycleManagementMigrateToDataTiers = new ApiUrls(new[] { "/_ilm/migrate_to_data_tiers" });
52+
internal static ApiUrls IndexLifecycleManagementMoveToStep = new ApiUrls(new[] { "/_ilm/move/{index}" });
53+
internal static ApiUrls IndexLifecycleManagementPutLifecycle = new ApiUrls(new[] { "/_ilm/policy/{policy}" });
54+
internal static ApiUrls IndexLifecycleManagementRemovePolicy = new ApiUrls(new[] { "/{index}/_ilm/remove" });
55+
internal static ApiUrls IndexLifecycleManagementRetry = new ApiUrls(new[] { "/{index}/_ilm/retry" });
56+
internal static ApiUrls IndexLifecycleManagementStart = new ApiUrls(new[] { "/_ilm/start" });
57+
internal static ApiUrls IndexLifecycleManagementStop = new ApiUrls(new[] { "/_ilm/stop" });
4758
internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "/{index}" });
4859
internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "/{index}" });
4960
internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "/_refresh", "/{index}/_refresh" });
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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.Ilm
27+
{
28+
public class IlmDeleteLifecycleRequestParameters : RequestParameters<IlmDeleteLifecycleRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
32+
33+
[JsonIgnore]
34+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
35+
}
36+
37+
public partial class IlmDeleteLifecycleRequest : PlainRequestBase<IlmDeleteLifecycleRequestParameters>
38+
{
39+
public IlmDeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Name policy) : base(r => r.Required("policy", policy))
40+
{
41+
}
42+
43+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementDeleteLifecycle;
44+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
45+
protected override bool SupportsBody => false;
46+
[JsonIgnore]
47+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
48+
49+
[JsonIgnore]
50+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
51+
}
52+
53+
public sealed partial class IlmDeleteLifecycleRequestDescriptor : RequestDescriptorBase<IlmDeleteLifecycleRequestDescriptor, IlmDeleteLifecycleRequestParameters>
54+
{
55+
internal IlmDeleteLifecycleRequestDescriptor(Action<IlmDeleteLifecycleRequestDescriptor> configure) => configure.Invoke(this);
56+
public IlmDeleteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policy) : base(r => r.Required("policy", policy))
57+
{
58+
}
59+
60+
internal IlmDeleteLifecycleRequestDescriptor()
61+
{
62+
}
63+
64+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementDeleteLifecycle;
65+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
66+
protected override bool SupportsBody => false;
67+
public IlmDeleteLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
68+
public IlmDeleteLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
69+
public IlmDeleteLifecycleRequestDescriptor Policy(Elastic.Clients.Elasticsearch.Name policy)
70+
{
71+
RouteValues.Required("policy", policy);
72+
return Self;
73+
}
74+
75+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
76+
{
77+
}
78+
}
79+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.Ilm
24+
{
25+
public partial class IlmDeleteLifecycleResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("acknowledged")]
29+
public bool Acknowledged { get; init; }
30+
}
31+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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.Ilm
27+
{
28+
public class IlmExplainLifecycleRequestParameters : RequestParameters<IlmExplainLifecycleRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public bool? OnlyErrors { get => Q<bool?>("only_errors"); set => Q("only_errors", value); }
32+
33+
[JsonIgnore]
34+
public bool? OnlyManaged { get => Q<bool?>("only_managed"); set => Q("only_managed", value); }
35+
36+
[JsonIgnore]
37+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
38+
39+
[JsonIgnore]
40+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
41+
}
42+
43+
public partial class IlmExplainLifecycleRequest : PlainRequestBase<IlmExplainLifecycleRequestParameters>
44+
{
45+
public IlmExplainLifecycleRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index))
46+
{
47+
}
48+
49+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementExplainLifecycle;
50+
protected override HttpMethod HttpMethod => HttpMethod.GET;
51+
protected override bool SupportsBody => false;
52+
[JsonIgnore]
53+
public bool? OnlyErrors { get => Q<bool?>("only_errors"); set => Q("only_errors", value); }
54+
55+
[JsonIgnore]
56+
public bool? OnlyManaged { get => Q<bool?>("only_managed"); set => Q("only_managed", value); }
57+
58+
[JsonIgnore]
59+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
60+
61+
[JsonIgnore]
62+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
63+
}
64+
65+
public sealed partial class IlmExplainLifecycleRequestDescriptor<TDocument> : RequestDescriptorBase<IlmExplainLifecycleRequestDescriptor<TDocument>, IlmExplainLifecycleRequestParameters>
66+
{
67+
internal IlmExplainLifecycleRequestDescriptor(Action<IlmExplainLifecycleRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
68+
public IlmExplainLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index))
69+
{
70+
}
71+
72+
public IlmExplainLifecycleRequestDescriptor(TDocument document) : this(typeof(TDocument))
73+
{
74+
}
75+
76+
internal IlmExplainLifecycleRequestDescriptor()
77+
{
78+
}
79+
80+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementExplainLifecycle;
81+
protected override HttpMethod HttpMethod => HttpMethod.GET;
82+
protected override bool SupportsBody => false;
83+
public IlmExplainLifecycleRequestDescriptor<TDocument> MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
84+
public IlmExplainLifecycleRequestDescriptor<TDocument> OnlyErrors(bool? onlyErrors = true) => Qs("only_errors", onlyErrors);
85+
public IlmExplainLifecycleRequestDescriptor<TDocument> OnlyManaged(bool? onlyManaged = true) => Qs("only_managed", onlyManaged);
86+
public IlmExplainLifecycleRequestDescriptor<TDocument> Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
87+
public IlmExplainLifecycleRequestDescriptor<TDocument> Index(Elastic.Clients.Elasticsearch.IndexName index)
88+
{
89+
RouteValues.Required("index", index);
90+
return Self;
91+
}
92+
93+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
94+
{
95+
}
96+
}
97+
98+
public sealed partial class IlmExplainLifecycleRequestDescriptor : RequestDescriptorBase<IlmExplainLifecycleRequestDescriptor, IlmExplainLifecycleRequestParameters>
99+
{
100+
internal IlmExplainLifecycleRequestDescriptor(Action<IlmExplainLifecycleRequestDescriptor> configure) => configure.Invoke(this);
101+
public IlmExplainLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index))
102+
{
103+
}
104+
105+
internal IlmExplainLifecycleRequestDescriptor()
106+
{
107+
}
108+
109+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementExplainLifecycle;
110+
protected override HttpMethod HttpMethod => HttpMethod.GET;
111+
protected override bool SupportsBody => false;
112+
public IlmExplainLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
113+
public IlmExplainLifecycleRequestDescriptor OnlyErrors(bool? onlyErrors = true) => Qs("only_errors", onlyErrors);
114+
public IlmExplainLifecycleRequestDescriptor OnlyManaged(bool? onlyManaged = true) => Qs("only_managed", onlyManaged);
115+
public IlmExplainLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
116+
public IlmExplainLifecycleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index)
117+
{
118+
RouteValues.Required("index", index);
119+
return Self;
120+
}
121+
122+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
123+
{
124+
}
125+
}
126+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.Ilm
24+
{
25+
public partial class IlmExplainLifecycleResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("indices")]
29+
public Elastic.Clients.Elasticsearch.Ilm.ExplainLifecycle.LifecycleExplains Indices { get; init; }
30+
}
31+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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.Ilm
27+
{
28+
public class IlmGetLifecycleRequestParameters : RequestParameters<IlmGetLifecycleRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
32+
33+
[JsonIgnore]
34+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
35+
}
36+
37+
public partial class IlmGetLifecycleRequest : PlainRequestBase<IlmGetLifecycleRequestParameters>
38+
{
39+
public IlmGetLifecycleRequest()
40+
{
41+
}
42+
43+
public IlmGetLifecycleRequest(Elastic.Clients.Elasticsearch.Name? policy) : base(r => r.Optional("policy", policy))
44+
{
45+
}
46+
47+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementGetLifecycle;
48+
protected override HttpMethod HttpMethod => HttpMethod.GET;
49+
protected override bool SupportsBody => false;
50+
[JsonIgnore]
51+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
52+
53+
[JsonIgnore]
54+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
55+
}
56+
57+
public sealed partial class IlmGetLifecycleRequestDescriptor : RequestDescriptorBase<IlmGetLifecycleRequestDescriptor, IlmGetLifecycleRequestParameters>
58+
{
59+
internal IlmGetLifecycleRequestDescriptor(Action<IlmGetLifecycleRequestDescriptor> configure) => configure.Invoke(this);
60+
public IlmGetLifecycleRequestDescriptor()
61+
{
62+
}
63+
64+
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementGetLifecycle;
65+
protected override HttpMethod HttpMethod => HttpMethod.GET;
66+
protected override bool SupportsBody => false;
67+
public IlmGetLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
68+
public IlmGetLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
69+
public IlmGetLifecycleRequestDescriptor Policy(Elastic.Clients.Elasticsearch.Name? policy)
70+
{
71+
RouteValues.Optional("policy", policy);
72+
return Self;
73+
}
74+
75+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
76+
{
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)