diff --git a/API.md b/API.md index 75544b208..bb34d7aa4 100644 --- a/API.md +++ b/API.md @@ -797,6 +797,8 @@ return: - POST `/dns/restart` +- POST `/dns/reset` + - GET `/dns/logs` - GET `/dns/stats` diff --git a/hassio/api/__init__.py b/hassio/api/__init__.py index cf2495cb6..43b5267f7 100644 --- a/hassio/api/__init__.py +++ b/hassio/api/__init__.py @@ -284,6 +284,7 @@ class RestAPI(CoreSysAttributes): web.post("/dns/update", api_dns.update), web.post("/dns/options", api_dns.options), web.post("/dns/restart", api_dns.restart), + web.post("/dns/reset", api_dns.reset), ] ) diff --git a/hassio/api/dns.py b/hassio/api/dns.py index cb1fe6fc2..a56e5fca5 100644 --- a/hassio/api/dns.py +++ b/hassio/api/dns.py @@ -95,3 +95,8 @@ class APICoreDNS(CoreSysAttributes): def restart(self, request: web.Request) -> Awaitable[None]: """Restart CoreDNS plugin.""" return asyncio.shield(self.sys_dns.restart()) + + @api_process + def reset(self, request: web.Request) -> Awaitable[None]: + """Reset CoreDNS plugin.""" + return asyncio.shield(self.sys_dns.reset())