blob: a6170e9cd8ec42eed36addfe37456551dde68ae9 [file] [log] [blame]
Radek Krejcid23f0df2017-08-31 16:34:49 +02001"""
2Netopeer2 GUI backend
3File: __init__.py
4Author: Radek Krejci <rkrejci@cesnet.cz>
5
6Backend initialization via liberouter GUI.
7"""
8
9from liberouterapi import app, config
10from ..module import Module
11
12# Get Netopeer backend config
13config.load(path = __path__[0] + '/config.ini')
14
15# Register a blueprint
16module_bp = Module('netopeer', __name__, url_prefix = '/netopeer', no_version = True)
17
18from .schemas import *
Radek Krejci58fb8902017-09-21 13:23:28 +020019from .devices import *
Radek Krejcicbbb1972017-09-21 13:25:19 +020020from .connections import *
Radek Krejcid23f0df2017-08-31 16:34:49 +020021
22module_bp.add_url_rule('/inventory/schemas/list', view_func = schemas_list, methods=['GET'])
23module_bp.add_url_rule('/inventory/schemas', view_func = schemas_add, methods=['POST'])
Radek Krejci3cb753f2017-09-08 16:14:29 +020024module_bp.add_url_rule('/inventory/schemas', view_func = schemas_rm, methods = ['DELETE'])
Radek Krejci58fb8902017-09-21 13:23:28 +020025module_bp.add_url_rule('/inventory/devices/list', view_func = devices_list, methods=['GET'])
26module_bp.add_url_rule('/inventory/devices', view_func = devices_add, methods=['POST'])
27module_bp.add_url_rule('/inventory/devices', view_func = devices_rm, methods = ['DELETE'])
Radek Krejcicbbb1972017-09-21 13:25:19 +020028module_bp.add_url_rule('/session', view_func = connect, methods=['POST'])
29module_bp.add_url_rule('/session', view_func = session_close, methods = ['DELETE'])
30module_bp.add_url_rule('/session/alive', view_func = session_alive, methods=['GET'])
31module_bp.add_url_rule('/session/capabilities', view_func = session_get_capabilities, methods=['GET'])
Radek Krejci2e578562017-10-17 11:11:13 +020032module_bp.add_url_rule('/session/rpcGet', view_func = session_get, methods=['GET'])