|
| 1 | +using System; |
| 2 | +using System.IO; |
| 3 | +using System.Threading; |
| 4 | +using System.Threading.Tasks; |
| 5 | +using Elasticsearch.Net; |
| 6 | + |
| 7 | +namespace Nest |
| 8 | +{ |
| 9 | + public partial interface IElasticClient |
| 10 | + { |
| 11 | + /// <summary> |
| 12 | + /// This API will decrypt and re-read the entire keystore, on every cluster node, but only the reloadable secure settings will |
| 13 | + /// be applied. |
| 14 | + /// <para>Changes to other settings will not go into effect until the next restart. Once the call returns, the reload has been |
| 15 | + /// completed, meaning that all internal datastructures dependent on these settings have been changed. Everything should look as if |
| 16 | + /// the settings had the new value from the start.</para> |
| 17 | + /// <para> |
| 18 | + /// When changing multiple reloadable secure settings, modify all of them, on each cluster node, and then issue a reload_secure_settings call, |
| 19 | + /// instead of reloading after each modification.</para> |
| 20 | + /// </summary> |
| 21 | + IReloadSecureSettingsResponse ReloadSecureSettings(Func<ReloadSecureSettingsDescriptor, IReloadSecureSettingsRequest> selector = null); |
| 22 | + |
| 23 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 24 | + IReloadSecureSettingsResponse ReloadSecureSettings(IReloadSecureSettingsRequest request); |
| 25 | + |
| 26 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 27 | + Task<IReloadSecureSettingsResponse> ReloadSecureSettingsAsync( |
| 28 | + Func<ReloadSecureSettingsDescriptor, IReloadSecureSettingsRequest> selector = null, |
| 29 | + CancellationToken cancellationToken = default |
| 30 | + ); |
| 31 | + |
| 32 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 33 | + Task<IReloadSecureSettingsResponse> ReloadSecureSettingsAsync(IReloadSecureSettingsRequest request, |
| 34 | + CancellationToken cancellationToken = default |
| 35 | + ); |
| 36 | + } |
| 37 | + |
| 38 | + public partial class ElasticClient |
| 39 | + { |
| 40 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 41 | + public IReloadSecureSettingsResponse ReloadSecureSettings( |
| 42 | + Func<ReloadSecureSettingsDescriptor, IReloadSecureSettingsRequest> selector = null |
| 43 | + ) => |
| 44 | + ReloadSecureSettings(selector.InvokeOrDefault(new ReloadSecureSettingsDescriptor())); |
| 45 | + |
| 46 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 47 | + public IReloadSecureSettingsResponse ReloadSecureSettings(IReloadSecureSettingsRequest request) => |
| 48 | + Dispatcher.Dispatch<IReloadSecureSettingsRequest, ReloadSecureSettingsRequestParameters, ReloadSecureSettingsResponse>( |
| 49 | + request, |
| 50 | + (p, d) => LowLevelDispatch.NodesReloadSecureSettingsDispatch<ReloadSecureSettingsResponse>(p) |
| 51 | + ); |
| 52 | + |
| 53 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 54 | + public Task<IReloadSecureSettingsResponse> ReloadSecureSettingsAsync( |
| 55 | + Func<ReloadSecureSettingsDescriptor, IReloadSecureSettingsRequest> selector = null, |
| 56 | + CancellationToken cancellationToken = default |
| 57 | + ) => |
| 58 | + ReloadSecureSettingsAsync(selector.InvokeOrDefault(new ReloadSecureSettingsDescriptor()), cancellationToken); |
| 59 | + |
| 60 | + /// <inheritdoc cref="ReloadSecureSettings(System.Func{Nest.ReloadSecureSettingsDescriptor,Nest.IReloadSecureSettingsRequest})"/> |
| 61 | + public Task<IReloadSecureSettingsResponse> ReloadSecureSettingsAsync(IReloadSecureSettingsRequest request, |
| 62 | + CancellationToken cancellationToken = default |
| 63 | + ) => |
| 64 | + Dispatcher |
| 65 | + .DispatchAsync<IReloadSecureSettingsRequest, ReloadSecureSettingsRequestParameters, ReloadSecureSettingsResponse, |
| 66 | + IReloadSecureSettingsResponse>( |
| 67 | + request, |
| 68 | + cancellationToken, |
| 69 | + (p, d, c) => LowLevelDispatch.NodesReloadSecureSettingsDispatchAsync<ReloadSecureSettingsResponse>(p, c) |
| 70 | + ); |
| 71 | + } |
| 72 | +} |
0 commit comments