Skip to content

Commit 565516d

Browse files
Add List Dandling Indices API (#6306) (#6307)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 3ff051a commit 565516d

File tree

6 files changed

+193
-0
lines changed

6 files changed

+193
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ internal static class ApiUrlsLookups
5959
internal static ApiUrls ClusterStats = new ApiUrls(new[] { "/_cluster/stats", "/_cluster/stats/nodes/{node_id}" });
6060
internal static ApiUrls NoNamespaceCount = new ApiUrls(new[] { "/_count", "/{index}/_count" });
6161
internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[] { "/{index}/_create/{id}" });
62+
internal static ApiUrls DanglingIndicesListDanglingIndices = new ApiUrls(new[] { "/_dangling" });
6263
internal static ApiUrls NoNamespaceDeleteByQuery = new ApiUrls(new[] { "/{index}/_delete_by_query" });
6364
internal static ApiUrls NoNamespaceDeleteByQueryRethrottle = new ApiUrls(new[] { "/_delete_by_query/{task_id}/_rethrottle" });
6465
internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[] { "/{index}/_doc/{id}" });
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.DanglingIndices
27+
{
28+
public class DanglingIndicesListDanglingIndicesRequestParameters : RequestParameters<DanglingIndicesListDanglingIndicesRequestParameters>
29+
{
30+
}
31+
32+
public partial class DanglingIndicesListDanglingIndicesRequest : PlainRequestBase<DanglingIndicesListDanglingIndicesRequestParameters>
33+
{
34+
internal override ApiUrls ApiUrls => ApiUrlsLookups.DanglingIndicesListDanglingIndices;
35+
protected override HttpMethod HttpMethod => HttpMethod.GET;
36+
protected override bool SupportsBody => false;
37+
}
38+
39+
public sealed partial class DanglingIndicesListDanglingIndicesRequestDescriptor : RequestDescriptorBase<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesRequestParameters>
40+
{
41+
internal DanglingIndicesListDanglingIndicesRequestDescriptor(Action<DanglingIndicesListDanglingIndicesRequestDescriptor> configure) => configure.Invoke(this);
42+
public DanglingIndicesListDanglingIndicesRequestDescriptor()
43+
{
44+
}
45+
46+
internal override ApiUrls ApiUrls => ApiUrlsLookups.DanglingIndicesListDanglingIndices;
47+
protected override HttpMethod HttpMethod => HttpMethod.GET;
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.DanglingIndices
24+
{
25+
public partial class DanglingIndicesListDanglingIndicesResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("dangling_indices")]
29+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex> DanglingIndices { get; init; }
30+
}
31+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 System;
19+
using System.Threading;
20+
using System.Threading.Tasks;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.DanglingIndices
24+
{
25+
public class DanglingIndicesNamespace : NamespacedClientProxy
26+
{
27+
internal DanglingIndicesNamespace(ElasticsearchClient client) : base(client)
28+
{
29+
}
30+
31+
public DanglingIndicesListDanglingIndicesResponse ListDanglingIndices(DanglingIndicesListDanglingIndicesRequest request)
32+
{
33+
request.BeforeRequest();
34+
return DoRequest<DanglingIndicesListDanglingIndicesRequest, DanglingIndicesListDanglingIndicesResponse>(request);
35+
}
36+
37+
public Task<DanglingIndicesListDanglingIndicesResponse> ListDanglingIndicesAsync(DanglingIndicesListDanglingIndicesRequest request, CancellationToken cancellationToken = default)
38+
{
39+
request.BeforeRequest();
40+
return DoRequestAsync<DanglingIndicesListDanglingIndicesRequest, DanglingIndicesListDanglingIndicesResponse>(request, cancellationToken);
41+
}
42+
43+
public DanglingIndicesListDanglingIndicesResponse ListDanglingIndices(Action<DanglingIndicesListDanglingIndicesRequestDescriptor> configureRequest = null)
44+
{
45+
var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
46+
configureRequest?.Invoke(descriptor);
47+
descriptor.BeforeRequest();
48+
return DoRequest<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
49+
}
50+
51+
public Task<DanglingIndicesListDanglingIndicesResponse> ListDanglingIndicesAsync(Action<DanglingIndicesListDanglingIndicesRequestDescriptor> configureRequest = null, CancellationToken cancellationToken = default)
52+
{
53+
var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
54+
configureRequest?.Invoke(descriptor);
55+
descriptor.BeforeRequest();
56+
return DoRequestAsync<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
57+
}
58+
}
59+
}

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Elastic.Clients.Elasticsearch.Autoscaling;
2020
using Elastic.Clients.Elasticsearch.Ccr;
2121
using Elastic.Clients.Elasticsearch.Cluster;
22+
using Elastic.Clients.Elasticsearch.DanglingIndices;
2223
using Elastic.Clients.Elasticsearch.Enrich;
2324
using Elastic.Clients.Elasticsearch.Eql;
2425
using Elastic.Clients.Elasticsearch.Graph;
@@ -49,6 +50,8 @@ public partial class ElasticsearchClient
4950

5051
public ClusterNamespace Cluster { get; private set; }
5152

53+
public DanglingIndicesNamespace DanglingIndices { get; private set; }
54+
5255
public EnrichNamespace Enrich { get; private set; }
5356

5457
public EqlNamespace Eql { get; private set; }
@@ -81,6 +84,7 @@ private partial void SetupNamespaces()
8184
Autoscaling = new AutoscalingNamespace(this);
8285
Ccr = new CcrNamespace(this);
8386
Cluster = new ClusterNamespace(this);
87+
DanglingIndices = new DanglingIndicesNamespace(this);
8488
Enrich = new EnrichNamespace(this);
8589
Eql = new EqlNamespace(this);
8690
Graph = new GraphNamespace(this);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 System;
19+
using System.Collections.Generic;
20+
using System.Linq.Expressions;
21+
using System.Text.Json;
22+
using System.Text.Json.Serialization;
23+
24+
#nullable restore
25+
namespace Elastic.Clients.Elasticsearch.DanglingIndices
26+
{
27+
public partial class DanglingIndex
28+
{
29+
[JsonInclude]
30+
[JsonPropertyName("creation_date_millis")]
31+
public Elastic.Clients.Elasticsearch.EpochMillis CreationDateMillis { get; init; }
32+
33+
[JsonInclude]
34+
[JsonPropertyName("index_name")]
35+
public string IndexName { get; init; }
36+
37+
[JsonInclude]
38+
[JsonPropertyName("index_uuid")]
39+
public string IndexUuid { get; init; }
40+
41+
[JsonInclude]
42+
[JsonPropertyName("node_ids")]
43+
public Elastic.Clients.Elasticsearch.Ids NodeIds { get; init; }
44+
}
45+
}

0 commit comments

Comments
 (0)