Skip to content

Commit 4195ba0

Browse files
Add Searchable Snapshots APIs (#6214) (#6215)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 7d709a3 commit 4195ba0

15 files changed

+924
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ internal static class ApiUrlsLookups
6666
internal static ApiUrls NodesUsage = new ApiUrls(new[] { "/_nodes/usage", "/_nodes/{node_id}/usage", "/_nodes/usage/{metric}", "/_nodes/{node_id}/usage/{metric}" });
6767
internal static ApiUrls NoNamespaceOpenPointInTime = new ApiUrls(new[] { "/{index}/_pit" });
6868
internal static ApiUrls NoNamespacePing = new ApiUrls(new[] { "/" });
69+
internal static ApiUrls SearchableSnapshotsCacheStats = new ApiUrls(new[] { "/_searchable_snapshots/cache/stats", "/_searchable_snapshots/{node_id}/cache/stats" });
70+
internal static ApiUrls SearchableSnapshotsClearCache = new ApiUrls(new[] { "/_searchable_snapshots/cache/clear", "/{index}/_searchable_snapshots/cache/clear" });
71+
internal static ApiUrls SearchableSnapshotsMount = new ApiUrls(new[] { "/_snapshot/{repository}/{snapshot}/_mount" });
72+
internal static ApiUrls SearchableSnapshotsStats = new ApiUrls(new[] { "/_searchable_snapshots/stats", "/{index}/_searchable_snapshots/stats" });
6973
internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[] { "/_search", "/{index}/_search" });
7074
internal static ApiUrls NoNamespaceGetSource = new ApiUrls(new[] { "/{index}/_source/{id}" });
7175
internal static ApiUrls SqlClearCursor = new ApiUrls(new[] { "/_sql/close" });
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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.SearchableSnapshots
27+
{
28+
public class SearchableSnapshotsCacheStatsRequestParameters : RequestParameters<SearchableSnapshotsCacheStatsRequestParameters>
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+
34+
public partial class SearchableSnapshotsCacheStatsRequest : PlainRequestBase<SearchableSnapshotsCacheStatsRequestParameters>
35+
{
36+
public SearchableSnapshotsCacheStatsRequest()
37+
{
38+
}
39+
40+
public SearchableSnapshotsCacheStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? node_id) : base(r => r.Optional("node_id", node_id))
41+
{
42+
}
43+
44+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SearchableSnapshotsCacheStats;
45+
protected override HttpMethod HttpMethod => HttpMethod.GET;
46+
protected override bool SupportsBody => false;
47+
[JsonIgnore]
48+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
49+
}
50+
51+
public sealed partial class SearchableSnapshotsCacheStatsRequestDescriptor : RequestDescriptorBase<SearchableSnapshotsCacheStatsRequestDescriptor, SearchableSnapshotsCacheStatsRequestParameters>
52+
{
53+
internal SearchableSnapshotsCacheStatsRequestDescriptor(Action<SearchableSnapshotsCacheStatsRequestDescriptor> configure) => configure.Invoke(this);
54+
public SearchableSnapshotsCacheStatsRequestDescriptor()
55+
{
56+
}
57+
58+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SearchableSnapshotsCacheStats;
59+
protected override HttpMethod HttpMethod => HttpMethod.GET;
60+
protected override bool SupportsBody => false;
61+
public SearchableSnapshotsCacheStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
62+
public SearchableSnapshotsCacheStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? node_id)
63+
{
64+
RouteValues.Optional("node_id", node_id);
65+
return Self;
66+
}
67+
68+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
69+
{
70+
}
71+
}
72+
}
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.SearchableSnapshots
24+
{
25+
public partial class SearchableSnapshotsCacheStatsResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("nodes")]
29+
public Dictionary<string, Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStats.Node> Nodes { get; init; }
30+
}
31+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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.SearchableSnapshots
27+
{
28+
public class SearchableSnapshotsClearCacheRequestParameters : RequestParameters<SearchableSnapshotsClearCacheRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
32+
33+
[JsonIgnore]
34+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
35+
36+
[JsonIgnore]
37+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
38+
}
39+
40+
public partial class SearchableSnapshotsClearCacheRequest : PlainRequestBase<SearchableSnapshotsClearCacheRequestParameters>
41+
{
42+
public SearchableSnapshotsClearCacheRequest()
43+
{
44+
}
45+
46+
public SearchableSnapshotsClearCacheRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
47+
{
48+
}
49+
50+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SearchableSnapshotsClearCache;
51+
protected override HttpMethod HttpMethod => HttpMethod.POST;
52+
protected override bool SupportsBody => false;
53+
[JsonIgnore]
54+
public Elastic.Clients.Elasticsearch.ExpandWildcards? ExpandWildcards { get => Q<Elastic.Clients.Elasticsearch.ExpandWildcards?>("expand_wildcards"); set => Q("expand_wildcards", value); }
55+
56+
[JsonIgnore]
57+
public bool? AllowNoIndices { get => Q<bool?>("allow_no_indices"); set => Q("allow_no_indices", value); }
58+
59+
[JsonIgnore]
60+
public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }
61+
}
62+
63+
public sealed partial class SearchableSnapshotsClearCacheRequestDescriptor<TDocument> : RequestDescriptorBase<SearchableSnapshotsClearCacheRequestDescriptor<TDocument>, SearchableSnapshotsClearCacheRequestParameters>
64+
{
65+
internal SearchableSnapshotsClearCacheRequestDescriptor(Action<SearchableSnapshotsClearCacheRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
66+
public SearchableSnapshotsClearCacheRequestDescriptor()
67+
{
68+
}
69+
70+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SearchableSnapshotsClearCache;
71+
protected override HttpMethod HttpMethod => HttpMethod.POST;
72+
protected override bool SupportsBody => false;
73+
public SearchableSnapshotsClearCacheRequestDescriptor<TDocument> AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
74+
public SearchableSnapshotsClearCacheRequestDescriptor<TDocument> ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
75+
public SearchableSnapshotsClearCacheRequestDescriptor<TDocument> IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
76+
public SearchableSnapshotsClearCacheRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.Indices? indices)
77+
{
78+
RouteValues.Optional("index", indices);
79+
return Self;
80+
}
81+
82+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
83+
{
84+
}
85+
}
86+
87+
public sealed partial class SearchableSnapshotsClearCacheRequestDescriptor : RequestDescriptorBase<SearchableSnapshotsClearCacheRequestDescriptor, SearchableSnapshotsClearCacheRequestParameters>
88+
{
89+
internal SearchableSnapshotsClearCacheRequestDescriptor(Action<SearchableSnapshotsClearCacheRequestDescriptor> configure) => configure.Invoke(this);
90+
public SearchableSnapshotsClearCacheRequestDescriptor()
91+
{
92+
}
93+
94+
internal override ApiUrls ApiUrls => ApiUrlsLookups.SearchableSnapshotsClearCache;
95+
protected override HttpMethod HttpMethod => HttpMethod.POST;
96+
protected override bool SupportsBody => false;
97+
public SearchableSnapshotsClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
98+
public SearchableSnapshotsClearCacheRequestDescriptor ExpandWildcards(Elastic.Clients.Elasticsearch.ExpandWildcards? expandWildcards) => Qs("expand_wildcards", expandWildcards);
99+
public SearchableSnapshotsClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
100+
public SearchableSnapshotsClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices)
101+
{
102+
RouteValues.Optional("index", indices);
103+
return Self;
104+
}
105+
106+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
107+
{
108+
}
109+
}
110+
}
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.SearchableSnapshots
24+
{
25+
public partial class SearchableSnapshotsClearCacheResponse : ElasticsearchResponseBase
26+
{
27+
}
28+
}

0 commit comments

Comments
 (0)