diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-11-03 16:58:42 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-11-03 16:58:42 +0200 |
commit | fb756526af092ffb6424dc254fff928cbdd4135a (patch) | |
tree | 0dd5e839929fc37f874d91c8649f02a7b1c4b52d | |
parent | 65d14fd03b74e319b24499e63076d9c6ce99e5a8 (diff) | |
download | muck-poc-fb756526af092ffb6424dc254fff928cbdd4135a.tar.gz |
Add: /status endpoint
-rwxr-xr-x | muck_poc | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -64,6 +64,11 @@ class MuckAPI: 'callback': self._check_authz( 'GET', 'show', self._search_res), }, + { + 'method': 'GET', + 'path': '/status', + 'callback': self._show_status, + }, ] for route in routes: @@ -134,6 +139,13 @@ class MuckAPI: } return bottle.HTTPResponse(status=200, body=json.dumps(result)) + def _show_status(self): + ms = self._store.get_memory_store() + status = { + 'resources': len(ms) + } + return bottle.HTTPResponse(status=200, body=json.dumps(status)) + def _get_json_body(self): f = bottle.request.body body = f.read() |