diff --git a/kong/api/routes/dns.lua b/kong/api/routes/dns.lua new file mode 100644 index 000000000000..37892a74b21a --- /dev/null +++ b/kong/api/routes/dns.lua @@ -0,0 +1,23 @@ +local kong = kong + + +return { + ["/status/dns"] = { + GET = function (self, db, helpers) + + if kong.configuration.legacy_dns_client then + return kong.response.exit(501, { + message = "not implemented with the legacy DNS client" + }) + end + + return kong.response.exit(200, { + worker = { + id = ngx.worker.id() or -1, + count = ngx.worker.count(), + }, + stats = kong.dns.stats(), + }) + end + }, +}