Api doc base
This commit is contained in:
@@ -24,9 +24,17 @@ class Core(Plugin):
|
||||
shutdown_started = False
|
||||
|
||||
def __init__(self):
|
||||
addApiView('app.shutdown', self.shutdown)
|
||||
addApiView('app.restart', self.restart)
|
||||
addApiView('app.available', self.available)
|
||||
addApiView('app.shutdown', self.shutdown, docs = {
|
||||
'desc': 'Shutdown the app.',
|
||||
'return': {'type': 'string: shutdown'}
|
||||
})
|
||||
addApiView('app.restart', self.restart, docs = {
|
||||
'desc': 'Restart the app.',
|
||||
'return': {'type': 'string: restart'}
|
||||
})
|
||||
addApiView('app.available', self.available, docs = {
|
||||
'desc': 'Check if app available.'
|
||||
})
|
||||
|
||||
addEvent('app.crappy_shutdown', self.crappyShutdown)
|
||||
addEvent('app.crappy_restart', self.crappyRestart)
|
||||
|
||||
@@ -29,9 +29,25 @@ class Updater(Plugin):
|
||||
|
||||
addEvent('app.load', self.check)
|
||||
|
||||
addApiView('updater.info', self.getInfo)
|
||||
addApiView('updater.info', self.getInfo, docs = {
|
||||
'desc': 'Get updater information',
|
||||
'return': {
|
||||
'type': 'object',
|
||||
'example': """
|
||||
{
|
||||
'repo_name': "Name of used repository",
|
||||
'last_check': "last checked for update",
|
||||
'update_version': "available update version or empty",
|
||||
'version': current_cp_version
|
||||
}
|
||||
"""
|
||||
}
|
||||
})
|
||||
addApiView('updater.update', self.doUpdateView)
|
||||
addApiView('updater.check', self.checkView)
|
||||
addApiView('updater.check', self.checkView, docs = {
|
||||
'desc': 'Check for available update',
|
||||
'return': {'type': 'see updater.info'}
|
||||
})
|
||||
|
||||
def getInfo(self):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user