[Backport 7.16] Fixes a usage of deprecated 'http.enabled' to the new 'api.enabled' (#13380) (#13408)

With #13308 configuration namespace that started with `http.` was renamed to `api.`, this commit fix a usage left behind.
Use the new `api.enabled` setting in one place instead of the deprecated `http.enable`.

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
(cherry picked from commit 88c80ebb19)
This commit is contained in:
Andrea Selva 2021-11-16 18:18:58 +01:00 committed by GitHub
parent ff99fbe8f1
commit f6c379e2df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ module LogStash; module Inputs; class Metrics;
@snapshot = snapshot
@metric_store = @snapshot.metric_store
@cluster_uuid = cluster_uuid
@webserver_enabled = LogStash::SETTINGS.get_value("http.enabled")
@webserver_enabled = LogStash::SETTINGS.get_value("api.enabled")
end
def make(agent, extended_performance_collection=true, collection_interval=10)

View file

@ -17,7 +17,7 @@ shared_examples_for("old model monitoring event with webserver setting") do
global_stats = {"uuid" => "00001" }
sut = described_class.new(global_stats, collector.snapshot_metric, nil)
LogStash::SETTINGS.set_value("monitoring.enabled", false)
LogStash::SETTINGS.set_value("api.http.enabled", webserver_enabled)
LogStash::SETTINGS.set_value("api.enabled", webserver_enabled)
monitoring_evt = sut.make(agent, true)
json = JSON.parse(monitoring_evt.to_json)