From 888389561cf68be281b24a292d77c9f90c192905 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 2 Oct 2025 09:07:35 +0100 Subject: [PATCH 1/2] [API] Adds project namespace and experimental tags endpoint --- elasticsearch-api/lib/elasticsearch/api.rb | 1 + .../elasticsearch/api/actions/project/tags.rb | 65 +++++++++++++++++++ .../spec/unit/actions/project/tags_spec.rb | 35 ++++++++++ 3 files changed, 101 insertions(+) create mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/project/tags.rb create mode 100644 elasticsearch-api/spec/unit/actions/project/tags_spec.rb diff --git a/elasticsearch-api/lib/elasticsearch/api.rb b/elasticsearch-api/lib/elasticsearch/api.rb index c689953394..692d2f1427 100644 --- a/elasticsearch-api/lib/elasticsearch/api.rb +++ b/elasticsearch-api/lib/elasticsearch/api.rb @@ -71,6 +71,7 @@ def perform_request(method, path, params = {}, body = nil, headers = nil, reques :migration, :machine_learning, :nodes, + :project, :query_rules, :search_application, :searchable_snapshots, diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/project/tags.rb b/elasticsearch-api/lib/elasticsearch/api/actions/project/tags.rb new file mode 100644 index 0000000000..29c362e3ff --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/project/tags.rb @@ -0,0 +1,65 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# This code was automatically generated from the Elasticsearch Specification +# See https://github.com/elastic/elasticsearch-specification +# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash. +module Elasticsearch + module API + module Project + module Actions + # Return tags defined for the project + # 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 [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors + # when they occur. + # @option arguments [String, Array] :filter_path Comma-separated list of filters in dot notation which reduce the response + # returned by Elasticsearch. + # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans. + # For example `"exists_time": "1h"` for humans and + # `"exists_time_in_millis": 3600000` for computers. When disabled the human + # readable values will be omitted. This makes sense for responses being consumed + # only by machines. + # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use + # this option for debugging only. + # @option arguments [Hash] :headers Custom HTTP headers + # + # @see + # + def tags(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'project.tags' } + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = nil + + method = Elasticsearch::API::HTTP_GET + path = '_project/tags' + 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/spec/unit/actions/project/tags_spec.rb b/elasticsearch-api/spec/unit/actions/project/tags_spec.rb new file mode 100644 index 0000000000..11c9e562c6 --- /dev/null +++ b/elasticsearch-api/spec/unit/actions/project/tags_spec.rb @@ -0,0 +1,35 @@ +# 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.project#tags' do + let(:expected_args) do + [ + 'GET', + '_project/tags', + {}, + nil, + {}, + { endpoint: 'project.tags' } + ] + end + + it 'performs the request' do + expect(client_double.project.tags).to be_a Elasticsearch::API::Response + end +end From af388a2b224e8707cb8d542b07b5b9c635c2107c Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 2 Oct 2025 09:28:56 +0100 Subject: [PATCH 2/2] [API] Updates source code docs to 3d6e3fda46f55df3ab95a573cf75c1d56a3919da --- .../lib/elasticsearch/api/actions/logstash/put_pipeline.rb | 3 ++- elasticsearch-api/lib/elasticsearch/api/version.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb index 25011a6237..140ab876c7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb @@ -26,7 +26,8 @@ module Actions # Create a pipeline that is used for Logstash Central Management. # If the specified pipeline exists, it is replaced. # - # @option arguments [String] :id An identifier for the pipeline. (*Required*) + # @option arguments [String] :id An identifier for the pipeline. + # Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers. (*Required*) # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors # when they occur. # @option arguments [String, Array] :filter_path Comma-separated list of filters in dot notation which reduce the response diff --git a/elasticsearch-api/lib/elasticsearch/api/version.rb b/elasticsearch-api/lib/elasticsearch/api/version.rb index 256124dcb2..d89456aa34 100644 --- a/elasticsearch-api/lib/elasticsearch/api/version.rb +++ b/elasticsearch-api/lib/elasticsearch/api/version.rb @@ -18,6 +18,6 @@ module Elasticsearch module API VERSION = '9.2.0'.freeze - ES_SPECIFICATION_COMMIT = '1aa68abf07e4d0f9cbc162eef64d0ae508e65366'.freeze + ES_SPECIFICATION_COMMIT = '3d6e3fda46f55df3ab95a573cf75c1d56a3919da'.freeze end end