diff --git a/.github/actions/run-released-opensearch/action.yml b/.github/actions/run-released-opensearch/action.yml index f230940ffe..c87f63e341 100644 --- a/.github/actions/run-released-opensearch/action.yml +++ b/.github/actions/run-released-opensearch/action.yml @@ -11,6 +11,9 @@ outputs: opensearch_url: description: The URL where the OpenSearch node is accessible value: ${{ steps.opensearch.outputs.opensearch_url }} + admin_password: + description: The initial admin password + value: ${{ steps.opensearch.outputs.admin_password }} runs: using: composite steps: diff --git a/.github/actions/start-opensearch/action.yml b/.github/actions/start-opensearch/action.yml index a9223013d7..8e4eb154e5 100644 --- a/.github/actions/start-opensearch/action.yml +++ b/.github/actions/start-opensearch/action.yml @@ -8,6 +8,9 @@ outputs: opensearch_url: description: The URL where the OpenSearch node is accessible value: ${{ steps.opensearch.outputs.url }} + admin_password: + description: The initial admin password + value: ${{ steps.opensearch.outputs.password }} runs: using: composite steps: @@ -24,30 +27,49 @@ runs: if [[ "$RUNNER_OS" == "macOS" ]]; then brew install -q coreutils fi - OPENSEARCH_HOME=$(realpath ./opensearch-*) + OPENSEARCH_HOME=$(realpath ./opensearch-[1-9]*) + CONFIG_DIR=$OPENSEARCH_HOME/config + CONFIG_FILE=$CONFIG_DIR/opensearch.yml + SECURITY_DIR=$OPENSEARCH_HOME/plugins/opensearch-security OPENSEARCH_JAVA_OPTS="-Djava.net.preferIPv4Stack=true" - url="http://localhost:9200" - cp ./client/.ci/opensearch/opensearch.yml $OPENSEARCH_HOME/config/ + URL="http://localhost:9200" + cp ./client/.ci/opensearch/opensearch.yml $CONFIG_FILE bash ./client/.ci/generate-certs.sh + + export OPENSEARCH_INITIAL_ADMIN_PASSWORD=admin - if [[ -d "$OPENSEARCH_HOME/plugins/opensearch-security" ]]; then + if [[ -d "$SECURITY_DIR" ]]; then if [[ "$SECURED" == "true" ]]; then - bash $OPENSEARCH_HOME/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s - sed -i.bak -e 's/plugins.security.audit.type:.*/plugins.security.audit.type: log4j/' $OPENSEARCH_HOME/config/opensearch.yml - cp ./client/.ci/opensearch/*.pem $OPENSEARCH_HOME/config/ - url="https://localhost:9200" + SECURITY_VERSION=$(cat $SECURITY_DIR/plugin-descriptor.properties | grep '^version=' | cut -d'=' -f 2) + SECURITY_VERSION_COMPONENTS=(${SECURITY_VERSION//./ }) + SECURITY_MAJOR="${SECURITY_VERSION_COMPONENTS[0]}" + SECURITY_MINOR="${SECURITY_VERSION_COMPONENTS[1]}" + + if (( $SECURITY_MAJOR > 2 || ( $SECURITY_MAJOR == 2 && $SECURITY_MINOR >= 12 ) )); then + export OPENSEARCH_INITIAL_ADMIN_PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9 > $OPENSEARCH_HOME/config/opensearch.yml + printf "\nplugins.security.disabled: true" >> $CONFIG_FILE fi fi if [[ "$RUNNER_OS" == "macOS" ]]; then - sed -i.bak -e 's/bootstrap.memory_lock:.*/bootstrap.memory_lock: false/' $OPENSEARCH_HOME/config/opensearch.yml + sed -i.bak -e 's/bootstrap.memory_lock:.*/bootstrap.memory_lock: false/' $CONFIG_FILE fi - echo "url=$url" >> $GITHUB_OUTPUT + { + echo "url=$URL" + echo "password=$OPENSEARCH_INITIAL_ADMIN_PASSWORD" + } | tee -a $GITHUB_OUTPUT + if [[ "$RUNNER_OS" == "Linux" ]]; then sudo swapoff -a sudo sysctl -w vm.swappiness=1 @@ -64,7 +86,7 @@ runs: for attempt in {1..20}; do sleep 5 - if curl -k -sS --cacert ./client/.ci/certs/root-ca.crt -u admin:admin $url; then + if curl -k -sS --cacert ./client/.ci/certs/root-ca.crt -u admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} $URL; then echo '=====> ready' exit 0 fi diff --git a/.github/workflows/integration-yaml-tests.yml b/.github/workflows/integration-yaml-tests.yml index 9a44c4bb25..b8799a62fe 100644 --- a/.github/workflows/integration-yaml-tests.yml +++ b/.github/workflows/integration-yaml-tests.yml @@ -13,7 +13,17 @@ jobs: strategy: fail-fast: false matrix: - version: [ '1.2.4', '1.3.11', '2.2.0', '2.4.0', '2.6.0', '2.8.0', '2.9.0' ] + version: + - 2.11.1 + - 2.10.0 + - 2.8.0 + - 2.6.0 + - 2.4.1 + - 2.2.1 + - 2.0.1 + - 1.3.14 + - 1.2.4 + - 1.1.0 steps: - name: Checkout Client uses: actions/checkout@v3 @@ -99,13 +109,18 @@ jobs: uses: ./client/.github/actions/build-opensearch with: ref: ${{ matrix.opensearch_ref }} + security_plugin: true - name: Unpack OpenSearch - run: tar -xzf ${{ steps.opensearch_build.outputs.distribution }} + run: | + tar -xzf ${{ steps.opensearch_build.outputs.distribution }} \ + && ./opensearch-*/bin/opensearch-plugin install --batch file://$(realpath ./opensearch-security/build/distributions/opensearch-security-*-SNAPSHOT.zip) - name: Start OpenSearch id: opensearch uses: ./client/.github/actions/start-opensearch + with: + secured: true - name: Run YAML tests working-directory: client @@ -114,9 +129,12 @@ jobs: --project ./tests/Tests.YamlRunner/Tests.YamlRunner.fsproj \ -- \ --endpoint $OPENSEARCH_URL \ + --auth-cert ./.ci/certs/kirk.p12 \ + --auth-cert-pass kirk \ --junit-output-file ./test-results.xml env: OPENSEARCH_URL: ${{ steps.opensearch.outputs.opensearch_url }} + ADMIN_PASS: ${{ steps.opensearch.outputs.admin_password }} - name: Save OpenSearch logs if: failure() diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f102c1535a..b882ad77ec 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -17,17 +17,14 @@ jobs: fail-fast: false matrix: version: - - 2.9.0 + - 2.11.1 + - 2.10.0 - 2.8.0 - - 2.7.0 - 2.6.0 - - 2.5.0 - 2.4.1 - - 2.3.0 - 2.2.1 - - 2.1.0 - 2.0.1 - - 1.3.11 + - 1.3.14 - 1.2.4 - 1.1.0 @@ -50,7 +47,7 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - - run: "./build.sh integrate ${{ matrix.version }} readonly,writable random:test_only_one --report" + - run: "./build.sh integrate ${{ matrix.version }} readonly,replicatedreadonly,writable random:test_only_one --report" name: Integration Tests working-directory: client @@ -62,7 +59,6 @@ jobs: path: client/build/output/* integration-opensearch-unreleased: - if: false # TODO: Temporarily disabled due to failures building & running OpenSearch from source, pending investigation & fixes (https://github.com/opensearch-project/opensearch-net/issues/268) name: Integration OpenSearch Unreleased runs-on: ubuntu-latest strategy: @@ -101,7 +97,7 @@ jobs: knn_plugin: true plugins_output_directory: ${{ env.OPENSEARCH_PLUGINS_DIRECTORY }} - - run: "./build.sh integrate $OPENSEARCH_VERSION readonly,writable random:test_only_one --report" + - run: "./build.sh integrate $OPENSEARCH_VERSION readonly,replicatedreadonly,writable random:test_only_one --report" name: Integration Tests working-directory: client env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f07ef2ca..012959571f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,29 +7,35 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed naming of `ClusterManagerTimeout` and `MasterTimeout` properties from `*TimeSpanout` in the low-level client ([#332](https://github.com/opensearch-project/opensearch-net/pull/332)) ### Added -- Added `.Strict(...)`, `.Verbatim(...)`, `.Name(...)` methods on `QueryContainer` to help modify contained query attributes. +- Added support for the `Cat.PitSegments` and `Cat.SegmentReplication` APIs ([#527](https://github.com/opensearch-project/opensearch-net/pull/527)) +- Added `.Strict(...)`, `.Verbatim(...)`, `.Name(...)` methods on `QueryContainer` to help modify contained query attributes ([#509](https://github.com/opensearch-project/opensearch-net/pull/509)) ### Removed - Removed the `Features` API which is not supported by OpenSearch from the low-level client ([#331](https://github.com/opensearch-project/opensearch-net/pull/331)) - Removed the deprecated low-level `IndexTemplateV2` APIs in favour of the `ComposableIndexTemplate` APIs ([#437](https://github.com/opensearch-project/opensearch-net/pull/437)) ### Fixed -- Fix `HttpConnection.ConvertHttpMethod` to support `Patch` method ([#489](https://github.com/opensearch-project/opensearch-net/pull/489)) +- Fixed `HttpConnection.ConvertHttpMethod` to support `Patch` method ([#489](https://github.com/opensearch-project/opensearch-net/pull/489)) - Fixed `IEnumerable` property mapping. ([#503](https://github.com/opensearch-project/opensearch-net/pull/503)) ### Dependencies - Bumps `Microsoft.CodeAnalysis.CSharp` from 4.2.0 to 4.6.0 -- Bumps `NSwag.Core.Yaml` from 13.19.0 to 13.20.0 +- Bumps `NSwag.Core.Yaml` from 13.19.0 to 14.0.2 - Bumps `CSharpier.Core` from 0.25.0 to 0.26.7 - Bumps `System.Diagnostics.DiagnosticSource` from 6.0.1 to 8.0.0 - Bumps `Spectre.Console` from 0.47.0 to 0.48.0 - Bumps `System.Text.Encodings.Web` from 7.0.0 to 8.0.0 - Bumps `xunit.runner.visualstudio` from 2.5.4 to 2.5.6 -- Bumps `xunit` from 2.6.2 to 2.6.5 -- Bumps `Argu` from 6.1.1 to 6.1.4 +- Bumps `xunit` from 2.6.2 to 2.6.6 +- Bumps `Argu` from 6.1.1 to 6.1.5 - Bumps `Microsoft.NET.Test.Sdk` from 17.7.2 to 17.8.0 - Bumps `JetBrains.Annotations` from 2023.2.0 to 2023.3.0 - Bumps `Bogus` from 34.0.2 to 35.3.0 +- Bumps `Octokit` from 9.0.0 to 9.1.0 +- Bumps `FSharp.Core` from 8.0.100 to 8.0.101 +- Bumps `Proc` from 0.6.2 to 0.8.1 +- Bumps `System.Text.Json` from 8.0.0 to 8.0.1 +- Bumps `Bullseye` from 4.2.1 to 5.0.0 ## [1.6.0] ### Added @@ -141,4 +147,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) [1.6.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.5.0...v1.6.0 [1.5.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0 -[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0 +[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0 \ No newline at end of file diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/EphemeralCluster.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/EphemeralCluster.cs index bba2455f5f..f0e3769c96 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/EphemeralCluster.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/EphemeralCluster.cs @@ -34,6 +34,7 @@ using System.Security.Cryptography; using System.Text; using OpenSearch.OpenSearch.Managed; +using OpenSearch.OpenSearch.Managed.Configuration; using OpenSearch.Stack.ArtifactsApi; namespace OpenSearch.OpenSearch.Ephemeral @@ -59,6 +60,13 @@ protected EphemeralCluster(TConfiguration clusterConfiguration) : base(clusterCo protected EphemeralClusterComposer Composer { get; } + protected override void ModifyNodeConfiguration(NodeConfiguration nodeConfiguration, int port) + { + base.ModifyNodeConfiguration(nodeConfiguration, port); + + if (!ClusterConfiguration.EnableSsl) nodeConfiguration.Add("plugins.security.disabled", "true"); + } + public virtual ICollection NodesUris(string hostName = null) { hostName = hostName ?? (ClusterConfiguration.HttpFiddlerAware && Process.GetProcessesByName("fiddler").Any() diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs index 199e363e34..74441951ef 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -175,28 +175,35 @@ protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConso ExecuteBinaryInternal(config, writer, binary, description, null, arguments); protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) => - ExecuteBinaryInternal(config, writer, binary, description, startedHandler, arguments); + string binary, string description, IDictionary environmentVariables, + params string[] arguments) => + ExecuteBinaryInternal(config, writer, binary, description, environmentVariables, arguments); private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) + string binary, string description, IDictionary environmentVariables, params string[] arguments) { var command = $"{{{binary}}} {{{string.Join(" ", arguments)}}}"; writer?.WriteDiagnostic($"{{{nameof(ExecuteBinary)}}} starting process [{description}] {command}"); + var environment = new Dictionary + { + {config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath}, + {"OPENSEARCH_HOME", config.FileSystem.OpenSearchHome} + }; + + if (environmentVariables != null) + { + foreach (var kvp in environmentVariables) + environment[kvp.Key] = kvp.Value; + } + var timeout = TimeSpan.FromSeconds(420); var processStartArguments = new StartArguments(binary, arguments) { - Environment = new Dictionary - { - {config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath}, - {"OPENSEARCH_HOME", config.FileSystem.OpenSearchHome}, - } + Environment = environment }; - var result = startedHandler != null - ? Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter(), startedHandler) - : Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); + var result = Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); if (!result.Completed) throw new Exception($"Timeout while executing {description} exceeded {timeout}"); diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InitialConfiguration.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InitialConfiguration.cs index b938890102..9540c07edb 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InitialConfiguration.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InitialConfiguration.cs @@ -26,10 +26,12 @@ * under the License. */ +using System.Collections.Generic; using System.IO; using System.Linq; using OpenSearch.OpenSearch.Managed.ConsoleWriters; -using OpenSearch.Stack.ArtifactsApi; +using OpenSearch.Stack.ArtifactsApi.Products; +using SemanticVersioning; namespace OpenSearch.OpenSearch.Ephemeral.Tasks.InstallationTasks { @@ -38,30 +40,39 @@ public class InitialConfiguration : ClusterComposeTask public override void Run(IEphemeralCluster cluster) { var fs = cluster.FileSystem; - var configFile = Path.Combine(fs.OpenSearchHome, "config", "opensearch.yml"); - if (File.Exists(configFile) && File.ReadLines(configFile).Any(l => !string.IsNullOrWhiteSpace(l) && !l.StartsWith("#"))) - { - cluster.Writer?.WriteDiagnostic($"{{{nameof(InitialConfiguration)}}} opensearch.yml already exists, skipping initial configuration"); + var installConfigDir = Path.Combine(fs.OpenSearchHome, "config"); + var installConfigFile = Path.Combine(installConfigDir, "opensearch.yml"); + var pluginSecurity = Path.Combine(fs.OpenSearchHome, "plugins/opensearch-security"); + + if (!Directory.Exists(pluginSecurity)) return; - } - var securityInstallDemoConfigSubPath = "plugins/opensearch-security/tools/install_demo_configuration.sh"; - var securityInstallDemoConfig = Path.Combine(fs.OpenSearchHome, securityInstallDemoConfigSubPath); + var isNewDemoScript = cluster.ClusterConfiguration.Version.BaseVersion() >= new Version(2, 12, 0); + + const string securityInstallDemoConfigSubPath = "tools/install_demo_configuration.sh"; + var securityInstallDemoConfig = Path.Combine(pluginSecurity, securityInstallDemoConfigSubPath); cluster.Writer?.WriteDiagnostic($"{{{nameof(InitialConfiguration)}}} going to run [{securityInstallDemoConfigSubPath}]"); + if (File.Exists(installConfigFile) && File.ReadLines(installConfigFile).Any(l => l.Contains("plugins.security"))) return; + + var env = new Dictionary(); + var args = new List { securityInstallDemoConfig, "-y", "-i" }; + + if (isNewDemoScript) + { + env.Add("OPENSEARCH_INITIAL_ADMIN_PASSWORD", "admin"); + args.Add("-t"); + } + ExecuteBinary( cluster.ClusterConfiguration, cluster.Writer, "/bin/bash", "install security plugin demo configuration", - securityInstallDemoConfig, - "-y", "-i", "-s"); - - if (cluster.ClusterConfiguration.EnableSsl) return; - - File.AppendAllText(configFile, "plugins.security.disabled: true"); + env, + args.ToArray()); } } } diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs index c64501038e..3225476353 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs @@ -27,6 +27,7 @@ */ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; @@ -93,13 +94,22 @@ public override void Run(IEphemeralCluster cluste cluster.Writer?.WriteDiagnostic( $"{{{nameof(InstallPlugins)}}} attempting install [{plugin.SubProductName}] as it's not OOTB: {{{plugin.ShippedByDefaultAsOf}}} and valid for {v}: {{{plugin.IsValid(v)}}}"); - if (!Directory.Exists(fs.ConfigPath)) Directory.CreateDirectory(fs.ConfigPath); + var homeConfigPath = Path.Combine(fs.OpenSearchHome, "config"); + + if (!Directory.Exists(homeConfigPath)) Directory.CreateDirectory(homeConfigPath); + + var env = new Dictionary + { + { fs.ConfigEnvironmentVariableName, homeConfigPath } + }; + ExecuteBinary( cluster.ClusterConfiguration, cluster.Writer, fs.PluginBinary, $"install opensearch plugin: {plugin.SubProductName}", - "install --batch", GetPluginLocation(plugin, v)); + env, + "install", "--batch", GetPluginLocation(plugin, v)); CopyConfigDirectoryToHomeCacheConfigDirectory(cluster, plugin); } diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/ClusterBase.cs b/abstractions/src/OpenSearch.OpenSearch.Managed/ClusterBase.cs index 6b55e4aadf..3cdb74e966 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/ClusterBase.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/ClusterBase.cs @@ -131,11 +131,12 @@ public IDisposable Start(IConsoleLineHandler writer, TimeSpan waitForStarted) OnBeforeStart(); var subscriptions = new Subscriptions(); - foreach (var node in Nodes) subscriptions.Add(node.SubscribeLines(writer)); - var waitHandles = Nodes.Select(w => w.StartedHandle).ToArray(); - if (!WaitHandle.WaitAll(waitHandles, waitForStarted)) + foreach (var node in Nodes) { + subscriptions.Add(node.SubscribeLines(writer)); + if (node.WaitForStarted(waitForStarted)) continue; + var nodeExceptions = Nodes.Select(n => n.LastSeenException).Where(e => e != null).ToList(); writer?.WriteError( $"{{{GetType().Name}.{nameof(Start)}}} cluster did not start after {waitForStarted}"); diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs index 0ce531141c..ea34663ca7 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs @@ -56,18 +56,15 @@ public void Add(string setting) public void Add(string key, string value, string versionRange) => Add(new NodeSetting(key, value, versionRange)); - public string[] ToCommandLineArguments(OpenSearchVersion version) - { - var settingArgument = "-E "; - return this + public string[] ToCommandLineArguments(OpenSearchVersion version) => + this //if a node setting is only applicable for a certain version make sure its filtered out .Where(s => string.IsNullOrEmpty(s.VersionRange) || version.InRange(s.VersionRange)) //allow additional settings to take precedence over already DefaultNodeSettings //without relying on opensearch to dedup .GroupBy(setting => setting.Key) .Select(g => g.Last()) - .Select(s => s.Key.StartsWith(settingArgument) ? s.ToString() : $"{settingArgument}{s}") + .SelectMany(s => new[] { "-E", s.ToString() }) .ToArray(); - } } } diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj index 1024dfc8f4..1c002395de 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj @@ -13,7 +13,7 @@ - + diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearchNode.cs b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearchNode.cs index 62ad95b836..da8250901a 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearchNode.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearchNode.cs @@ -88,7 +88,10 @@ private static StartArguments StartArgs(NodeConfiguration config) private static Dictionary EnvVars(NodeConfiguration config) { - var environmentVariables = new Dictionary { { "OPENSEARCH_JAVA_OPTS", "-Xms1g -Xmx1g" } }; + var javaOpts = new List { "-Xms1g", "-Xmx1g" }; + + var environmentVariables = new Dictionary { { "OPENSEARCH_JAVA_OPTS", string.Join(" ", javaOpts) } }; + if (!string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath)) environmentVariables.Add(config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath); diff --git a/abstractions/src/OpenSearch.OpenSearch.Xunit/OpenSearch.OpenSearch.Xunit.csproj b/abstractions/src/OpenSearch.OpenSearch.Xunit/OpenSearch.OpenSearch.Xunit.csproj index b694ef4494..f525edfad5 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Xunit/OpenSearch.OpenSearch.Xunit.csproj +++ b/abstractions/src/OpenSearch.OpenSearch.Xunit/OpenSearch.OpenSearch.Xunit.csproj @@ -8,7 +8,7 @@ true - + diff --git a/abstractions/src/OpenSearch.Stack.ArtifactsApi/OpenSearch.Stack.ArtifactsApi.csproj b/abstractions/src/OpenSearch.Stack.ArtifactsApi/OpenSearch.Stack.ArtifactsApi.csproj index a4e5f13bdd..ca4753ac7a 100644 --- a/abstractions/src/OpenSearch.Stack.ArtifactsApi/OpenSearch.Stack.ArtifactsApi.csproj +++ b/abstractions/src/OpenSearch.Stack.ArtifactsApi/OpenSearch.Stack.ArtifactsApi.csproj @@ -13,7 +13,7 @@ - + diff --git a/build/scripts/Building.fs b/build/scripts/Building.fs index 19da39c0ee..93fbdebb65 100644 --- a/build/scripts/Building.fs +++ b/build/scripts/Building.fs @@ -124,29 +124,30 @@ module Build = Shell.rm nuspec deps - - - let rewriteLibFolder libFolder project nugetId dependencies = + + + let rewriteLibFolder libFolder project nugetId dependencies = let info = DirectoryInfo libFolder let tfm = info.Name let fullPath = Path.GetFullPath libFolder - - let mainDll = sprintf "%s.dll" (Path.Combine(fullPath, project)) + + let mainDll = sprintf "%s.dll" (Path.Combine(fullPath, project)) let renamedDll dll = dll |> String.replace ".dll" (sprintf "%i.dll" version.Full.Major) - + printfn "dll: %s Nuget id: %s dependencies: %A" mainDll nugetId dependencies let depAssemblies = dependencies |> Seq.map (fun d -> sprintf "%s.dll" (Path.Combine(Paths.InplaceBuildOutput project tfm, d))) - let dlls = + let args = [mainDll] |> Seq.append depAssemblies |> Seq.map (fun dll -> - sprintf @"-i ""%s"" -o ""%s"" -k ""%s""" dll (renamedDll dll) keyFile + ["-i"; dll; "-o"; renamedDll dll; "-k"; keyFile] ) - - ReposTooling.Rewriter dlls - + |> Seq.concat + + ReposTooling.Rewriter args + Shell.rm mainDll let mainPdb = sprintf "%s.pdb" (Path.Combine(fullPath, project)) if File.exists mainPdb then Shell.rm mainPdb diff --git a/build/scripts/ReposTooling.fs b/build/scripts/ReposTooling.fs index cdd01f8cfe..2005a5a0ad 100644 --- a/build/scripts/ReposTooling.fs +++ b/build/scripts/ReposTooling.fs @@ -64,17 +64,16 @@ module ReposTooling = let folder = Path.getDirectory (Paths.TestProjFile "Tests.YamlRunner") let timeout = TimeSpan.FromMinutes(120.) Tooling.DotNet.ExecInWithTimeout folder (["run"; "--" ] @ args) timeout |> ignore - - + + let restoreOnce = lazy(Tooling.DotNet.Exec ["tool"; "restore"]) - + let private differ = "assembly-differ" let Differ args = restoreOnce.Force() - - let args = args |> String.concat " " - let command = sprintf @"%s %s -o ../../%s" differ args Paths.BuildOutput - Tooling.DotNet.ExecIn Paths.TargetsFolder [command] |> ignore + + let args = [differ] @ args @ ["-o"; $"../../{Paths.BuildOutput}"] + Tooling.DotNet.ExecIn Paths.TargetsFolder args let private assemblyRewriter = "assembly-rewriter" let Rewriter args = diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index a9d0c02e02..4bd89ab2a0 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -32,7 +32,7 @@ license-header-fs.txt - + @@ -43,7 +43,7 @@ - - + + diff --git a/guides/document-lifecycle.md b/guides/document-lifecycle.md index e0746f7e7c..67cb37588d 100644 --- a/guides/document-lifecycle.md +++ b/guides/document-lifecycle.md @@ -7,7 +7,7 @@ Assuming you have OpenSearch running locally on port 9200, you can create a clie var node = new Uri("https://localhost:9200"); var config = new ConnectionSettings(node) .ServerCertificateValidationCallback(CertificateValidations.AllowAll) - .BasicAuthentication("admin", "admin") + .BasicAuthentication("admin", ) .DisableDirectStreaming(); var client = new OpenSearchClient(config); diff --git a/guides/index-template.md b/guides/index-template.md index 495d873b39..81049f128b 100644 --- a/guides/index-template.md +++ b/guides/index-template.md @@ -12,7 +12,7 @@ using OpenSearch.Net; var node = new Uri("https://localhost:9200"); var config = new ConnectionSettings(node) .ServerCertificateValidationCallback(CertificateValidations.AllowAll) - .BasicAuthentication("admin", "admin"); + .BasicAuthentication("admin", ); var client = new OpenSearchClient(config);; ``` diff --git a/guides/search.md b/guides/search.md index ed8d022a97..e7f00e4bec 100644 --- a/guides/search.md +++ b/guides/search.md @@ -12,7 +12,7 @@ var node = new Uri("https://localhost:9200"); var config = new ConnectionSettings(node) .ThrowExceptions() .ServerCertificateValidationCallback(CertificateValidations.AllowAll) - .BasicAuthentication("admin", "admin"); + .BasicAuthentication("admin", ); var client = new OpenSearchClient(config); class Movie diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index a08718a948..51a8bcad8d 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 7be3540059..00cd565c42 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -41,20 +41,8 @@ public static class CodeConfiguration { new("{create,delete}_pit"), new("{delete,get}_all_pits"), - - new("cat.aliases"), - new("cat.allocation"), - new("cat.cluster_manager"), - new("cat.count"), - new("cat.fielddata"), - new("cat.health"), - new("cat.help"), - new("cat.indices"), - new("cat.master"), - new("cat.nodeattrs"), - new("cat.nodes"), - new("cat.pending_tasks"), + new("cat.*"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index 924d029be3..bb15270ef1 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -2632,13 +2632,80 @@ } } }, + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + } + ], "responses": { "200": { "description": "CatPitSegments 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CatPitSegmentsResponseContent" + "$ref": "#/components/schemas/CatPitSegmentsOutputPayload" } } } @@ -2656,13 +2723,80 @@ "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/" }, "operationId": "CatAllPitSegments", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + } + ], "responses": { "200": { "description": "CatAllPitSegments 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CatAllPitSegmentsResponseContent" + "$ref": "#/components/schemas/CatAllPitSegmentsOutputPayload" } } } @@ -3174,6 +3308,89 @@ "description": "A short version of the Accept header, e.g. json, yaml." } }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, { "name": "active_only", "in": "query", @@ -3226,30 +3443,6 @@ }, "explode": true }, - { - "name": "h", - "in": "query", - "description": "Comma-separated list of column names to display.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names to display." - }, - "explode": true - }, - { - "name": "help", - "in": "query", - "description": "Return help information.", - "schema": { - "type": "boolean", - "default": false, - "description": "Return help information." - } - }, { "name": "index", "in": "query", @@ -3264,20 +3457,6 @@ }, "explode": true }, - { - "name": "s", - "in": "query", - "description": "Comma-separated list of column names or column aliases to sort by.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names or column aliases to sort by." - }, - "explode": true - }, { "name": "time", "in": "query", @@ -3287,23 +3466,31 @@ } }, { - "name": "v", + "name": "timeout", "in": "query", - "description": "Verbose mode. Display column headers.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "default": false, - "description": "Verbose mode. Display column headers." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "CatSegmentReplication 200 response" + "description": "CatSegmentReplication 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatSegmentReplicationOutputPayload" + } + } + } } }, "x-operation-group": "cat.segment_replication", - "x-version-added": "1.0" + "x-version-added": "2.6.0" } }, "/_cat/segment_replication/{index}": { @@ -3332,6 +3519,89 @@ "description": "A short version of the Accept header, e.g. json, yaml." } }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, { "name": "active_only", "in": "query", @@ -3384,30 +3654,6 @@ }, "explode": true }, - { - "name": "h", - "in": "query", - "description": "Comma-separated list of column names to display.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names to display." - }, - "explode": true - }, - { - "name": "help", - "in": "query", - "description": "Return help information.", - "schema": { - "type": "boolean", - "default": false, - "description": "Return help information." - } - }, { "name": "index", "in": "query", @@ -3422,20 +3668,6 @@ }, "explode": true }, - { - "name": "s", - "in": "query", - "description": "Comma-separated list of column names or column aliases to sort by.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names or column aliases to sort by." - }, - "explode": true - }, { "name": "time", "in": "query", @@ -3445,23 +3677,31 @@ } }, { - "name": "v", + "name": "timeout", "in": "query", - "description": "Verbose mode. Display column headers.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "default": false, - "description": "Verbose mode. Display column headers." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "CatSegmentReplication_WithIndex 200 response" + "description": "CatSegmentReplication_WithIndex 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatSegmentReplication_WithIndexOutputPayload" + } + } + } } }, "x-operation-group": "cat.segment_replication", - "x-version-added": "1.0" + "x-version-added": "2.6.0" } }, "/_cat/segments": { @@ -8032,6 +8272,16 @@ "type": "boolean", "description": "Specify whether the operation should only expunge deleted documents." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } } ], "responses": { @@ -10494,7 +10744,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -10634,7 +10885,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -11282,7 +11534,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -11434,7 +11687,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -14875,6 +15129,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -15353,11 +15616,20 @@ { "name": "rest_total_hits_as_int", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." } } ], @@ -21175,6 +21447,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the cloned index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -21269,6 +21562,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the cloned index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -22364,7 +22678,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -22961,7 +23275,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -23109,7 +23423,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -23928,6 +24242,16 @@ "type": "boolean", "description": "Specify whether the operation should only expunge deleted documents." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } } ], "responses": { @@ -25350,6 +25674,27 @@ "type": "string", "description": "Sets the number of active shards to wait for before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -26092,6 +26437,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -26595,6 +26949,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -26671,8 +27034,9 @@ "description": "Specify the keep alive for point in time.", "schema": { "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Specify the keep alive for point in time.", - "x-data-type": "time" + "x-data-type": "time" } }, { @@ -27788,6 +28152,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -27892,6 +28277,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -28282,6 +28688,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -28386,6 +28813,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -30435,27 +30883,29 @@ "pb" ] }, - "CatAllPitSegmentsResponseContent": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/CatPitSegment" - } + "CatAllPitSegmentsOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatPitSegmentsRecord" + } + }, + "CatPitSegmentsOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatPitSegmentsRecord" } }, - "CatPitSegment": { + "CatPitSegmentsRecord": { "type": "object", "properties": { "index": { "type": "string" }, "shard": { - "type": "integer", - "format": "int32" + "type": "string" }, "prirep": { - "type": "boolean", - "description": "Set to true to return stats only for primary shards." + "type": "string" }, "ip": { "type": "string" @@ -30464,43 +30914,31 @@ "type": "string" }, "generation": { - "type": "integer", - "format": "int32" + "type": "string" }, - "docs_count": { - "type": "integer", - "format": "int32" + "docs.count": { + "type": "string" }, - "docs_deleted": { - "type": "integer", - "format": "int32" + "docs.deleted": { + "type": "string" }, "size": { "type": "string" }, - "size_memory": { - "type": "integer", - "format": "int32" + "size.memory": { + "type": "string" }, "committed": { - "type": "boolean" + "type": "string" }, "searchable": { - "type": "boolean" + "type": "string" }, "version": { "type": "string" }, "compound": { - "type": "boolean" - } - } - }, - "CatPitSegmentsResponseContent": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/CatPitSegment" + "type": "string" } } }, @@ -30518,6 +30956,98 @@ "pit_id" ] }, + "CatSegmentReplicationOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatSegmentReplicationRecord" + } + }, + "CatSegmentReplicationRecord": { + "type": "object", + "properties": { + "shardId": { + "type": "string" + }, + "target_node": { + "type": "string" + }, + "target_host": { + "type": "string" + }, + "checkpoints_behind": { + "type": "string" + }, + "bytes_behind": { + "type": "string" + }, + "current_lag": { + "type": "string" + }, + "last_completed_lag": { + "type": "string" + }, + "rejected_requests": { + "type": "string" + }, + "stage": { + "type": "string" + }, + "time": { + "type": "string" + }, + "files_fetched": { + "type": "string" + }, + "files_percent": { + "type": "string" + }, + "bytes_fetched": { + "type": "string" + }, + "bytes_percent": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "stop_time": { + "type": "string" + }, + "files": { + "type": "string" + }, + "files_total": { + "type": "string" + }, + "bytes": { + "type": "string" + }, + "bytes_total": { + "type": "string" + }, + "replicating_stage_time_taken": { + "type": "string" + }, + "get_checkpoint_info_stage_time_taken": { + "type": "string" + }, + "file_diff_stage_time_taken": { + "type": "string" + }, + "get_files_stage_time_taken": { + "type": "string" + }, + "finalize_replication_stage_time_taken": { + "type": "string" + } + } + }, + "CatSegmentReplication_WithIndexOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatSegmentReplicationRecord" + } + }, "CertificatesDetail": { "type": "object", "properties": { @@ -30720,7 +31250,7 @@ "pit_id": { "type": "string" }, - "_shard": { + "_shards": { "$ref": "#/components/schemas/ShardStatistics" }, "creation_time": { @@ -31513,7 +32043,7 @@ }, "OpType": { "type": "string", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "enum": [ "index", "create" diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index dba4eda9d9..8937a41d24 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,15 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatPlugins = new ApiUrls(new[]{"_cat/plugins"}); - internal static ApiUrls CatRecovery = new ApiUrls(new[]{"_cat/recovery", "_cat/recovery/{index}"}); - internal static ApiUrls CatRepositories = new ApiUrls(new[]{"_cat/repositories"}); - internal static ApiUrls CatSegments = new ApiUrls(new[]{"_cat/segments", "_cat/segments/{index}"}); - internal static ApiUrls CatShards = new ApiUrls(new[]{"_cat/shards", "_cat/shards/{index}"}); - internal static ApiUrls CatSnapshots = new ApiUrls(new[]{"_cat/snapshots", "_cat/snapshots/{repository}"}); - internal static ApiUrls CatTasks = new ApiUrls(new[]{"_cat/tasks"}); - internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"}); - internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"}); internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"}); internal static ApiUrls NoNamespaceCount = new ApiUrls(new[]{"_count", "{index}/_count"}); internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[]{"{index}/_create/{id}"}); diff --git a/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRecord.cs b/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRecord.cs new file mode 100644 index 0000000000..2591dd873e --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRecord.cs @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +using System.Runtime.Serialization; + +namespace OpenSearch.Client; + +[DataContract] +public class CatAllPitSegmentsRecord : CatPitSegmentsRecord { } diff --git a/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRequest.cs b/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRequest.cs new file mode 100644 index 0000000000..b88c25d0eb --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatPitSegments/CatAllPitSegmentsRequest.cs @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +namespace OpenSearch.Client; + +[MapsApi("cat.all_pit_segments")] +public partial interface ICatAllPitSegmentsRequest { } + +public partial class CatAllPitSegmentsRequest { } + +public partial class CatAllPitSegmentsDescriptor { } diff --git a/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRecord.cs b/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRecord.cs new file mode 100644 index 0000000000..29876ec081 --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRecord.cs @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +using System.Runtime.Serialization; + +namespace OpenSearch.Client; + +[DataContract] +public class CatPitSegmentsRecord : ICatRecord +{ + [DataMember(Name = "committed")] + public string Committed { get; set; } + + [DataMember(Name = "compound")] + public string Compound { get; set; } + + [DataMember(Name = "docs.count")] + public string DocsCount { get; set; } + + [DataMember(Name = "docs.deleted")] + public string DocsDeleted { get; set; } + + [DataMember(Name = "generation")] + public string Generation { get; set; } + + [DataMember(Name = "id")] + public string Id { get; set; } + + [DataMember(Name = "index")] + public string Index { get; set; } + + [DataMember(Name = "ip")] + public string Ip { get; set; } + + [DataMember(Name = "prirep")] + public string PrimaryOrReplica { get; set; } + + [DataMember(Name = "searchable")] + public string Searchable { get; set; } + + [DataMember(Name = "segment")] + public string Segment { get; set; } + + [DataMember(Name = "shard")] + public string Shard { get; set; } + + [DataMember(Name = "size")] + public string Size { get; set; } + + [DataMember(Name = "size.memory")] + public string SizeMemory { get; set; } + + [DataMember(Name = "version")] + public string Version { get; set; } +} diff --git a/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRequest.cs b/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRequest.cs new file mode 100644 index 0000000000..352d7cb010 --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatPitSegments/CatPitSegmentsRequest.cs @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using OpenSearch.Net.Utf8Json; + +namespace OpenSearch.Client; + +[MapsApi("cat.pit_segments")] +[ReadAs(typeof(CatPitSegmentsRequest))] +public partial interface ICatPitSegmentsRequest +{ + [DataMember(Name = "pit_id")] + IEnumerable PitId { get; set; } +} + +public partial class CatPitSegmentsRequest +{ + [SerializationConstructor] + public CatPitSegmentsRequest() { } + + public CatPitSegmentsRequest(IEnumerable pitId) : this(pitId?.ToArray()) { } + + public CatPitSegmentsRequest(params string[] pitId) => PitId = pitId; + + public IEnumerable PitId { get; set; } +} + +public partial class CatPitSegmentsDescriptor +{ + IEnumerable ICatPitSegmentsRequest.PitId { get; set; } + + public CatPitSegmentsDescriptor PitId(IEnumerable pitId) => + Assign(pitId?.ToArray(), (r, v) => r.PitId = v); + + public CatPitSegmentsDescriptor PitId(params string[] pitId) => + Assign(pitId, (r, v) => r.PitId = v); +} diff --git a/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs new file mode 100644 index 0000000000..065954293a --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +using System.Runtime.Serialization; + +namespace OpenSearch.Client; + +[DataContract] +public class CatSegmentReplicationRecord : ICatRecord +{ + [DataMember(Name = "shardId")] + public string ShardId { get; set; } + + [DataMember(Name = "target_node")] + public string TargetNode { get; set; } + + [DataMember(Name = "target_host")] + public string TargetHost { get; set; } + + [DataMember(Name = "checkpoints_behind")] + public string CheckpointsBehind { get; set; } + + [DataMember(Name = "bytes_behind")] + public string BytesBehind { get; set; } + + [DataMember(Name = "current_lag")] + public string CurrentLag { get; set; } + + [DataMember(Name = "last_completed_lag")] + public string LastCompletedLag { get; set; } + + [DataMember(Name = "rejected_requests")] + public string RejectedRequests { get; set; } + + [DataMember(Name = "stage")] + public string Stage { get; set; } + + [DataMember(Name = "time")] + public string Time { get; set; } + + [DataMember(Name = "files_fetched")] + public string FilesFetched { get; set; } + + [DataMember(Name = "files_percent")] + public string FilesPercent { get; set; } + + [DataMember(Name = "bytes_fetched")] + public string BytesFetched { get; set; } + + [DataMember(Name = "bytes_percent")] + public string BytesPercent { get; set; } + + [DataMember(Name = "start_time")] + public string StartTime { get; set; } + + [DataMember(Name = "stop_time")] + public string StopTime { get; set; } + + [DataMember(Name = "files")] + public string Files { get; set; } + + [DataMember(Name = "files_total")] + public string FilesTotal { get; set; } + + [DataMember(Name = "bytes")] + public string Bytes { get; set; } + + [DataMember(Name = "bytes_total")] + public string BytesTotal { get; set; } + + [DataMember(Name = "replicating_stage_time_taken")] + public string ReplicatingStageTimeTaken { get; set; } + + [DataMember(Name = "get_checkpoint_info_stage_time_taken")] + public string GetCheckpointInfoStageTimeTaken { get; set; } + + [DataMember(Name = "file_diff_stage_time_taken")] + public string FileDiffStageTimeTaken { get; set; } + + [DataMember(Name = "get_files_stage_time_taken")] + public string GetFilesStageTimeTaken { get; set; } + + [DataMember(Name = "finalize_replication_stage_time_taken")] + public string FinalizeReplicationStageTimeTaken { get; set; } +} diff --git a/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs new file mode 100644 index 0000000000..55bdbe6d7f --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +namespace OpenSearch.Client; + +[MapsApi("cat.segment_replication")] +public partial interface ICatSegmentReplicationRequest { } + +public partial class CatSegmentReplicationRequest { } + +public partial class CatSegmentReplicationDescriptor { } diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs deleted file mode 100644 index 94a072c8b9..0000000000 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ /dev/null @@ -1,388 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Linq.Expressions; -using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable RedundantBaseConstructorCall -// ReSharper disable UnusedTypeParameter -// ReSharper disable PartialMethodWithSinglePart -// ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client -{ - ///Descriptor for Plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - public partial class CatPluginsDescriptor : RequestDescriptorBase, ICatPluginsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatPlugins; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatPluginsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatPluginsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatPluginsDescriptor Help(bool? help = true) => Qs("help", help); - ///Include bootstrap plugins in the response - public CatPluginsDescriptor IncludeBootstrap(bool? includebootstrap = true) => Qs("include_bootstrap", includebootstrap); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatPluginsDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatPluginsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatPluginsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatPluginsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatPluginsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - public partial class CatRecoveryDescriptor : RequestDescriptorBase, ICatRecoveryRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRecovery; - ////_cat/recovery - public CatRecoveryDescriptor(): base() - { - } - - ////_cat/recovery/{index} - ///Optional, accepts null - public CatRecoveryDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatRecoveryRequest.Index => Self.RouteValues.Get("index"); - ///Comma-separated list or wildcard expression of index names to limit the returned information - public CatRecoveryDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatRecoveryDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatRecoveryDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///If `true`, the response only includes ongoing shard recoveries - public CatRecoveryDescriptor ActiveOnly(bool? activeonly = true) => Qs("active_only", activeonly); - ///The unit in which to display byte values - public CatRecoveryDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///If `true`, the response includes detailed information about shard recoveries - public CatRecoveryDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); - ///a short version of the Accept header, e.g. json, yaml - public CatRecoveryDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatRecoveryDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatRecoveryDescriptor Help(bool? help = true) => Qs("help", help); - ///Comma-separated list of column names or column aliases to sort by - public CatRecoveryDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatRecoveryDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - public partial class CatRepositoriesDescriptor : RequestDescriptorBase, ICatRepositoriesRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRepositories; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatRepositoriesDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatRepositoriesDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatRepositoriesDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node - public CatRepositoriesDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatRepositoriesDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatRepositoriesDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatRepositoriesDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatRepositoriesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - public partial class CatSegmentsDescriptor : RequestDescriptorBase, ICatSegmentsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegments; - ////_cat/segments - public CatSegmentsDescriptor(): base() - { - } - - ////_cat/segments/{index} - ///Optional, accepts null - public CatSegmentsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatSegmentsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to limit the returned information - public CatSegmentsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatSegmentsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatSegmentsDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///The unit in which to display byte values - public CatSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///a short version of the Accept header, e.g. json, yaml - public CatSegmentsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatSegmentsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatSegmentsDescriptor Help(bool? help = true) => Qs("help", help); - ///Comma-separated list of column names or column aliases to sort by - public CatSegmentsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatSegmentsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - public partial class CatShardsDescriptor : RequestDescriptorBase, ICatShardsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatShards; - ////_cat/shards - public CatShardsDescriptor(): base() - { - } - - ////_cat/shards/{index} - ///Optional, accepts null - public CatShardsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatShardsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to limit the returned information - public CatShardsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatShardsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatShardsDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///The unit in which to display byte values - public CatShardsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///a short version of the Accept header, e.g. json, yaml - public CatShardsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatShardsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatShardsDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatShardsDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatShardsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatShardsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatShardsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatShardsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - public partial class CatSnapshotsDescriptor : RequestDescriptorBase, ICatSnapshotsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSnapshots; - ////_cat/snapshots - public CatSnapshotsDescriptor(): base() - { - } - - ////_cat/snapshots/{repository} - ///Optional, accepts null - public CatSnapshotsDescriptor(Names repository): base(r => r.Optional("repository", repository)) - { - } - - // values part of the url path - Names ICatSnapshotsRequest.RepositoryName => Self.RouteValues.Get("repository"); - ///Name of repository from which to fetch the snapshot information - public CatSnapshotsDescriptor RepositoryName(Names repository) => Assign(repository, (a, v) => a.RouteValues.Optional("repository", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatSnapshotsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatSnapshotsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatSnapshotsDescriptor Help(bool? help = true) => Qs("help", help); - ///Set to true to ignore unavailable snapshots - public CatSnapshotsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatSnapshotsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatSnapshotsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatSnapshotsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatSnapshotsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - public partial class CatTasksDescriptor : RequestDescriptorBase, ICatTasksRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTasks; - // values part of the url path - // Request parameters - ///A comma-separated list of actions that should be returned. Leave empty to return all. - public CatTasksDescriptor Actions(params string[] actions) => Qs("actions", actions); - ///Return detailed task information (default: false) - public CatTasksDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); - ///a short version of the Accept header, e.g. json, yaml - public CatTasksDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatTasksDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatTasksDescriptor Help(bool? help = true) => Qs("help", help); - ///A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - public CatTasksDescriptor Nodes(params string[] nodes) => Qs("nodes", nodes); - ///Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - public CatTasksDescriptor ParentTaskId(string parenttaskid) => Qs("parent_task_id", parenttaskid); - ///Comma-separated list of column names or column aliases to sort by - public CatTasksDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatTasksDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for Templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class CatTemplatesDescriptor : RequestDescriptorBase, ICatTemplatesRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTemplates; - ////_cat/templates - public CatTemplatesDescriptor(): base() - { - } - - ////_cat/templates/{name} - ///Optional, accepts null - public CatTemplatesDescriptor(Name name): base(r => r.Optional("name", name)) - { - } - - // values part of the url path - Name ICatTemplatesRequest.Name => Self.RouteValues.Get("name"); - ///A pattern that returned template names must match - public CatTemplatesDescriptor Name(Name name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatTemplatesDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatTemplatesDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatTemplatesDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatTemplatesDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatTemplatesDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatTemplatesDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatTemplatesDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatTemplatesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - - ///Descriptor for ThreadPool https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - public partial class CatThreadPoolDescriptor : RequestDescriptorBase, ICatThreadPoolRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatThreadPool; - ////_cat/thread_pool - public CatThreadPoolDescriptor(): base() - { - } - - ////_cat/thread_pool/{thread_pool_patterns} - ///Optional, accepts null - public CatThreadPoolDescriptor(Names threadPoolPatterns): base(r => r.Optional("thread_pool_patterns", threadPoolPatterns)) - { - } - - // values part of the url path - Names ICatThreadPoolRequest.ThreadPoolPatterns => Self.RouteValues.Get("thread_pool_patterns"); - ///A comma-separated list of regular-expressions to filter the thread pools in the output - public CatThreadPoolDescriptor ThreadPoolPatterns(Names threadPoolPatterns) => Assign(threadPoolPatterns, (a, v) => a.RouteValues.Optional("thread_pool_patterns", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatThreadPoolDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatThreadPoolDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatThreadPoolDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatThreadPoolDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatThreadPoolDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatThreadPoolDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatThreadPoolDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatThreadPoolDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } -} diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs deleted file mode 100644 index e34740a232..0000000000 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ /dev/null @@ -1,279 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Threading; -using System.Threading.Tasks; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable once CheckNamespace -// ReSharper disable RedundantTypeArgumentsOfMethod -namespace OpenSearch.Client.Specification.CatApi -{ - /// - /// Cat APIs. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial class CatNamespace : NamespacedClientProxy - { - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public CatResponse Plugins(Func selector = null) => Plugins(selector.InvokeOrDefault(new CatPluginsDescriptor())); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public Task> PluginsAsync(Func selector = null, CancellationToken ct = default) => PluginsAsync(selector.InvokeOrDefault(new CatPluginsDescriptor()), ct); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public CatResponse Plugins(ICatPluginsRequest request) => DoCat(request); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public Task> PluginsAsync(ICatPluginsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public CatResponse Recovery(Func selector = null) => Recovery(selector.InvokeOrDefault(new CatRecoveryDescriptor())); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public Task> RecoveryAsync(Func selector = null, CancellationToken ct = default) => RecoveryAsync(selector.InvokeOrDefault(new CatRecoveryDescriptor()), ct); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public CatResponse Recovery(ICatRecoveryRequest request) => DoCat(request); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public Task> RecoveryAsync(ICatRecoveryRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public CatResponse Repositories(Func selector = null) => Repositories(selector.InvokeOrDefault(new CatRepositoriesDescriptor())); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public Task> RepositoriesAsync(Func selector = null, CancellationToken ct = default) => RepositoriesAsync(selector.InvokeOrDefault(new CatRepositoriesDescriptor()), ct); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public CatResponse Repositories(ICatRepositoriesRequest request) => DoCat(request); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public Task> RepositoriesAsync(ICatRepositoriesRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public CatResponse Segments(Func selector = null) => Segments(selector.InvokeOrDefault(new CatSegmentsDescriptor())); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public Task> SegmentsAsync(Func selector = null, CancellationToken ct = default) => SegmentsAsync(selector.InvokeOrDefault(new CatSegmentsDescriptor()), ct); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public CatResponse Segments(ICatSegmentsRequest request) => DoCat(request); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public Task> SegmentsAsync(ICatSegmentsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public CatResponse Shards(Func selector = null) => Shards(selector.InvokeOrDefault(new CatShardsDescriptor())); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public Task> ShardsAsync(Func selector = null, CancellationToken ct = default) => ShardsAsync(selector.InvokeOrDefault(new CatShardsDescriptor()), ct); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public CatResponse Shards(ICatShardsRequest request) => DoCat(request); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public Task> ShardsAsync(ICatShardsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public CatResponse Snapshots(Func selector = null) => Snapshots(selector.InvokeOrDefault(new CatSnapshotsDescriptor())); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public Task> SnapshotsAsync(Func selector = null, CancellationToken ct = default) => SnapshotsAsync(selector.InvokeOrDefault(new CatSnapshotsDescriptor()), ct); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public CatResponse Snapshots(ICatSnapshotsRequest request) => DoCat(request); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public Task> SnapshotsAsync(ICatSnapshotsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public CatResponse Tasks(Func selector = null) => Tasks(selector.InvokeOrDefault(new CatTasksDescriptor())); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public Task> TasksAsync(Func selector = null, CancellationToken ct = default) => TasksAsync(selector.InvokeOrDefault(new CatTasksDescriptor()), ct); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public CatResponse Tasks(ICatTasksRequest request) => DoCat(request); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public Task> TasksAsync(ICatTasksRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public CatResponse Templates(Func selector = null) => Templates(selector.InvokeOrDefault(new CatTemplatesDescriptor())); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task> TemplatesAsync(Func selector = null, CancellationToken ct = default) => TemplatesAsync(selector.InvokeOrDefault(new CatTemplatesDescriptor()), ct); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public CatResponse Templates(ICatTemplatesRequest request) => DoCat(request); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task> TemplatesAsync(ICatTemplatesRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public CatResponse ThreadPool(Func selector = null) => ThreadPool(selector.InvokeOrDefault(new CatThreadPoolDescriptor())); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public Task> ThreadPoolAsync(Func selector = null, CancellationToken ct = default) => ThreadPoolAsync(selector.InvokeOrDefault(new CatThreadPoolDescriptor()), ct); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public CatResponse ThreadPool(ICatThreadPoolRequest request) => DoCat(request); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public Task> ThreadPoolAsync(ICatThreadPoolRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - } -} diff --git a/src/OpenSearch.Client/OpenSearchClient.cs b/src/OpenSearch.Client/OpenSearchClient.cs index 77ca1c7206..c81ba9d6ee 100644 --- a/src/OpenSearch.Client/OpenSearchClient.cs +++ b/src/OpenSearch.Client/OpenSearchClient.cs @@ -220,7 +220,7 @@ Action forceConfiguration var url = request.GetUrl(ConnectionSettings); var method = request.HttpMethod; - var body = method == HttpMethod.GET || method == HttpMethod.HEAD || !parameters.SupportsBody ? null : bodySelector(request); + var body = !parameters.SupportsBody ? null : bodySelector(request); return (method, url, body); } diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs deleted file mode 100644 index 58769013d6..0000000000 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ /dev/null @@ -1,848 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Linq.Expressions; -using System.Runtime.Serialization; -using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable RedundantBaseConstructorCall -// ReSharper disable UnusedTypeParameter -// ReSharper disable PartialMethodWithSinglePart -// ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client -{ - [InterfaceDataContract] - public partial interface ICatPluginsRequest : IRequest - { - } - - ///Request for Plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - public partial class CatPluginsRequest : PlainRequestBase, ICatPluginsRequest - { - protected ICatPluginsRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatPlugins; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Include bootstrap plugins in the response - public bool? IncludeBootstrap - { - get => Q("include_bootstrap"); - set => Q("include_bootstrap", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q