diff --git a/source/server/http/admin.cc b/source/server/http/admin.cc index 336c8694e5d22..6537b978123b4 100644 --- a/source/server/http/admin.cc +++ b/source/server/http/admin.cc @@ -1104,35 +1104,6 @@ Http::Code AdminImpl::handlerRuntime(absl::string_view url, Http::HeaderMap& res return Http::Code::OK; } -std::string AdminImpl::runtimeAsJson( - const std::vector>& entries) { - rapidjson::Document document; - document.SetObject(); - rapidjson::Value entries_array(rapidjson::kArrayType); - rapidjson::Document::AllocatorType& allocator = document.GetAllocator(); - for (const auto& entry : entries) { - Value entry_obj; - entry_obj.SetObject(); - - entry_obj.AddMember("name", {entry.first.c_str(), allocator}, allocator); - - Value entry_value; - if (entry.second.uint_value_) { - entry_value.SetUint64(entry.second.uint_value_.value()); - } else { - entry_value.SetString(entry.second.raw_string_value_.c_str(), allocator); - } - entry_obj.AddMember("value", entry_value, allocator); - - entries_array.PushBack(entry_obj, allocator); - } - document.AddMember("runtime", entries_array, allocator); - rapidjson::StringBuffer strbuf; - rapidjson::PrettyWriter writer(strbuf); - document.Accept(writer); - return strbuf.GetString(); -} - bool AdminImpl::isFormUrlEncoded(const Http::HeaderEntry* content_type) const { if (content_type == nullptr) { return false; diff --git a/source/server/http/admin.h b/source/server/http/admin.h index 2991515cfef38..6fc5d3a6e254c 100644 --- a/source/server/http/admin.h +++ b/source/server/http/admin.h @@ -235,11 +235,7 @@ class AdminImpl : public Admin, const absl::optional regex = absl::nullopt, bool pretty_print = false); - static std::string - runtimeAsJson(const std::vector>& entries); std::vector sortedHandlers() const; - static const std::vector> - sortedRuntime(const std::unordered_map& entries); envoy::admin::v2alpha::ServerInfo::State serverState(); /** * URL handlers.