-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add rollup capibilities API #3450
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
194b6e4
Add rollup capibilities API
Mpdreamz 41a1cac
remove brackets
Mpdreamz edc5eb4
Address PR comments
russcam a999ff3
Merge branch 'feature/rollup-search' into feature/rollup-caps
russcam 2c10d16
Merge branch 'feature/rollup-search' into feature/rollup-caps
russcam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ation/ApiGenerator/RestSpecification/XPack/Rollup/xpack.rollup.get_rollup_caps.patch.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "xpack.rollup.get_rollup_caps": { | ||
| "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-get-rollup-caps.html", | ||
| "url": { | ||
| "path": "/_xpack/rollup/data/{index}", | ||
| "paths": [ "/_xpack/rollup/data/{index}", "/_xpack/rollup/data/" ], | ||
| "parts": { | ||
| "index": { | ||
| "type": "list", | ||
| "required": false, | ||
| "description": " Index, indices or index-pattern to return rollup capabilities for. _all may be used to fetch rollup capabilities from all job" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
17 changes: 0 additions & 17 deletions
17
...ation/ApiGenerator/RestSpecification/XPack/Rollup/xpack.rollup.get_rollup_index_caps.json
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/Nest/XPack/RollUp/GetRollupCapabilities/ElasticClient-GetRollupCapabilities.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using System; | ||
| using System.Threading.Tasks; | ||
| using Elasticsearch.Net; | ||
| using System.Threading; | ||
|
|
||
| namespace Nest | ||
| { | ||
| public partial interface IElasticClient | ||
| { | ||
| /// <inheritdoc/> | ||
| IGetRollupCapabilitiesResponse GetRollupCapabilities(Func<GetRollupCapabilitiesDescriptor, IGetRollupCapabilitiesRequest> selector = null); | ||
|
|
||
| /// <inheritdoc/> | ||
| IGetRollupCapabilitiesResponse GetRollupCapabilities(IGetRollupCapabilitiesRequest request); | ||
|
|
||
| /// <inheritdoc/> | ||
| Task<IGetRollupCapabilitiesResponse> GetRollupCapabilitiesAsync( | ||
| Func<GetRollupCapabilitiesDescriptor, IGetRollupCapabilitiesRequest> selector = null, CancellationToken cancellationToken = default); | ||
|
|
||
| /// <inheritdoc/> | ||
| Task<IGetRollupCapabilitiesResponse> GetRollupCapabilitiesAsync(IGetRollupCapabilitiesRequest request, CancellationToken cancellationToken = default); | ||
| } | ||
|
|
||
| public partial class ElasticClient | ||
| { | ||
| /// <inheritdoc/> | ||
| public IGetRollupCapabilitiesResponse GetRollupCapabilities(Func<GetRollupCapabilitiesDescriptor, IGetRollupCapabilitiesRequest> selector = null) => | ||
| this.GetRollupCapabilities(selector.InvokeOrDefault(new GetRollupCapabilitiesDescriptor())); | ||
|
|
||
| /// <inheritdoc/> | ||
| public IGetRollupCapabilitiesResponse GetRollupCapabilities(IGetRollupCapabilitiesRequest request) => | ||
| this.Dispatcher.Dispatch<IGetRollupCapabilitiesRequest, GetRollupCapabilitiesRequestParameters, GetRollupCapabilitiesResponse>( | ||
| request, | ||
| (p, d) =>this.LowLevelDispatch.XpackRollupGetRollupCapsDispatch<GetRollupCapabilitiesResponse>(p) | ||
| ); | ||
|
|
||
| /// <inheritdoc/> | ||
| public Task<IGetRollupCapabilitiesResponse> GetRollupCapabilitiesAsync( | ||
| Func<GetRollupCapabilitiesDescriptor, IGetRollupCapabilitiesRequest> selector = null, CancellationToken cancellationToken = default | ||
| ) => | ||
| this.GetRollupCapabilitiesAsync(selector.InvokeOrDefault(new GetRollupCapabilitiesDescriptor()), cancellationToken); | ||
|
|
||
| /// <inheritdoc/> | ||
| public Task<IGetRollupCapabilitiesResponse> GetRollupCapabilitiesAsync(IGetRollupCapabilitiesRequest request, CancellationToken cancellationToken = default) => | ||
| this.Dispatcher.DispatchAsync<IGetRollupCapabilitiesRequest, GetRollupCapabilitiesRequestParameters, GetRollupCapabilitiesResponse, IGetRollupCapabilitiesResponse>( | ||
| request, | ||
| cancellationToken, | ||
| (p, d, c) => this.LowLevelDispatch.XpackRollupGetRollupCapsDispatchAsync<GetRollupCapabilitiesResponse>(p, c) | ||
| ); | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
src/Nest/XPack/RollUp/GetRollupCapabilities/GetRollupCapabilitiesRequest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace Nest | ||
| { | ||
| [MapsApi("xpack.rollup.get_rollup_caps.json")] | ||
| public partial interface IGetRollupCapabilitiesRequest | ||
| { | ||
| } | ||
|
|
||
| public partial class GetRollupCapabilitiesRequest | ||
| { | ||
| } | ||
|
|
||
| public partial class GetRollupCapabilitiesDescriptor | ||
| { | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
src/Nest/XPack/RollUp/GetRollupCapabilities/GetRollupCapabilitiesResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq.Expressions; | ||
| using Elasticsearch.Net; | ||
| using Newtonsoft.Json; | ||
|
|
||
| namespace Nest | ||
| { | ||
| public interface IGetRollupCapabilitiesResponse : IResponse | ||
| { | ||
| IReadOnlyDictionary<IndexName, RollupCapabilities> Indices { get; } | ||
| } | ||
|
|
||
| [JsonConverter(typeof(ResolvableDictionaryResponseJsonConverter<GetRollupCapabilitiesResponse, IndexName, RollupCapabilities>))] | ||
| public class GetRollupCapabilitiesResponse : DictionaryResponseBase<IndexName, RollupCapabilities>, IGetRollupCapabilitiesResponse | ||
| { | ||
| public IReadOnlyDictionary<IndexName, RollupCapabilities> Indices => Self.BackingDictionary; | ||
| } | ||
|
|
||
| public class RollupCapabilities | ||
| { | ||
| [JsonProperty("rollup_jobs")] | ||
| public IReadOnlyCollection<RollupCapabilitiesJob> RollupJobs { get; internal set; } | ||
|
|
||
| } | ||
|
|
||
| public class RollupCapabilitiesJob | ||
| { | ||
| [JsonProperty("job_id")] | ||
| public string JobId { get; internal set; } | ||
|
|
||
| [JsonProperty("rollup_index")] | ||
| public string RollupIndex { get; internal set; } | ||
|
|
||
| [JsonProperty("index_pattern")] | ||
| public string IndexPattern { get; internal set; } | ||
|
|
||
| [JsonProperty("fields")] | ||
| public RollupFieldsCapabilitiesDictionary Fields { get; internal set; } | ||
| } | ||
|
|
||
| public class RollupFieldsCapabilities : IsADictionaryBase<string, string> { } | ||
|
|
||
| [JsonConverter(typeof(RollupFieldsCapabilitiesDictionary.Converter))] | ||
| public class RollupFieldsCapabilitiesDictionary : ResolvableDictionaryProxy<Field, IReadOnlyCollection<RollupFieldsCapabilities>> | ||
| { | ||
| internal RollupFieldsCapabilitiesDictionary(IConnectionConfigurationValues c, | ||
| IReadOnlyDictionary<Field, IReadOnlyCollection<RollupFieldsCapabilities>> b) : base(c, b) { } | ||
|
|
||
| internal class Converter : ResolvableDictionaryJsonConverterBase | ||
| <RollupFieldsCapabilitiesDictionary, Field, IReadOnlyCollection<RollupFieldsCapabilities>> | ||
| { | ||
| protected override RollupFieldsCapabilitiesDictionary Create( | ||
| IConnectionSettingsValues s, Dictionary<Field, IReadOnlyCollection<RollupFieldsCapabilities>> d | ||
| ) => new RollupFieldsCapabilitiesDictionary(s, d); | ||
| } | ||
|
|
||
| public IReadOnlyCollection<RollupFieldsCapabilities> Field<T>(Expression<Func<T, object>> selector) => this[selector]; | ||
|
|
||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this should have a
<summary>and other overloads inherit from it