Add an app_debug function

This commit is contained in:
Laurent Peuch 2015-10-02 15:23:12 -04:00
parent 40ea9a328f
commit 7da60a6aec
2 changed files with 21 additions and 0 deletions

View file

@ -499,6 +499,14 @@ app:
full: --sql
help: Initial SQL file
### app_debug()
debug:
action_help: Display all debug informations for an application
api: GET /apps/<app>/debug
arguments:
app:
help: App name
### app_makedefault()
makedefault:
action_help: Redirect domain root to an app

View file

@ -722,6 +722,19 @@ def app_clearaccess(auth, apps):
app_ssowatconf(auth)
def app_debug(app):
with open(apps_setting_path + app + '/manifest.json') as f:
manifest = json.loads(f.read())
return {
'name': manifest['name'],
'services_logs': [{
'service': x,
'log': service_log(x),
} for x in manifest.get("services", [])]
}
def app_makedefault(auth, app, domain=None):
"""
Redirect domain root to an app