mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Add dns reset to API (#1428)
This commit is contained in:
parent
36ae0c82b6
commit
36b9a609bf
2
API.md
2
API.md
@ -797,6 +797,8 @@ return:
|
|||||||
|
|
||||||
- POST `/dns/restart`
|
- POST `/dns/restart`
|
||||||
|
|
||||||
|
- POST `/dns/reset`
|
||||||
|
|
||||||
- GET `/dns/logs`
|
- GET `/dns/logs`
|
||||||
|
|
||||||
- GET `/dns/stats`
|
- GET `/dns/stats`
|
||||||
|
@ -284,6 +284,7 @@ class RestAPI(CoreSysAttributes):
|
|||||||
web.post("/dns/update", api_dns.update),
|
web.post("/dns/update", api_dns.update),
|
||||||
web.post("/dns/options", api_dns.options),
|
web.post("/dns/options", api_dns.options),
|
||||||
web.post("/dns/restart", api_dns.restart),
|
web.post("/dns/restart", api_dns.restart),
|
||||||
|
web.post("/dns/reset", api_dns.reset),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -95,3 +95,8 @@ class APICoreDNS(CoreSysAttributes):
|
|||||||
def restart(self, request: web.Request) -> Awaitable[None]:
|
def restart(self, request: web.Request) -> Awaitable[None]:
|
||||||
"""Restart CoreDNS plugin."""
|
"""Restart CoreDNS plugin."""
|
||||||
return asyncio.shield(self.sys_dns.restart())
|
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())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user