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/reset`
|
||||
|
||||
- GET `/dns/logs`
|
||||
|
||||
- GET `/dns/stats`
|
||||
|
|
|
@ -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),
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue