More plugin API stuff

This commit is contained in:
Tulir Asokan 2018-10-30 00:50:38 +02:00
parent f2449e2eba
commit d5353430a8
6 changed files with 156 additions and 64 deletions

View file

@ -33,6 +33,30 @@ ErrPluginNotFound = web.json_response({
ErrPluginInUse = web.json_response({
"error": "Plugin instances of this type still exist",
"errcode": "plugin_in_use",
})
}, status=web.HTTPPreconditionFailed)
RespDeleted = web.Response(status=204)
def ErrInputPluginInvalid(error) -> web.Response:
return web.json_response({
"error": str(error),
"errcode": "plugin_invalid",
}, status=web.HTTPBadRequest)
def ErrPluginReloadFailed(error) -> web.Response:
return web.json_response({
"error": str(error),
"errcode": "plugin_invalid",
}, status=web.HTTPInternalServerError)
ErrNotImplemented = web.json_response({
"error": "Not implemented",
"errcode": "not_implemented",
}, status=web.HTTPNotImplemented)
RespOK = web.json_response({
"success": True,
}, status=web.HTTPOk)
RespDeleted = web.Response(status=web.HTTPNoContent)