Skip to content

Commit

Permalink
feat(api): remove endpoint of dynamic log level
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 5, 2024
1 parent d4ab528 commit afe4e6b
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions kong/api/routes/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,49 +128,4 @@ routes[cluster_name] = {
end
}


if kong.rpc then
routes["/clustering/data-planes/:node_id/log-level"] = {
GET = function(self)
local res, err =
kong.rpc:call(self.params.node_id, "kong.debug.log_level.v1.get_log_level")
if not res then
return kong.response.exit(500, { message = err, })
end

return kong.response.exit(200, res)
end,
PUT = function(self)
local new_level = self.params.current_level
local timeout = self.params.timeout and
math.ceil(tonumber(self.params.timeout)) or nil

if not new_level then
return kong.response.exit(400, { message = "Required parameter \"current_level\" is missing.", })
end

local res, err = kong.rpc:call(self.params.node_id,
"kong.debug.log_level.v1.set_log_level",
new_level,
timeout)
if not res then
return kong.response.exit(500, { message = err, })
end

return kong.response.exit(201)
end,
DELETE = function(self)
local res, err = kong.rpc:call(self.params.node_id,
"kong.debug.log_level.v1.set_log_level",
"warn",
0)
if not res then
return kong.response.exit(500, { message = err, })
end

return kong.response.exit(204)
end,
}
end

return routes

0 comments on commit afe4e6b

Please sign in to comment.