-
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
Conversation
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.
LGTM, small (some pedantic!) changes
{ | ||
public class NodeUsageMetadata | ||
{ | ||
[JsonProperty(PropertyName = "total")] |
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.
pedant alert! Can these just be [JsonProperty("total")]
, etc?
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.
👍
|
||
namespace Nest | ||
{ | ||
public class NodeUsageMetadata |
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 existing ShardsMetaData
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 both Metadata
and MetaData
suffixes in the code base and I've been leaning towards the first since that mimmics elasticsearch's snake casing of metadata
. Maybe in 6.0 we do a sweep to standardize, worth the breaking change?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
maybe property name should be NodesMetaData
, to mirror the type name (and since we can't use 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.
👍
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.
Looking at usage of ShardsMetaData
, the property has tended to be called ShardsHit
- maybe this should be NodesHit
here?
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the name of this API; Perhaps GrokProcessorPatterns
? Happy to go with consensus here
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.
Not sure either, just picked a name, but happy to change it.
public class NodesUsageUnitTests | ||
{ | ||
[U] | ||
public void ShouldDeserialize() |
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.
Not sure this is needed; ExpectResponse
in NodesUsageApiTests
is also testing deserialization?
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.
This is a fuller example.
const string indexName = ".monitoring-es-6-2017.07.21"; | ||
response.IndexSettings.Should().ContainKey(indexName); | ||
response.IndexSettings[indexName].Count.Should().Be(1); | ||
response.IndexSettings[indexName].First().Details.Should().Be("<anchor id=\"type: doc\" xreflabel=\"field: spins]\"/>"); |
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.
pedant alert!: pull response.IndexSettings[indexName].First()
out into variable
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.
👍
[U] public async Task Urls() | ||
{ | ||
await GET("/_xpack/migration/deprecations") | ||
.Fluent(c => c.DeprecationInfo(d => d)) |
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.
remove d => d
await GET("/_xpack/migration/deprecations") | ||
.Fluent(c => c.DeprecationInfo(d => d)) | ||
.Request(c => c.DeprecationInfo(new DeprecationInfoRequest())) | ||
.FluentAsync(c => c.DeprecationInfoAsync(d => d)) |
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.
remove d => d
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.
My bad, 👍
|
||
protected override string UrlPath => $"/_ingest/processor/grok"; | ||
|
||
protected override IngestProcessorGrokDescriptor NewDescriptor() => new IngestProcessorGrokDescriptor(); |
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.
superfluous, can be removed
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.
👍
src/Tests/Framework/TestClient.cs
Outdated
fixedResult = contentType == "application/json" | ||
? serializer.SerializeToBytes(response) | ||
: Encoding.UTF8.GetBytes(response.ToString()); | ||
} |
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.
Rather then supporting strings can we use anonymous c# objects in the tests for the expected json?
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 went down that road originally, but I had to end up using JObject, which might have looked messier.
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.
Why did you need to use jobject?
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.
Property name starts with a '.'
* Implementation of: GrokProcessorPatterns, NodesUsage and DeprecationInfo
* Implementation of: GrokProcessorPatterns, NodesUsage and DeprecationInfo
No description provided.