pastafari2/__apidoc__.py
2025-04-28 00:54:41 +02:00

39 lines
2.4 KiB
Python

from modules.apidoc2.libraries.apidoc import AppDoc
from modules.pastafari2 import pastafari_app
from settings import config
description="""
An API for use with Pastafari2 paramecio module.
"""
appdoc=AppDoc(pastafari_app, description)
appdoc.url='/'
appdoc.routes['pastafari_app.get_groups'].summary='Get category groups of servers'
appdoc.routes['pastafari_app.get_groups'].description='List with the server groups'
#appdoc.routes['pastafari_app.get_groups'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.routes['pastafari_app.add_group'].summary='Add group to database'
appdoc.routes['pastafari_app.add_group'].description='Add group to database. You can organize your servers on groups.'
#appdoc.routes['pastafari_app.add_group'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.routes['pastafari_app.add_server'].summary='Add server to Pastafaridb'
appdoc.routes['pastafari_app.add_server'].description='Add server to Pastafari, for management the server using the control panel via SSH'
#appdoc.routes['pastafari_app.add_server'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.routes['pastafari_app.make_task'].summary='Make task in server'
appdoc.routes['pastafari_app.make_task'].description='Make task in server async. You send the task to cuchulu agent, ant this execute the task in the server, and save results in log'
#appdoc.routes['pastafari_app.make_task'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.routes['pastafari_app.add_task_db'].summary='Add task to db'
appdoc.routes['pastafari_app.add_task_db'].description='Add task to db for use in API'
#appdoc.routes['pastafari_app.add_task_db'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.routes['pastafari_app.get_progress_task'].summary='Get progress from task'
appdoc.routes['pastafari_app.get_progress_task'].description='Get progress from task from db in logtask table'
appdoc.routes['pastafari_app.get_progress_task'].add_parameter('server', 'query', 'IP server from log', 'false', 'string')
#appdoc.routes['pastafari_app.get_progress_task'].add_parameter(config.cookie_name, 'cookie', 'Cookie for identify in api', 'true', 'string')
appdoc.tags['servers']='Servers'