from risotto.controller import Controller from risotto.register import register class Risotto(Controller): @register('v1.servermodel.list', None) async def servermodel_list(self, source_id): return [{'servermodel_id': 1, 'servermodel_name': 'name1', 'release_id': 1, 'servermodel_description': 'description1'}, {'servermodel_id': 2, 'servermodel_name': 'name2', 'release_id': 2, 'servermodel_description': 'description2', 'servermodel_parents_id': [1]}] @register('v1.servermodel.describe', None) async def servermodel_describe(self, inheritance, creolefuncs, servermodel_id, schema, conffiles, resolvdepends, probes): schema = """ False /etc/mailname False mailname True basic normal oui non mandatory normal non normal normal normal """ return {'servermodel_id': 1, 'servermodel_name': 'name', 'servermodel_description': 'description', 'release_id': 1, 'schema': schema, 'creolefuncs': ''}