Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 1 | """ |
| 2 | Netopeer2 GUI backend |
| 3 | File: __init__.py |
| 4 | Author: Radek Krejci <rkrejci@cesnet.cz> |
| 5 | |
| 6 | Backend initialization via liberouter GUI. |
| 7 | """ |
| 8 | |
| 9 | from liberouterapi import app, config |
| 10 | from ..module import Module |
| 11 | |
| 12 | # Get Netopeer backend config |
| 13 | config.load(path = __path__[0] + '/config.ini') |
| 14 | |
| 15 | # Register a blueprint |
| 16 | module_bp = Module('netopeer', __name__, url_prefix = '/netopeer', no_version = True) |
| 17 | |
| 18 | from .schemas import * |
| 19 | |
| 20 | module_bp.add_url_rule('/inventory/schemas/list', view_func = schemas_list, methods=['GET']) |
| 21 | module_bp.add_url_rule('/inventory/schemas', view_func = schemas_add, methods=['POST']) |
Radek Krejci | 3cb753f | 2017-09-08 16:14:29 +0200 | [diff] [blame] | 22 | module_bp.add_url_rule('/inventory/schemas', view_func = schemas_rm, methods = ['DELETE']) |