Skip to content

Commit

Permalink
Central management typeless API
Browse files Browse the repository at this point in the history
This commit adopts Elasticsearch's typeless API for central management.

Relates: elastic/elasticsearch#3863

Fixes #10421
  • Loading branch information
jakelandis authored and jsvd committed Mar 7, 2019
1 parent 7ac82ac commit bbc58fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions x-pack/lib/config_management/elasticsearch_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions x-pack/spec/config_management/elasticsearch_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbc58fb

Please sign in to comment.