-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added unmapped endpoints #2894
Added unmapped endpoints #2894
Changes from 4 commits
c5fa7fa
4910944
151ba83
5e55590
ac4085d
9b2ab50
861b135
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Elasticsearch.Net; | ||
|
||
namespace Nest | ||
{ | ||
using System.Threading; | ||
using NodesHotThreadConverter = Func<IApiCallDetails, Stream, NodesHotThreadsResponse>; | ||
|
||
public partial interface IElasticClient | ||
{ | ||
/// <summary> | ||
/// The cluster nodes usage API allows to retrieve information on the usage of features for each node. | ||
/// <para> </para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html | ||
/// </summary> | ||
/// <param name="selector">An optional descriptor to further describe the nodes usage operation</param> | ||
INodesUsageResponse NodesUsage(Func<NodesUsageDescriptor, INodesUsageRequest> selector = null); | ||
|
||
/// <inheritdoc/> | ||
INodesUsageResponse NodesUsage(INodesUsageRequest request); | ||
|
||
/// <inheritdoc/> | ||
Task<INodesUsageResponse> NodesUsageAsync(Func<NodesUsageDescriptor, INodesUsageRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken)); | ||
|
||
/// <inheritdoc/> | ||
Task<INodesUsageResponse> NodesUsageAsync(INodesUsageRequest request, CancellationToken cancellationToken = default(CancellationToken)); | ||
} | ||
|
||
public partial class ElasticClient | ||
{ | ||
/// <inheritdoc/> | ||
public INodesUsageResponse NodesUsage(Func<NodesUsageDescriptor, INodesUsageRequest> selector = null) => | ||
this.NodesUsage(selector.InvokeOrDefault(new NodesUsageDescriptor())); | ||
|
||
/// <inheritdoc/> | ||
public INodesUsageResponse NodesUsage(INodesUsageRequest request) => | ||
this.Dispatcher.Dispatch<INodesUsageRequest, NodesUsageRequestParameters, NodesUsageResponse>( | ||
request, | ||
(p, d) => this.LowLevelDispatch.NodesUsageDispatch<NodesUsageResponse>(p) | ||
); | ||
|
||
/// <inheritdoc/> | ||
public Task<INodesUsageResponse> NodesUsageAsync(Func<NodesUsageDescriptor, INodesUsageRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken)) => | ||
this.NodesUsageAsync(selector.InvokeOrDefault(new NodesUsageDescriptor()), cancellationToken); | ||
|
||
/// <inheritdoc/> | ||
public Task<INodesUsageResponse> NodesUsageAsync(INodesUsageRequest request, CancellationToken cancellationToken = default(CancellationToken)) => | ||
this.Dispatcher.DispatchAsync<INodesUsageRequest, NodesUsageRequestParameters, NodesUsageResponse, INodesUsageResponse>( | ||
request, | ||
cancellationToken, | ||
(p, d, c) => this.LowLevelDispatch.NodesUsageDispatchAsync<NodesUsageResponse>(p, c) | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Nest | ||
{ | ||
public class NodeUsageMetadata | ||
{ | ||
[JsonProperty(PropertyName = "total")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pedant alert! Can these just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
public int Total { get; internal set; } | ||
|
||
[JsonProperty(PropertyName = "successful")] | ||
public int Successful { get; internal set; } | ||
|
||
[JsonProperty(PropertyName = "failed")] | ||
public int Failed { get; internal set; } | ||
} | ||
|
||
public class NodeUsageInformation | ||
{ | ||
[JsonProperty(PropertyName = "timestamp")] | ||
[JsonConverter(typeof(EpochMillisecondsDateTimeJsonConverter))] | ||
public DateTimeOffset Timestamp { get; internal set; } | ||
|
||
[JsonProperty(PropertyName = "since")] | ||
[JsonConverter(typeof(EpochMillisecondsDateTimeJsonConverter))] | ||
public DateTimeOffset Since { get; internal set; } | ||
|
||
[JsonProperty(PropertyName = "rest_actions")] | ||
public IReadOnlyDictionary<string, int> RestActions { get; internal set; } | ||
} | ||
|
||
public interface INodesUsageResponse : IResponse | ||
{ | ||
string ClusterName { get; } | ||
|
||
IReadOnlyDictionary<string, NodeUsageInformation> Nodes { get; } | ||
|
||
NodeUsageMetadata NodeMetadata { get; } | ||
} | ||
|
||
public class NodesUsageResponse : ResponseBase, INodesUsageResponse | ||
{ | ||
[JsonProperty(PropertyName = "cluster_name")] | ||
public string ClusterName { get; internal set; } | ||
|
||
[JsonProperty(PropertyName = "nodes")] | ||
public IReadOnlyDictionary<string, NodeUsageInformation> Nodes { get; internal set; } = EmptyReadOnly<string, NodeUsageInformation>.Dictionary; | ||
|
||
[JsonProperty(PropertyName = "_nodes")] | ||
public NodeUsageMetadata NodeMetadata { get; internal set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe property name should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at usage of |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Nest | ||
{ | ||
public partial interface INodesUsageRequest { } | ||
|
||
public partial class NodesUsageRequest { } | ||
|
||
[DescriptorFor("NodesUsage")] | ||
public partial class NodesUsageDescriptor { } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Elasticsearch.Net; | ||
|
||
namespace Nest | ||
{ | ||
using System.Threading; | ||
using NodesHotThreadConverter = Func<IApiCallDetails, Stream, NodesHotThreadsResponse>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy pasta. Fixed. |
||
|
||
public partial interface IElasticClient | ||
{ | ||
/// <summary> | ||
/// Retrieving which patterns which the grok processor is packaged with, useful as different versions are bundled with different processors. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pedant alert!: Retrieving which patterns the grok processor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aunglish. |
||
/// <para> </para>https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html | ||
/// </summary> | ||
/// <param name="selector">An optional descriptor to further describe the endpoint usage operation</param> | ||
IIngestProcessorGrokResponse IngestProcessorGrok(Func<IngestProcessorGrokDescriptor, IIngestProcessorGrokRequest> selector = null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about the name of this API; Perhaps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure either, just picked a name, but happy to change it. |
||
|
||
/// <inheritdoc/> | ||
IIngestProcessorGrokResponse IngestProcessorGrok(IIngestProcessorGrokRequest request); | ||
|
||
/// <inheritdoc/> | ||
Task<IIngestProcessorGrokResponse> IngestProcessorGrokAsync(Func<IngestProcessorGrokDescriptor, IIngestProcessorGrokRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken)); | ||
|
||
/// <inheritdoc/> | ||
Task<IIngestProcessorGrokResponse> IngestProcessorGrokAsync(IIngestProcessorGrokRequest request, CancellationToken cancellationToken = default(CancellationToken)); | ||
} | ||
|
||
public partial class ElasticClient | ||
{ | ||
/// <inheritdoc/> | ||
public IIngestProcessorGrokResponse IngestProcessorGrok(Func<IngestProcessorGrokDescriptor, IIngestProcessorGrokRequest> selector = null) => | ||
this.IngestProcessorGrok(selector.InvokeOrDefault(new IngestProcessorGrokDescriptor())); | ||
|
||
/// <inheritdoc/> | ||
public IIngestProcessorGrokResponse IngestProcessorGrok(IIngestProcessorGrokRequest request) => | ||
this.Dispatcher.Dispatch<IIngestProcessorGrokRequest, IngestProcessorGrokRequestParameters, IngestProcessorGrokResponse>( | ||
request, | ||
(p, d) => this.LowLevelDispatch.IngestProcessorGrokDispatch<IngestProcessorGrokResponse>(p) | ||
); | ||
|
||
/// <inheritdoc/> | ||
public Task<IIngestProcessorGrokResponse> IngestProcessorGrokAsync(Func<IngestProcessorGrokDescriptor, IIngestProcessorGrokRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken)) => | ||
this.IngestProcessorGrokAsync(selector.InvokeOrDefault(new IngestProcessorGrokDescriptor()), cancellationToken); | ||
|
||
/// <inheritdoc/> | ||
public Task<IIngestProcessorGrokResponse> IngestProcessorGrokAsync(IIngestProcessorGrokRequest request, CancellationToken cancellationToken = default(CancellationToken)) => | ||
this.Dispatcher.DispatchAsync<IIngestProcessorGrokRequest, IngestProcessorGrokRequestParameters, IngestProcessorGrokResponse, IIngestProcessorGrokResponse>( | ||
request, | ||
cancellationToken, | ||
(p, d, c) => this.LowLevelDispatch.IngestProcessorGrokDispatchAsync<IngestProcessorGrokResponse>(p, c) | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Nest | ||
{ | ||
public partial interface IIngestProcessorGrokRequest { } | ||
|
||
public partial class IngestProcessorGrokRequest { } | ||
|
||
[DescriptorFor("IngestProcessorGrok")] | ||
public partial class IngestProcessorGrokDescriptor { } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Nest | ||
{ | ||
public interface IIngestProcessorGrokResponse : IResponse | ||
{ | ||
IReadOnlyDictionary<string, string> Patterns { get; } | ||
} | ||
|
||
public class IngestProcessorGrokResponse : ResponseBase, IIngestProcessorGrokResponse | ||
{ | ||
[JsonProperty(PropertyName = "patterns")] | ||
public IReadOnlyDictionary<string, string> Patterns { get; internal set; } = EmptyReadOnly<string, string>.Dictionary; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Nest | ||
{ | ||
public partial interface IDeprecationInfoRequest { } | ||
|
||
public partial class DeprecationInfoRequest { } | ||
|
||
[DescriptorFor("XpackDeprecationInfo")] | ||
public partial class DeprecationInfoDescriptor : IDeprecationInfoRequest { } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Nest | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum DeprecationWarningLevel | ||
{ | ||
[EnumMember(Value = "none")] | ||
None, | ||
[EnumMember(Value = "info")] | ||
Information, | ||
[EnumMember(Value = "warning")] | ||
Warning, | ||
[EnumMember(Value = "critical")] | ||
Critical | ||
} | ||
|
||
public class DeprecationInfoItem | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
{ | ||
[JsonProperty("level")] | ||
public DeprecationWarningLevel Level { get; internal set; } | ||
|
||
[JsonProperty("message")] | ||
public string Message { get; internal set; } | ||
|
||
[JsonProperty("url")] | ||
public string Url { get; internal set; } | ||
|
||
[JsonProperty("details")] | ||
public string Details { get; internal set; } | ||
} | ||
|
||
public interface IDeprecationInfoResponse : IResponse | ||
{ | ||
[JsonProperty("cluster_settings")] | ||
IReadOnlyCollection<DeprecationInfoItem> ClusterSettings { get; } | ||
|
||
[JsonProperty("node_settings")] | ||
IReadOnlyCollection<DeprecationInfoItem> NodeSettings { get; } | ||
|
||
[JsonProperty("index_settings")] | ||
IReadOnlyDictionary<string, IReadOnlyCollection<DeprecationInfoItem>> IndexSettings { get; } | ||
} | ||
|
||
public class DeprecationInfoResponse : ResponseBase, IDeprecationInfoResponse | ||
{ | ||
public IReadOnlyCollection<DeprecationInfoItem> ClusterSettings { get; internal set; } = EmptyReadOnly<DeprecationInfoItem>.Collection; | ||
public IReadOnlyCollection<DeprecationInfoItem> NodeSettings { get; internal set; } = EmptyReadOnly<DeprecationInfoItem>.Collection; | ||
public IReadOnlyDictionary<string, IReadOnlyCollection<DeprecationInfoItem>> IndexSettings { get; internal set; } = EmptyReadOnly<string, IReadOnlyCollection<DeprecationInfoItem>>.Dictionary; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the type should be
NodesUsageMetadata
to reflect the method name that it contains meta data on many nodes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think the name should be
NodesMetaData
, which mirrors the existingShardsMetaData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
MetaData
suffix is a mistake in my part. We have bothMetadata
andMetaData
suffixes in the code base and I've been leaning towards the first since that mimmics elasticsearch's snake casing ofmetadata
. Maybe in 6.0 we do a sweep to standardize, worth the breaking change?