Skip to content

Commit 29cb942

Browse files
Add SLM APIs (#6217) (#6218)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 4195ba0 commit 29cb942

23 files changed

+1541
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ internal static class ApiUrlsLookups
7171
internal static ApiUrls SearchableSnapshotsMount = new ApiUrls(new[] { "/_snapshot/{repository}/{snapshot}/_mount" });
7272
internal static ApiUrls SearchableSnapshotsStats = new ApiUrls(new[] { "/_searchable_snapshots/stats", "/{index}/_searchable_snapshots/stats" });
7373
internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[] { "/_search", "/{index}/_search" });
74+
internal static ApiUrls SnapshotLifecycleManagementDeleteLifecycle = new ApiUrls(new[] { "/_slm/policy/{policy_id}" });
75+
internal static ApiUrls SnapshotLifecycleManagementExecuteLifecycle = new ApiUrls(new[] { "/_slm/policy/{policy_id}/_execute" });
76+
internal static ApiUrls SnapshotLifecycleManagementExecuteRetention = new ApiUrls(new[] { "/_slm/_execute_retention" });
77+
internal static ApiUrls SnapshotLifecycleManagementGetLifecycle = new ApiUrls(new[] { "/_slm/policy/{policy_id}", "/_slm/policy" });
78+
internal static ApiUrls SnapshotLifecycleManagementGetStats = new ApiUrls(new[] { "/_slm/stats" });
79+
internal static ApiUrls SnapshotLifecycleManagementGetStatus = new ApiUrls(new[] { "/_slm/status" });
80+
internal static ApiUrls SnapshotLifecycleManagementPutLifecycle = new ApiUrls(new[] { "/_slm/policy/{policy_id}" });
81+
internal static ApiUrls SnapshotLifecycleManagementStart = new ApiUrls(new[] { "/_slm/start" });
82+
internal static ApiUrls SnapshotLifecycleManagementStop = new ApiUrls(new[] { "/_slm/stop" });
7483
internal static ApiUrls NoNamespaceGetSource = new ApiUrls(new[] { "/{index}/_source/{id}" });
7584
internal static ApiUrls SqlClearCursor = new ApiUrls(new[] { "/_sql/close" });
7685
internal static ApiUrls SqlDeleteAsync = new ApiUrls(new[] { "/_sql/async/delete/{id}" });
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.Slm
27+
{
28+
public class SlmDeleteLifecycleRequestParameters : RequestParameters<SlmDeleteLifecycleRequestParameters>
29+
{
30+
}
31+
32+
public partial class SlmDeleteLifecycleRequest : PlainRequestBase<SlmDeleteLifecycleRequestParameters>
33+
{
34+
public SlmDeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Name policy_id) : base(r => r.Required("policy_id", policy_id))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementDeleteLifecycle;
39+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class SlmDeleteLifecycleRequestDescriptor : RequestDescriptorBase<SlmDeleteLifecycleRequestDescriptor, SlmDeleteLifecycleRequestParameters>
44+
{
45+
internal SlmDeleteLifecycleRequestDescriptor(Action<SlmDeleteLifecycleRequestDescriptor> configure) => configure.Invoke(this);
46+
public SlmDeleteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policy_id) : base(r => r.Required("policy_id", policy_id))
47+
{
48+
}
49+
50+
internal SlmDeleteLifecycleRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementDeleteLifecycle;
55+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
56+
protected override bool SupportsBody => false;
57+
public SlmDeleteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Name policy_id)
58+
{
59+
RouteValues.Required("policy_id", policy_id);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}
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.Slm
24+
{
25+
public partial class SlmDeleteLifecycleResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("acknowledged")]
29+
public bool Acknowledged { get; init; }
30+
}
31+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.Slm
27+
{
28+
public class SlmExecuteLifecycleRequestParameters : RequestParameters<SlmExecuteLifecycleRequestParameters>
29+
{
30+
}
31+
32+
public partial class SlmExecuteLifecycleRequest : PlainRequestBase<SlmExecuteLifecycleRequestParameters>
33+
{
34+
public SlmExecuteLifecycleRequest(Elastic.Clients.Elasticsearch.Name policy_id) : base(r => r.Required("policy_id", policy_id))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementExecuteLifecycle;
39+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class SlmExecuteLifecycleRequestDescriptor : RequestDescriptorBase<SlmExecuteLifecycleRequestDescriptor, SlmExecuteLifecycleRequestParameters>
44+
{
45+
internal SlmExecuteLifecycleRequestDescriptor(Action<SlmExecuteLifecycleRequestDescriptor> configure) => configure.Invoke(this);
46+
public SlmExecuteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policy_id) : base(r => r.Required("policy_id", policy_id))
47+
{
48+
}
49+
50+
internal SlmExecuteLifecycleRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementExecuteLifecycle;
55+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
56+
protected override bool SupportsBody => false;
57+
public SlmExecuteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Name policy_id)
58+
{
59+
RouteValues.Required("policy_id", policy_id);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}
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.Slm
24+
{
25+
public partial class SlmExecuteLifecycleResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("snapshot_name")]
29+
public string SnapshotName { get; init; }
30+
}
31+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.Slm
27+
{
28+
public class SlmExecuteRetentionRequestParameters : RequestParameters<SlmExecuteRetentionRequestParameters>
29+
{
30+
}
31+
32+
public partial class SlmExecuteRetentionRequest : PlainRequestBase<SlmExecuteRetentionRequestParameters>
33+
{
34+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementExecuteRetention;
35+
protected override HttpMethod HttpMethod => HttpMethod.POST;
36+
protected override bool SupportsBody => false;
37+
}
38+
39+
public sealed partial class SlmExecuteRetentionRequestDescriptor : RequestDescriptorBase<SlmExecuteRetentionRequestDescriptor, SlmExecuteRetentionRequestParameters>
40+
{
41+
internal SlmExecuteRetentionRequestDescriptor(Action<SlmExecuteRetentionRequestDescriptor> configure) => configure.Invoke(this);
42+
public SlmExecuteRetentionRequestDescriptor()
43+
{
44+
}
45+
46+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementExecuteRetention;
47+
protected override HttpMethod HttpMethod => HttpMethod.POST;
48+
protected override bool SupportsBody => false;
49+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
50+
{
51+
}
52+
}
53+
}
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.Slm
24+
{
25+
public partial class SlmExecuteRetentionResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("acknowledged")]
29+
public bool Acknowledged { get; init; }
30+
}
31+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.Slm
27+
{
28+
public class SlmGetLifecycleRequestParameters : RequestParameters<SlmGetLifecycleRequestParameters>
29+
{
30+
}
31+
32+
public partial class SlmGetLifecycleRequest : PlainRequestBase<SlmGetLifecycleRequestParameters>
33+
{
34+
public SlmGetLifecycleRequest()
35+
{
36+
}
37+
38+
public SlmGetLifecycleRequest(Elastic.Clients.Elasticsearch.Names? policy_id) : base(r => r.Optional("policy_id", policy_id))
39+
{
40+
}
41+
42+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementGetLifecycle;
43+
protected override HttpMethod HttpMethod => HttpMethod.GET;
44+
protected override bool SupportsBody => false;
45+
}
46+
47+
public sealed partial class SlmGetLifecycleRequestDescriptor : RequestDescriptorBase<SlmGetLifecycleRequestDescriptor, SlmGetLifecycleRequestParameters>
48+
{
49+
internal SlmGetLifecycleRequestDescriptor(Action<SlmGetLifecycleRequestDescriptor> configure) => configure.Invoke(this);
50+
public SlmGetLifecycleRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotLifecycleManagementGetLifecycle;
55+
protected override HttpMethod HttpMethod => HttpMethod.GET;
56+
protected override bool SupportsBody => false;
57+
public SlmGetLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Names? policy_id)
58+
{
59+
RouteValues.Optional("policy_id", policy_id);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)