Fawkes API Fawkes Development Version
config-rest-api.h
1
2/***************************************************************************
3 * config-rest-api.h - Configuration REST API
4 *
5 * Created: Thu Apr 12 18:59:38 2018
6 * Copyright 2006-2018 Tim Niemueller [www.niemueller.de]
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Library General Public License for more details.
18 *
19 * Read the full text in the LICENSE.GPL file in the doc directory.
20 */
21
22#pragma once
23
24#include "model/ConfigTree.h"
25
26#include <aspect/configurable.h>
27#include <aspect/logging.h>
28#include <aspect/webview.h>
29#include <core/threading/thread.h>
30#include <webview/rest_api.h>
31#include <webview/rest_array.h>
32
33#include <map>
34#include <string>
35
40{
41public:
44
45 virtual void init();
46 virtual void loop();
47 virtual void finalize();
48
49private:
50 ConfigTree cb_get_config(fawkes::WebviewRestParams &params);
51
52private:
53 fawkes::WebviewRestApi *rest_api_;
54};
ConfigTree representation for JSON transfer.
Definition: ConfigTree.h:28
REST API backend for plugins.
ConfigurationRestApi()
Constructor.
~ConfigurationRestApi()
Destructor.
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
virtual void loop()
Code to execute in the thread.
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
Thread class encapsulation of pthreads.
Definition: thread.h:46
Thread aspect to provide web pages via Webview.
Definition: webview.h:37
Webview REST API component.
Definition: rest_api.h:221
REST parameters to pass to handlers.
Definition: rest_api.h:125