From 8a40729a282af543812922a2ba64cc4bf4233ca2 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 08:56:43 +0100 Subject: [PATCH 1/6] [API] Updates generator, removes exceptions for private apis --- elasticsearch-api/utils/thor/endpoint_spec.rb | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/elasticsearch-api/utils/thor/endpoint_spec.rb b/elasticsearch-api/utils/thor/endpoint_spec.rb index a309cbb9e..6b7aca4bd 100644 --- a/elasticsearch-api/utils/thor/endpoint_spec.rb +++ b/elasticsearch-api/utils/thor/endpoint_spec.rb @@ -24,23 +24,6 @@ module API class EndpointSpec include EndpointSpecifics - # These APIs are private, but were added in 8.x since the generator didn't consider - # visibility. They will be removed in 9.x since we're using a different generator that - # considers visibility. But new private APIs code won't be generated for the client. - EXCLUDED_8X = [ - 'autoscaling.delete_autoscaling_policy', 'autoscaling.get_autoscaling_capacity', - 'autoscaling.get_autoscaling_policy', 'autoscaling.put_autoscaling_policy', 'capabilities', - 'connector.secret_delete', 'connector.secret_get', 'connector.secret_post', - 'connector.secret_put', 'fleet.delete_secret', 'fleet.get_secret', 'fleet.post_secret', - 'ml.validate', 'ml.validate_detector', 'monitoring.bulk', 'profiling.flamegraph', - 'profiling.stacktraces', 'profiling.status', 'profiling.topn_functions', - 'security.activate_user_profile', 'security.disable_user_profile', - 'security.enable_user_profile', 'security.get_user_profile', - 'security.has_privileges_user_profile', 'security.suggest_user_profiles', - 'security.update_user_profile_data', 'shutdown.delete_node', 'shutdown.get_node', - 'shutdown.put_node' - ].freeze - def initialize(filepath) @path = Pathname(filepath) json = MultiJson.load(File.read(@path)) @@ -93,9 +76,7 @@ def visibility end def skippable? - return true if module_namespace.flatten.first == '_internal' - - visibility != 'public' && !EXCLUDED_8X.include?(endpoint_name) + module_namespace.flatten.first == '_internal' || visibility != 'public' end # Function that adds the listified h param code From 506a9dffc342d1ba9887f848e677b6c4515eef3d Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 08:59:15 +0100 Subject: [PATCH 2/6] [API] Removes private APIs autoscaling.delete_autoscaling_policy.rb autoscaling.get_autoscaling_capacity.rb autoscaling.get_autoscaling_policy.rb autoscaling.put_autoscaling_policy.rb capabilities.rb connector.secret_delete.rb connector.secret_get.rb connector.secret_post.rb connector.secret_put.rb fleet.delete_secret.rb fleet.get_secret.rb fleet.post_secret.rb machine_learning.validate.rb machine_learning.validate_detector.rb monitoring.bulk.rb profiling.flamegraph.rb profiling.stacktraces.rb profiling.status.rb profiling.topn_functions.rb security.activate_user_profile.rb security.disable_user_profile.rb security.enable_user_profile.rb security.get_user_profile.rb security.has_privileges_user_profile.rb security.suggest_user_profiles.rb security.update_user_profile_data.rb shutdown.delete_node.rb shutdown.get_node.rb shutdown.put_node.rb --- .../autoscaling/delete_autoscaling_policy.rb | 62 -------------- .../autoscaling/get_autoscaling_capacity.rb | 51 ------------ .../autoscaling/get_autoscaling_policy.rb | 61 -------------- .../autoscaling/put_autoscaling_policy.rb | 64 --------------- .../elasticsearch/api/actions/capabilities.rb | 57 ------------- .../api/actions/connector/secret_delete.rb | 64 --------------- .../api/actions/connector/secret_get.rb | 64 --------------- .../api/actions/connector/secret_post.rb | 57 ------------- .../api/actions/connector/secret_put.rb | 66 --------------- .../api/actions/fleet/delete_secret.rb | 64 --------------- .../api/actions/fleet/get_secret.rb | 64 --------------- .../api/actions/fleet/post_secret.rb | 57 ------------- .../api/actions/machine_learning/validate.rb | 53 ------------ .../machine_learning/validate_detector.rb | 53 ------------ .../api/actions/monitoring/bulk.rb | 81 ------------------- .../api/actions/profiling/flamegraph.rb | 53 ------------ .../api/actions/profiling/stacktraces.rb | 53 ------------ .../api/actions/profiling/status.rb | 53 ------------ .../api/actions/profiling/topn_functions.rb | 53 ------------ .../actions/security/activate_user_profile.rb | 53 ------------ .../actions/security/disable_user_profile.rb | 61 -------------- .../actions/security/enable_user_profile.rb | 61 -------------- .../api/actions/security/get_user_profile.rb | 61 -------------- .../security/has_privileges_user_profile.rb | 53 ------------ .../actions/security/suggest_user_profiles.rb | 57 ------------- .../security/update_user_profile_data.rb | 65 --------------- .../api/actions/shutdown/delete_node.rb | 60 -------------- .../api/actions/shutdown/get_node.rb | 63 --------------- .../api/actions/shutdown/put_node.rb | 62 -------------- 29 files changed, 1726 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/capabilities.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_delete.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_get.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_post.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_put.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/fleet/delete_secret.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/fleet/get_secret.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/fleet/post_secret.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/monitoring/bulk.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/profiling/flamegraph.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/profiling/stacktraces.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/profiling/status.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/profiling/topn_functions.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/shutdown/delete_node.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/shutdown/get_node.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/shutdown/put_node.rb diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb deleted file mode 100644 index 6672db4b2..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb +++ /dev/null @@ -1,62 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Autoscaling - module Actions - # Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :name the name of the autoscaling policy - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html - # - def delete_autoscaling_policy(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.delete_autoscaling_policy' } - - defined_params = [:name].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _name = arguments.delete(:name) - - method = Elasticsearch::API::HTTP_DELETE - path = "_autoscaling/policy/#{Utils.__listify(_name)}" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb b/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb deleted file mode 100644 index 9fba921f3..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb +++ /dev/null @@ -1,51 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Autoscaling - module Actions - # Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html - # - def get_autoscaling_capacity(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_capacity' } - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - method = Elasticsearch::API::HTTP_GET - path = '_autoscaling/capacity' - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb deleted file mode 100644 index 9090bdbc7..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb +++ /dev/null @@ -1,61 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Autoscaling - module Actions - # Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :name the name of the autoscaling policy - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html - # - def get_autoscaling_policy(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_policy' } - - defined_params = [:name].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _name = arguments.delete(:name) - - method = Elasticsearch::API::HTTP_GET - path = "_autoscaling/policy/#{Utils.__listify(_name)}" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb deleted file mode 100644 index b453f52c9..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Autoscaling - module Actions - # Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :name the name of the autoscaling policy - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body the specification of the autoscaling policy (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html - # - def put_autoscaling_policy(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.put_autoscaling_policy' } - - defined_params = [:name].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _name = arguments.delete(:name) - - method = Elasticsearch::API::HTTP_PUT - path = "_autoscaling/policy/#{Utils.__listify(_name)}" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/capabilities.rb b/elasticsearch-api/lib/elasticsearch/api/actions/capabilities.rb deleted file mode 100644 index f769dce68..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/capabilities.rb +++ /dev/null @@ -1,57 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Actions - # Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :method REST method to check (options: GET, HEAD, POST, PUT, DELETE) - # @option arguments [String] :path API path to check - # @option arguments [String] :parameters Comma-separated list of API parameters to check - # @option arguments [String] :capabilities Comma-separated list of arbitrary API capabilities to check - # @option arguments [Boolean] :local_only True if only the node being called should be considered - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://github.com/elastic/elasticsearch/blob/current/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities - # - def capabilities(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'capabilities' } - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - method = Elasticsearch::API::HTTP_GET - path = '_capabilities' - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_delete.rb deleted file mode 100644 index 931bec679..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_delete.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Deletes a connector secret. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the secret - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see [TODO] - # - def secret_delete(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.secret_delete' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_DELETE - path = "_connector/_secret/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_get.rb deleted file mode 100644 index 7ec6d602d..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_get.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Retrieves a secret stored by Connectors. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the secret - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see [TODO] - # - def secret_get(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.secret_get' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_GET - path = "_connector/_secret/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_post.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_post.rb deleted file mode 100644 index 311404cad..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_post.rb +++ /dev/null @@ -1,57 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Creates a secret for a Connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The secret value to store (*Required*) - # - # @see [TODO] - # - def secret_post(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.secret_post' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_connector/_secret' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_put.rb deleted file mode 100644 index 94077f9da..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/secret_put.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Creates or updates a secret for a Connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The unique identifier of the connector secret to be created or updated. - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The secret value to store (*Required*) - # - # @see [TODO] - # - def secret_put(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.secret_put' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_PUT - path = "_connector/_secret/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/delete_secret.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/delete_secret.rb deleted file mode 100644 index 8ff603ad7..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/delete_secret.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Fleet - module Actions - # Deletes a secret stored by Fleet. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the secret - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see [TODO] - # - def delete_secret(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'fleet.delete_secret' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_DELETE - path = "_fleet/secret/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/get_secret.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/get_secret.rb deleted file mode 100644 index f00f51e05..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/get_secret.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Fleet - module Actions - # Retrieves a secret stored by Fleet. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the secret - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see [TODO] - # - def get_secret(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'fleet.get_secret' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_GET - path = "_fleet/secret/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/post_secret.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/post_secret.rb deleted file mode 100644 index 340520db7..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/post_secret.rb +++ /dev/null @@ -1,57 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Fleet - module Actions - # Creates a secret stored by Fleet. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The secret value to store (*Required*) - # - # @see [TODO] - # - def post_secret(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'fleet.post_secret' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_fleet/secret' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate.rb deleted file mode 100644 index 66a4a8a39..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module MachineLearning - module Actions - # Validates an anomaly detection job. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The job config (*Required*) - # - # @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html - # - def validate(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'ml.validate' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_ml/anomaly_detectors/_validate' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb deleted file mode 100644 index 77f97b9c4..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module MachineLearning - module Actions - # Validates an anomaly detection detector. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The detector (*Required*) - # - # @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html - # - def validate_detector(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'ml.validate_detector' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_ml/anomaly_detectors/_validate/detector' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/monitoring/bulk.rb b/elasticsearch-api/lib/elasticsearch/api/actions/monitoring/bulk.rb deleted file mode 100644 index fe2526af7..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/monitoring/bulk.rb +++ /dev/null @@ -1,81 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Monitoring - module Actions - # Used by the monitoring features to send monitoring data. - # - # @option arguments [String] :type Default document type for items which don't provide one *Deprecated* - # @option arguments [String] :system_id Identifier of the monitored system - # @option arguments [String] :system_api_version API Version of the monitored system - # @option arguments [String] :interval Collection interval (e.g., '10s' or '10000ms') of the payload - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [String|Array] :body The operation definition and data (action-data pairs), separated by newlines. Array of Strings, Header/Data pairs, - # or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.__bulkify documentation. - # - # *Deprecation notice*: - # Specifying types in urls has been deprecated - # Deprecated since version 7.0.0 - # - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/monitor-elasticsearch-cluster.html - # - def bulk(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'monitoring.bulk' } - - defined_params = [:type].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _type = arguments.delete(:type) - - method = Elasticsearch::API::HTTP_POST - path = if _type - "_monitoring/#{Utils.__listify(_type)}/bulk" - else - '_monitoring/bulk' - end - params = Utils.process_params(arguments) - - payload = if body.is_a? Array - Elasticsearch::API::Utils.__bulkify(body) - else - body - end - - headers.merge!('Content-Type' => 'application/x-ndjson') - Elasticsearch::API::Response.new( - perform_request(method, path, params, payload, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/flamegraph.rb b/elasticsearch-api/lib/elasticsearch/api/actions/profiling/flamegraph.rb deleted file mode 100644 index a809de4a9..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/flamegraph.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Profiling - module Actions - # Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The filter conditions for the flamegraph (*Required*) - # - # @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html - # - def flamegraph(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'profiling.flamegraph' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_profiling/flamegraph' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/stacktraces.rb b/elasticsearch-api/lib/elasticsearch/api/actions/profiling/stacktraces.rb deleted file mode 100644 index 5d2e78c2e..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/stacktraces.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Profiling - module Actions - # Extracts raw stacktrace information from Universal Profiling. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The filter conditions for stacktraces (*Required*) - # - # @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html - # - def stacktraces(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'profiling.stacktraces' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_profiling/stacktraces' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/profiling/status.rb deleted file mode 100644 index 78c74a494..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/status.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Profiling - module Actions - # Returns basic information about the status of Universal Profiling. - # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :wait_for_resources_created Whether to return immediately or wait until resources have been created - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html - # - def status(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'profiling.status' } - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - method = Elasticsearch::API::HTTP_GET - path = '_profiling/status' - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/topn_functions.rb b/elasticsearch-api/lib/elasticsearch/api/actions/profiling/topn_functions.rb deleted file mode 100644 index 856f84542..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/profiling/topn_functions.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Profiling - module Actions - # Extracts a list of topN functions from Universal Profiling. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The filter conditions for stacktraces (*Required*) - # - # @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html - # - def topn_functions(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'profiling.topn_functions' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_profiling/topn/functions' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb deleted file mode 100644 index 776e2a88b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Creates or updates the user profile on behalf of another user. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The grant type and user's credential (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html - # - def activate_user_profile(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.activate_user_profile' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_security/profile/_activate' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb deleted file mode 100644 index 890f6959c..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb +++ /dev/null @@ -1,61 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Disables a user profile so it's not visible in user profile searches. - # - # @option arguments [String] :uid Unique identifier for the user profile - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user-profile.html - # - def disable_user_profile(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user_profile' } - - defined_params = [:uid].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _uid = arguments.delete(:uid) - - method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_disable" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb deleted file mode 100644 index c49485472..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb +++ /dev/null @@ -1,61 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Enables a user profile so it's visible in user profile searches. - # - # @option arguments [String] :uid An unique identifier of the user profile - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user-profile.html - # - def enable_user_profile(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user_profile' } - - defined_params = [:uid].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _uid = arguments.delete(:uid) - - method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_enable" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb deleted file mode 100644 index 85033b4a4..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb +++ /dev/null @@ -1,61 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Retrieves user profiles for the given unique ID(s). - # - # @option arguments [List] :uid A comma-separated list of unique identifier for user profiles - # @option arguments [List] :data A comma-separated list of keys for which the corresponding application data are retrieved. - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html - # - def get_user_profile(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_profile' } - - defined_params = [:uid].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _uid = arguments.delete(:uid) - - method = Elasticsearch::API::HTTP_GET - path = "_security/profile/#{Utils.__listify(_uid)}" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb deleted file mode 100644 index f65160e35..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Determines whether the users associated with the specified profile IDs have all the requested privileges. - # - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The privileges to check and the list of profile IDs (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html - # - def has_privileges_user_profile(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges_user_profile' } - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = Elasticsearch::API::HTTP_POST - path = '_security/profile/_has_privileges' - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb deleted file mode 100644 index 566b2c9d3..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb +++ /dev/null @@ -1,57 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Get suggestions for user profiles that match specified search criteria. - # - # @option arguments [List] :data A comma-separated list of keys for which the corresponding application data are retrieved. - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The suggestion definition for user profiles - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-suggest-user-profile.html - # - def suggest_user_profiles(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.suggest_user_profiles' } - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - method = if body - Elasticsearch::API::HTTP_POST - else - Elasticsearch::API::HTTP_GET - end - - path = '_security/profile/_suggest' - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb deleted file mode 100644 index 271f14712..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb +++ /dev/null @@ -1,65 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Security - module Actions - # Update application specific data for the user profile of the given unique ID. - # - # @option arguments [String] :uid An unique identifier of the user profile - # @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number - # @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The application data to update (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html - # - def update_user_profile_data(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'security.update_user_profile_data' } - - defined_params = [:uid].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _uid = arguments.delete(:uid) - - method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_data" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/delete_node.rb b/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/delete_node.rb deleted file mode 100644 index f56dad05b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/delete_node.rb +++ /dev/null @@ -1,60 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Shutdown - module Actions - # Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :node_id The node id of node to be removed from the shutdown state - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current - # - def delete_node(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'shutdown.delete_node' } - - defined_params = [:node_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _node_id = arguments.delete(:node_id) - - method = Elasticsearch::API::HTTP_DELETE - path = "_nodes/#{Utils.__listify(_node_id)}/shutdown" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/get_node.rb b/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/get_node.rb deleted file mode 100644 index a54d20249..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/get_node.rb +++ /dev/null @@ -1,63 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Shutdown - module Actions - # Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :node_id Which node for which to retrieve the shutdown status - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current - # - def get_node(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'shutdown.get_node' } - - defined_params = [:node_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _node_id = arguments.delete(:node_id) - - method = Elasticsearch::API::HTTP_GET - path = if _node_id - "_nodes/#{Utils.__listify(_node_id)}/shutdown" - else - '_nodes/shutdown' - end - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/put_node.rb b/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/put_node.rb deleted file mode 100644 index a8f49a550..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/shutdown/put_node.rb +++ /dev/null @@ -1,62 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Shutdown - module Actions - # Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - # - # @option arguments [String] :node_id The node id of node to be shut down - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The shutdown type definition to register (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current - # - def put_node(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'shutdown.put_node' } - - defined_params = [:node_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _node_id = arguments.delete(:node_id) - - method = Elasticsearch::API::HTTP_PUT - path = "_nodes/#{Utils.__listify(_node_id)}/shutdown" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end From 40a39d9015e5b49358d61439070adfba767486a1 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 09:11:50 +0100 Subject: [PATCH 3/6] [API] Removes monitoring, profiling and shutdown namespaces --- elasticsearch-api/lib/elasticsearch/api.rb | 3 -- .../elasticsearch/api/namespace/monitoring.rb | 36 ------------------ .../elasticsearch/api/namespace/profiling.rb | 36 ------------------ .../elasticsearch/api/namespace/shutdown.rb | 37 ------------------- 4 files changed, 112 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/monitoring.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/profiling.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/shutdown.rb diff --git a/elasticsearch-api/lib/elasticsearch/api.rb b/elasticsearch-api/lib/elasticsearch/api.rb index a20a31a23..02ec70f9e 100644 --- a/elasticsearch-api/lib/elasticsearch/api.rb +++ b/elasticsearch-api/lib/elasticsearch/api.rb @@ -55,7 +55,6 @@ def self.included(base) Elasticsearch::API::Remote, Elasticsearch::API::DanglingIndices, Elasticsearch::API::Features, - Elasticsearch::API::Shutdown, Elasticsearch::API::AsyncSearch, Elasticsearch::API::Autoscaling, Elasticsearch::API::CrossClusterReplication, @@ -69,7 +68,6 @@ def self.included(base) Elasticsearch::API::Logstash, Elasticsearch::API::Migration, Elasticsearch::API::MachineLearning, - Elasticsearch::API::Monitoring, Elasticsearch::API::Rollup, Elasticsearch::API::SearchableSnapshots, Elasticsearch::API::Security, @@ -84,7 +82,6 @@ def self.included(base) Elasticsearch::API::Synonyms, Elasticsearch::API::Esql, Elasticsearch::API::Inference, - Elasticsearch::API::Profiling, Elasticsearch::API::Simulate, Elasticsearch::API::Connector, Elasticsearch::API::QueryRules diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/monitoring.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/monitoring.rb deleted file mode 100644 index 4c0f9dc01..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/monitoring.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Monitoring - module Actions; end - - # Client for the "monitoring" namespace (includes the {Monitoring::Actions} methods) - # - class MonitoringClient - include Common::Client, Common::Client::Base, Monitoring::Actions - end - - # Proxy method for {MonitoringClient}, available in the receiving object - # - def monitoring - @monitoring ||= MonitoringClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/profiling.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/profiling.rb deleted file mode 100644 index 7bfc0915b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/profiling.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Profiling - module Actions; end - - # Client for the "profiling" namespace (includes the {Profiling::Actions} methods) - # - class ProfilingClient - include Common::Client, Common::Client::Base, Profiling::Actions - end - - # Proxy method for {ProfilingClient}, available in the receiving object - # - def profiling - @profiling ||= ProfilingClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/shutdown.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/shutdown.rb deleted file mode 100644 index 0c6fbee48..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/shutdown.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Shutdown - module Actions; end - - # Client for the "shutdown" namespace (includes the {Shutdown::Actions} methods) - # - class ShutdownClient - include Common::Client, Common::Client::Base, Shutdown::Actions - end - - # Proxy method for {ShutdownClient}, available in the receiving object - # - def shutdown - @shutdown ||= ShutdownClient.new(self) - end - - end - end -end From 921d166378a9bf3a1cbfcd7932bfdbf42ae2897a Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 09:33:54 +0100 Subject: [PATCH 4/6] [API] Removes tests for removed APIs --- .../api/actions/capabilities_spec.rb | 35 ----------- .../actions/connector_secret/delete_spec.rb | 35 ----------- .../api/actions/connector_secret/get_spec.rb | 35 ----------- .../api/actions/connector_secret/post_spec.rb | 35 ----------- .../api/actions/connector_secret/put_spec.rb | 35 ----------- .../api/actions/profiling/flamegraph_spec.rb | 35 ----------- .../api/actions/profiling/stacktraces_spec.rb | 35 ----------- .../api/actions/profiling/status_spec.rb | 36 ------------ .../actions/profiling/topn_functions_spec.rb | 35 ----------- .../security/disable_user_profile_spec.rb | 35 ----------- .../security/enable_user_profile_spec.rb | 35 ----------- .../has_privileges_user_profile_spec.rb | 35 ----------- .../security/suggest_user_profiles_spec.rb | 46 --------------- .../api/actions/shutdown/delete_node_spec.rb | 45 -------------- .../api/actions/shutdown/get_node_spec.rb | 58 ------------------- .../api/actions/shutdown/put_node_spec.rb | 51 ---------------- .../free/integration/capabilities_spec.rb | 26 --------- .../delete_autoscaling_policy_test.rb | 46 --------------- .../get_autoscaling_capacity_test.rb | 40 ------------- .../get_autoscaling_policy_test.rb | 46 --------------- .../put_autoscaling_policy_test.rb | 52 ----------------- .../validate_detector_test.rb | 43 -------------- .../unit/machine_learning/validate_test.rb | 43 -------------- .../platinum/unit/monitoring/bulk_test.rb | 43 -------------- .../security/activate_user_profile_test.rb | 40 ------------- .../unit/security/get_user_profile_test.rb | 40 ------------- .../security/update_user_profile_data_test.rb | 40 ------------- 27 files changed, 1080 deletions(-) delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/capabilities_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/delete_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/get_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/post_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/put_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/profiling/flamegraph_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/profiling/stacktraces_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/profiling/status_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/profiling/topn_functions_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/security/disable_user_profile_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/security/enable_user_profile_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/security/has_privileges_user_profile_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/security/suggest_user_profiles_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/shutdown/delete_node_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/shutdown/get_node_spec.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/shutdown/put_node_spec.rb delete mode 100644 elasticsearch-api/spec/free/integration/capabilities_spec.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/autoscaling/delete_autoscaling_policy_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_capacity_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_policy_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/autoscaling/put_autoscaling_policy_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/machine_learning/validate_detector_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/machine_learning/validate_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/monitoring/bulk_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/security/activate_user_profile_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/security/get_user_profile_test.rb delete mode 100644 elasticsearch-api/spec/platinum/unit/security/update_user_profile_data_test.rb diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/capabilities_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/capabilities_spec.rb deleted file mode 100644 index c44b099f6..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/capabilities_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#capabilities' do - let(:expected_args) do - [ - 'GET', - '_capabilities', - {}, - nil, - {}, - { endpoint: 'capabilities' } - ] - end - - it 'performs the request' do - expect(client_double.capabilities).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/delete_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/delete_spec.rb deleted file mode 100644 index e8bc1f9dc..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/delete_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.connector#secret_delete' do - let(:expected_args) do - [ - 'DELETE', - '_connector/_secret/foo', - {}, - nil, - {}, - { :defined_params=>{ id: 'foo' }, endpoint: 'connector.secret_delete' } - ] - end - - it 'performs the request' do - expect(client_double.connector.secret_delete(id: 'foo')).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/get_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/get_spec.rb deleted file mode 100644 index 8cd436abd..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/get_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.connector.secret_get' do - let(:expected_args) do - [ - 'GET', - '_connector/_secret/foo', - {}, - nil, - {}, - { :defined_params=>{ id: 'foo' }, endpoint: 'connector.secret_get' } - ] - end - - it 'performs the request' do - expect(client_double.connector.secret_get(id: 'foo')).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/post_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/post_spec.rb deleted file mode 100644 index ddae5fb0d..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/post_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.connector.secret_post' do - let(:expected_args) do - [ - 'POST', - '_connector/_secret', - {}, - {}, - {}, - { endpoint: 'connector.secret_post' } - ] - end - - it 'performs the request' do - expect(client_double.connector.secret_post(body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/put_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/put_spec.rb deleted file mode 100644 index 7b8218769..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/connector_secret/put_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.connector#secret_get' do - let(:expected_args) do - [ - 'PUT', - '_connector/_secret/foo', - {}, - {}, - {}, - { :defined_params=>{ id: 'foo' }, endpoint: 'connector.secret_put' } - ] - end - - it 'performs the request' do - expect(client_double.connector.secret_put(id: 'foo', body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/flamegraph_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/profiling/flamegraph_spec.rb deleted file mode 100644 index df43702ba..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/flamegraph_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.profiling#flamegraph' do - let(:expected_args) do - [ - 'POST', - '_profiling/flamegraph', - {}, - {}, - {}, - { endpoint: 'profiling.flamegraph' } - ] - end - - it 'performs the request' do - expect(client_double.profiling.flamegraph(body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/stacktraces_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/profiling/stacktraces_spec.rb deleted file mode 100644 index bc846d38b..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/stacktraces_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.profiling#stacktraces' do - let(:expected_args) do - [ - 'POST', - '_profiling/stacktraces', - {}, - {}, - {}, - { endpoint: 'profiling.stacktraces' } - ] - end - - it 'performs the request' do - expect(client_double.profiling.stacktraces(body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/status_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/profiling/status_spec.rb deleted file mode 100644 index 70f8bce89..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/status_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#profiling.status' do - - let(:expected_args) do - [ - 'GET', - '_profiling/status', - {}, - nil, - {}, - { endpoint: 'profiling.status' } - ] - end - - it 'performs the request' do - expect(client_double.profiling.status).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/topn_functions_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/profiling/topn_functions_spec.rb deleted file mode 100644 index b7d02f929..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/profiling/topn_functions_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.profiling#topn_functions' do - let(:expected_args) do - [ - 'POST', - '_profiling/topn/functions', - {}, - {}, - {}, - { endpoint: 'profiling.topn_functions' } - ] - end - - it 'performs the request' do - expect(client_double.profiling.topn_functions(body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/security/disable_user_profile_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/security/disable_user_profile_spec.rb deleted file mode 100644 index 2b7173a56..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/security/disable_user_profile_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#security#disable_user_profile' do - let(:expected_args) do - [ - 'PUT', - '_security/profile/foo/_disable', - {}, - nil, - {}, - { defined_params: { uid: 'foo' }, endpoint: 'security.disable_user_profile' } - ] - end - - it 'performs the request' do - expect(client_double.security.disable_user_profile(uid: 'foo')).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/security/enable_user_profile_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/security/enable_user_profile_spec.rb deleted file mode 100644 index 1e61a7395..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/security/enable_user_profile_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#security#enable_user_profile' do - let(:expected_args) do - [ - 'PUT', - '_security/profile/foo/_enable', - {}, - nil, - {}, - { defined_params: { uid: 'foo' }, endpoint: 'security.enable_user_profile' } - ] - end - - it 'performs the request' do - expect(client_double.security.enable_user_profile(uid: 'foo')).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/security/has_privileges_user_profile_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/security/has_privileges_user_profile_spec.rb deleted file mode 100644 index a124ca014..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/security/has_privileges_user_profile_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#security#has_privileges_user_profile' do - let(:expected_args) do - [ - 'POST', - '_security/profile/_has_privileges', - {}, - {}, - {}, - { endpoint: 'security.has_privileges_user_profile' } - ] - end - - it 'performs the request' do - expect(client_double.security.has_privileges_user_profile(body: {})).to be_a Elasticsearch::API::Response - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/security/suggest_user_profiles_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/security/suggest_user_profiles_spec.rb deleted file mode 100644 index 499ea90bf..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/security/suggest_user_profiles_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client#security#search_user_profiles' do - let(:expected_args) do - [ - method, - '_security/profile/_suggest', - {}, - body, - {}, - { endpoint: 'security.suggest_user_profiles' } - ] - end - let(:method) { 'GET' } - let(:body) { nil } - - it 'performs the request' do - expect(client_double.security.suggest_user_profiles).to be_a Elasticsearch::API::Response - end - - context 'when there is a body parameter' do - let(:method) { 'POST' } - let(:body) { {} } - - it 'performs the request' do - expect(client_double.security.suggest_user_profiles(body: {})).to be_a Elasticsearch::API::Response - end - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/delete_node_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/delete_node_spec.rb deleted file mode 100644 index 7454aed96..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/delete_node_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.shutdown#delete_node' do - let(:expected_args) do - [ - 'DELETE', - '_nodes/id/shutdown', - {}, - nil, - {}, - { defined_params: { node_id: 'id' }, endpoint: 'shutdown.delete_node' } - ] - end - - it 'performs the request' do - expect(client_double.shutdown.delete_node(node_id: 'id')).to be_a Elasticsearch::API::Response - end - - let(:client) do - Class.new { include Elasticsearch::API }.new - end - - it 'raises an error if no node_id is provided' do - expect { - client.shutdown.delete_node - }.to raise_exception(ArgumentError) - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/get_node_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/get_node_spec.rb deleted file mode 100644 index 1c4f54d55..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/get_node_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.shutdown#get_node' do - let(:expected_args) do - [ - 'GET', - url, - {}, - nil, - {}, - { defined_params: { node_id: 'id' }, endpoint: 'shutdown.get_node' } - ] - end - - context 'when id is provided' do - let(:url) { '_nodes/id/shutdown' } - - it 'performs the request' do - expect(client_double.shutdown.get_node(node_id: 'id')).to be_a Elasticsearch::API::Response - end - end - - context 'when no id is provided' do - let(:url) { '_nodes/shutdown' } - - let(:expected_args) do - [ - 'GET', - url, - {}, - nil, - {}, - { endpoint: 'shutdown.get_node' } - ] - end - - it 'performs the request' do - expect(client_double.shutdown.get_node).to be_a Elasticsearch::API::Response - end - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/put_node_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/put_node_spec.rb deleted file mode 100644 index d746c899d..000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/shutdown/put_node_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -# 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. - -require 'spec_helper' - -describe 'client.shutdown#put_node' do - let(:expected_args) do - [ - 'PUT', - '_nodes/id/shutdown', - {}, - {}, - {}, - { defined_params: { node_id: 'id' }, endpoint: 'shutdown.put_node' } - ] - end - - it 'performs the request' do - expect(client_double.shutdown.put_node(body: {}, node_id: 'id')).to be_a Elasticsearch::API::Response - end - - let(:client) do - Class.new { include Elasticsearch::API }.new - end - - it 'raises an error if no node_id is provided' do - expect { - client.shutdown.put_node(body: {}) - }.to raise_exception(ArgumentError) - end - - it 'raises an error if no body is provided' do - expect { - client.shutdown.put_node(node_id: 'id') - }.to raise_exception(ArgumentError) - end -end diff --git a/elasticsearch-api/spec/free/integration/capabilities_spec.rb b/elasticsearch-api/spec/free/integration/capabilities_spec.rb deleted file mode 100644 index 87f881d45..000000000 --- a/elasticsearch-api/spec/free/integration/capabilities_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# 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. -# TODO: These tests won't be necessary once we migrate to the new YAML tests -require_relative './spec_helper' - -describe 'Capabilities' do - it 'performs the request' do - response = CLIENT.capabilities(method: 'GET', path: '/_capabilities', parameters: 'unknown') - expect(response.status).to eq 200 - expect(response['cluster_name']).not_to be_nil - end -end diff --git a/elasticsearch-api/spec/platinum/unit/autoscaling/delete_autoscaling_policy_test.rb b/elasticsearch-api/spec/platinum/unit/autoscaling/delete_autoscaling_policy_test.rb deleted file mode 100644 index c973b47b4..000000000 --- a/elasticsearch-api/spec/platinum/unit/autoscaling/delete_autoscaling_policy_test.rb +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackAutoscalingDeleteAutoscalingPolicyTest < Minitest::Test - subject { FakeClient.new } - - context 'XPack: Get Autoscaling Policy' do - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('DELETE', method) - assert_equal('_autoscaling/policy/a_policy', url) - assert_equal({}, params) - assert_nil(body) - true - end.returns(FakeResponse.new) - - subject.autoscaling.delete_autoscaling_policy(name: 'a_policy') - end - - should 'raise argument error without name' do - assert_raises ArgumentError do - subject.autoscaling.delete_autoscaling_policy - end - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_capacity_test.rb b/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_capacity_test.rb deleted file mode 100644 index e9e2b8d19..000000000 --- a/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_capacity_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackAutoscalingGetAutoscalingCapacityTest < Minitest::Test - subject { FakeClient.new } - - context 'XPack: Get Autoscaling Capacity' do - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('GET', method) - assert_equal('_autoscaling/capacity', url) - assert_equal({}, params) - assert_nil(body) - true - end.returns(FakeResponse.new) - - subject.autoscaling.get_autoscaling_capacity - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_policy_test.rb b/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_policy_test.rb deleted file mode 100644 index 0fc6a3812..000000000 --- a/elasticsearch-api/spec/platinum/unit/autoscaling/get_autoscaling_policy_test.rb +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackAutoscalingGetAutoscalingPolicyTest < Minitest::Test - subject { FakeClient.new } - - context 'XPack: Get Autoscaling Policy' do - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('GET', method) - assert_equal('_autoscaling/policy/a_policy', url) - assert_equal({}, params) - assert_nil(body) - true - end.returns(FakeResponse.new) - - subject.autoscaling.get_autoscaling_policy(name: 'a_policy') - end - - should 'raise argument error without name' do - assert_raises ArgumentError do - subject.autoscaling.get_autoscaling_policy - end - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/autoscaling/put_autoscaling_policy_test.rb b/elasticsearch-api/spec/platinum/unit/autoscaling/put_autoscaling_policy_test.rb deleted file mode 100644 index 409aec0aa..000000000 --- a/elasticsearch-api/spec/platinum/unit/autoscaling/put_autoscaling_policy_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackAutoscalingPutAutoscalingPolicyTest < Minitest::Test - subject { FakeClient.new } - - context 'XPack: Put Autoscaling Policy' do - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('PUT', method) - assert_equal('_autoscaling/policy/a_policy', url) - assert_equal({}, params) - assert_equal(body, {}) - true - end.returns(FakeResponse.new) - - subject.autoscaling.put_autoscaling_policy(name: 'a_policy', body: {}) - end - - should 'raise argument error without name' do - assert_raises ArgumentError do - subject.autoscaling.put_autoscaling_policy(body: {}) - end - end - - should 'raise argument error without body' do - assert_raises ArgumentError do - subject.autoscaling.put_autoscaling_policy(name: 'a_policy') - end - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/machine_learning/validate_detector_test.rb b/elasticsearch-api/spec/platinum/unit/machine_learning/validate_detector_test.rb deleted file mode 100644 index 474535a82..000000000 --- a/elasticsearch-api/spec/platinum/unit/machine_learning/validate_detector_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackMlValidateDetectorTest < Minitest::Test - - context "XPack MachineLearning: Validate detector" do - subject { FakeClient.new } - - should "perform correct request" do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal 'POST', method - assert_equal "_ml/anomaly_detectors/_validate/detector", url - assert_equal Hash.new, params - assert_equal Hash.new, body - true - end.returns(FakeResponse.new) - - subject.ml.validate_detector :body => {} - end - - end - - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/machine_learning/validate_test.rb b/elasticsearch-api/spec/platinum/unit/machine_learning/validate_test.rb deleted file mode 100644 index 78a965062..000000000 --- a/elasticsearch-api/spec/platinum/unit/machine_learning/validate_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackMlValidateTest < Minitest::Test - - context "XPack MachineLearning: Validate" do - subject { FakeClient.new } - - should "perform correct request" do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal 'POST', method - assert_equal "_ml/anomaly_detectors/_validate", url - assert_equal Hash.new, params - assert_equal Hash.new, body - true - end.returns(FakeResponse.new) - - subject.ml.validate :body => {} - end - - end - - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/monitoring/bulk_test.rb b/elasticsearch-api/spec/platinum/unit/monitoring/bulk_test.rb deleted file mode 100644 index 62d686879..000000000 --- a/elasticsearch-api/spec/platinum/unit/monitoring/bulk_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class XPackMonitoringBulkTest < Minitest::Test - - context "XPack Monitoring: Bulk" do - subject { FakeClient.new } - - should "perform correct request" do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal 'POST', method - assert_equal '_monitoring/bulk', url - assert_equal Hash.new, params - assert_equal "", body - true - end.returns(FakeResponse.new) - - subject.monitoring.bulk body: [] - end - - end - - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/security/activate_user_profile_test.rb b/elasticsearch-api/spec/platinum/unit/security/activate_user_profile_test.rb deleted file mode 100644 index 02af83e72..000000000 --- a/elasticsearch-api/spec/platinum/unit/security/activate_user_profile_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class SecurityAuthenticateTest < Minitest::Test - context 'Security: Activate User Profile' do - subject { FakeClient.new } - - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('POST', method) - assert_equal('_security/profile/_activate', url) - assert_equal({}, params) - assert_equal(body, {}) - true - end.returns(FakeResponse.new) - - subject.security.activate_user_profile(body: {}) - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/security/get_user_profile_test.rb b/elasticsearch-api/spec/platinum/unit/security/get_user_profile_test.rb deleted file mode 100644 index 4b3834035..000000000 --- a/elasticsearch-api/spec/platinum/unit/security/get_user_profile_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class SecurityGetUserProfileTest < Minitest::Test - context 'Security: Get User Profile' do - subject { FakeClient.new } - - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('GET', method) - assert_equal('_security/profile/1', url) - assert_equal({}, params) - assert_nil(body) - true - end.returns(FakeResponse.new) - - subject.security.get_user_profile(uid: 1) - end - end - end - end -end diff --git a/elasticsearch-api/spec/platinum/unit/security/update_user_profile_data_test.rb b/elasticsearch-api/spec/platinum/unit/security/update_user_profile_data_test.rb deleted file mode 100644 index e87738bfe..000000000 --- a/elasticsearch-api/spec/platinum/unit/security/update_user_profile_data_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# 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. - -require 'test_helper' - -module Elasticsearch - module Test - class SecurityUpdateUserProfileTest < Minitest::Test - context 'Security: Update User Profile Data' do - subject { FakeClient.new } - - should 'perform correct request' do - subject.expects(:perform_request).with do |method, url, params, body| - assert_equal('PUT', method) - assert_equal('_security/profile/1/_data', url) - assert_equal({}, params) - assert_equal(body, {}) - true - end.returns(FakeResponse.new) - - subject.security.update_user_profile_data(uid: 1, body: {}) - end - end - end - end -end From 6916d88f1081016e09e1978b0119c268b3a61c32 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 10:06:52 +0100 Subject: [PATCH 5/6] Test Runner: Updates wipe_cluster --- elasticsearch-api/api-spec-testing/wipe_cluster.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/elasticsearch-api/api-spec-testing/wipe_cluster.rb b/elasticsearch-api/api-spec-testing/wipe_cluster.rb index 083a20dd6..9453105c1 100644 --- a/elasticsearch-api/api-spec-testing/wipe_cluster.rb +++ b/elasticsearch-api/api-spec-testing/wipe_cluster.rb @@ -441,11 +441,11 @@ def clear_ml_filters(client) end def delete_all_node_shutdown_metadata(client) - nodes = client.shutdown.get_node - return unless nodes['nodes'] + nodes = client.perform_request(Elasticsearch::API::HTTP_GET, '_nodes/shutdown') + return unless nodes&.body['nodes'].any? - nodes['nodes'].each do |node| - client.shutdown.delete_node(node['node_id']) + nodes.body['nodes'].each do |node| + client.perform_request(Elasticsearch::API::HTTP_DELETE, "_nodes/#{node['node_id']}/shutdown") end end From 4f61759b176c836513f439c7afa97e280d3df0b0 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 18 Sep 2024 13:01:33 +0100 Subject: [PATCH 6/6] Test Runner: Updates skipped platinum tests for private APIs --- .../spec/rest_api/skipped_tests_platinum.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/elasticsearch-api/spec/rest_api/skipped_tests_platinum.yml b/elasticsearch-api/spec/rest_api/skipped_tests_platinum.yml index 1a4c3ca32..e664bea50 100644 --- a/elasticsearch-api/spec/rest_api/skipped_tests_platinum.yml +++ b/elasticsearch-api/spec/rest_api/skipped_tests_platinum.yml @@ -212,3 +212,28 @@ - :file: 'esql/180_match_operator.yml' :description: '*' +# Private APIs +- + :file: 'ml/validate.yml' + :description: '*' +- + :file: 'ml/validate_detector.yml' + :description: '*' +- + :file: 'monitoring/bulk/10_basic.yml' + :description: '*' +- + :file: 'monitoring/bulk/20_privileges.yml' + :description: '*' +- + :file: 'profiling/10_basic.yml' + :description: '*' +- + :file: 'security/settings/10_update_security_settings.yml' + :description: '*' +- + :file: 'user_profile/10_basic.yml' + :description: '*' +- + :file: 'user_profile/40_has_privileges.yml' + :description: '*'