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 * |
Radek Krejci | 58fb890 | 2017-09-21 13:23:28 +0200 | [diff] [blame] | 19 | from .devices import * |
Radek Krejci | cbbb197 | 2017-09-21 13:25:19 +0200 | [diff] [blame^] | 20 | from .connections import * |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 21 | |
| 22 | module_bp.add_url_rule('/inventory/schemas/list', view_func = schemas_list, methods=['GET']) |
| 23 | 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] | 24 | module_bp.add_url_rule('/inventory/schemas', view_func = schemas_rm, methods = ['DELETE']) |
Radek Krejci | 58fb890 | 2017-09-21 13:23:28 +0200 | [diff] [blame] | 25 | module_bp.add_url_rule('/inventory/devices/list', view_func = devices_list, methods=['GET']) |
| 26 | module_bp.add_url_rule('/inventory/devices', view_func = devices_add, methods=['POST']) |
| 27 | module_bp.add_url_rule('/inventory/devices', view_func = devices_rm, methods = ['DELETE']) |
Radek Krejci | cbbb197 | 2017-09-21 13:25:19 +0200 | [diff] [blame^] | 28 | module_bp.add_url_rule('/session', view_func = connect, methods=['POST']) |
| 29 | module_bp.add_url_rule('/session', view_func = session_close, methods = ['DELETE']) |
| 30 | module_bp.add_url_rule('/session/alive', view_func = session_alive, methods=['GET']) |
| 31 | module_bp.add_url_rule('/session/capabilities', view_func = session_get_capabilities, methods=['GET']) |