From 0ca34f07bbb8c068dd74e3ced7fbe972fac16f2f Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Fri, 8 Feb 2019 11:25:21 -0600 Subject: [PATCH] Central management typeless API This commit adopts Elasticsearch's typeless API for central management. Relates: https://github.com/elastic/elasticsearch/issues/3863 Fixes #10421 --- x-pack/lib/config_management/elasticsearch_source.rb | 3 +-- x-pack/spec/config_management/elasticsearch_source_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/x-pack/lib/config_management/elasticsearch_source.rb b/x-pack/lib/config_management/elasticsearch_source.rb index f8a860fbbce..a319c23a950 100644 --- a/x-pack/lib/config_management/elasticsearch_source.rb +++ b/x-pack/lib/config_management/elasticsearch_source.rb @@ -20,7 +20,6 @@ class ElasticsearchSource < LogStash::Config::Source::Base class RemoteConfigError < LogStash::Error; end PIPELINE_INDEX = ".logstash" - PIPELINE_TYPE = "doc" VALID_LICENSES = %w(trial standard gold platinum) FEATURE_INTERNAL = 'management' FEATURE_EXTERNAL = 'logstash' @@ -138,7 +137,7 @@ def fetch_config(pipeline_ids) end def config_path - "#{PIPELINE_INDEX}/#{PIPELINE_TYPE}/_mget" + "#{PIPELINE_INDEX}/_mget" end def populate_license_state(xpack_info) diff --git a/x-pack/spec/config_management/elasticsearch_source_spec.rb b/x-pack/spec/config_management/elasticsearch_source_spec.rb index e34069b9e98..3728639eed2 100644 --- a/x-pack/spec/config_management/elasticsearch_source_spec.rb +++ b/x-pack/spec/config_management/elasticsearch_source_spec.rb @@ -132,7 +132,7 @@ } } it "generates the path to get the configuration" do - expect(subject.config_path).to eq("#{described_class::PIPELINE_INDEX}/#{described_class::PIPELINE_TYPE}/_mget") + expect(subject.config_path).to eq("#{described_class::PIPELINE_INDEX}/_mget") end end @@ -168,7 +168,7 @@ let(:pipeline_id) { "apache" } let(:mock_client) { double("http_client") } let(:settings) { super.merge({ "xpack.management.pipeline.id" => pipeline_id }) } - let(:es_path) { "#{described_class::PIPELINE_INDEX}/#{described_class::PIPELINE_TYPE}/_mget" } + let(:es_path) { "#{described_class::PIPELINE_INDEX}/_mget" } let(:request_body_string) { LogStash::Json.dump({ "docs" => [{ "_id" => pipeline_id }] }) } before do