Skip to content

Commit 8883895

Browse files
committed
[API] Adds project namespace and experimental tags endpoint
1 parent 736acc8 commit 8883895

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

elasticsearch-api/lib/elasticsearch/api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def perform_request(method, path, params = {}, body = nil, headers = nil, reques
7171
:migration,
7272
:machine_learning,
7373
:nodes,
74+
:project,
7475
:query_rules,
7576
:search_application,
7677
:searchable_snapshots,
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
# This code was automatically generated from the Elasticsearch Specification
19+
# See https://github.com/elastic/elasticsearch-specification
20+
# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21+
module Elasticsearch
22+
module API
23+
module Project
24+
module Actions
25+
# Return tags defined for the project
26+
# This functionality is Experimental and may be changed or removed
27+
# completely in a future release. Elastic will take a best effort approach
28+
# to fix any issues, but experimental features are not subject to the
29+
# support SLA of official GA features.
30+
#
31+
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
32+
# when they occur.
33+
# @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
34+
# returned by Elasticsearch.
35+
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
36+
# For example `"exists_time": "1h"` for humans and
37+
# `"exists_time_in_millis": 3600000` for computers. When disabled the human
38+
# readable values will be omitted. This makes sense for responses being consumed
39+
# only by machines.
40+
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
41+
# this option for debugging only.
42+
# @option arguments [Hash] :headers Custom HTTP headers
43+
#
44+
# @see
45+
#
46+
def tags(arguments = {})
47+
request_opts = { endpoint: arguments[:endpoint] || 'project.tags' }
48+
49+
arguments = arguments.clone
50+
headers = arguments.delete(:headers) || {}
51+
52+
body = nil
53+
54+
method = Elasticsearch::API::HTTP_GET
55+
path = '_project/tags'
56+
params = Utils.process_params(arguments)
57+
58+
Elasticsearch::API::Response.new(
59+
perform_request(method, path, params, body, headers, request_opts)
60+
)
61+
end
62+
end
63+
end
64+
end
65+
end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
require 'spec_helper'
19+
20+
describe 'client.project#tags' do
21+
let(:expected_args) do
22+
[
23+
'GET',
24+
'_project/tags',
25+
{},
26+
nil,
27+
{},
28+
{ endpoint: 'project.tags' }
29+
]
30+
end
31+
32+
it 'performs the request' do
33+
expect(client_double.project.tags).to be_a Elasticsearch::API::Response
34+
end
35+
end

0 commit comments

Comments
 (0)