21#ifndef OLAD_OLADHTTPSERVER_H_
22#define OLAD_OLADHTTPSERVER_H_
28#include "ola/client/OlaClient.h"
30#include "ola/http/HTTPServer.h"
31#include "ola/http/OlaHTTPServer.h"
32#include "ola/network/Interface.h"
34#include "olad/RDMHTTPModule.h"
95 const std::vector<client::OlaPlugin> &plugins);
100 const std::vector<client::OlaUniverse> &universes);
105 const std::string &description);
107 std::string description,
117 unsigned int universe_id,
119 const std::vector<client::OlaDevice> &devices);
123 const std::vector<client::OlaDevice> &devices);
126 unsigned int universe_id,
131 unsigned int universe_id,
149 const std::string &details);
151 static const char HELP_PARAMETER[];
160 time_t m_start_time_t;
176 const std::string port_id_string,
177 unsigned int universe,
184 unsigned int device_alias;
187 std::string string_id;
190 void DecodePortIds(
const std::string &port_ids,
191 std::vector<port_identifier> *ports);
193 void RegisterHandler(
194 const std::string &path,
198 static const char HELP_REDIRECTION[];
199 static const char K_BACKEND_DISCONNECTED_ERROR[];
200 static const unsigned int K_UNIVERSE_NAME_LIMIT = 100;
201 static const char K_PRIORITY_VALUE_SUFFIX[];
202 static const char K_PRIORITY_MODE_SUFFIX[];
Export variables on the http server.
Holds information about RDM PIDs.
Definition ActionQueue.h:54
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
A container for the exported variables.
Definition ExportMap.h:324
The main OlaServer class.
Definition OlaServer.h:61
Definition OladHTTPServer.h:42
int JsonPluginInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the plugin info as a JSON string.
Definition OladHTTPServer.cpp:332
void SetPidStore(const ola::rdm::RootPidStore *pid_store)
Can be called while the HTTP server is running.
Definition OladHTTPServer.cpp:266
bool Init()
Setup the OLA HTTP server.
Definition OladHTTPServer.cpp:245
static int ServeHelpRedirect(ola::http::HTTPResponse *response)
Definition OladHTTPServer.h:144
OladHTTPServer(ExportMap *export_map, const OladHTTPServerOptions &options, ola::io::ConnectedDescriptor *client_socket, class OlaServer *ola_server, const ola::network::Interface &iface)
Create a new OLA HTTP server.
Definition OladHTTPServer.cpp:77
void HandleUniverseList(ola::http::HTTPResponse *response, ola::web::JsonObject *json, const client::Result &result, const std::vector< client::OlaUniverse > &universes)
Handle the universe list callback.
Definition OladHTTPServer.cpp:712
static int ServeUsage(ola::http::HTTPResponse *response, const std::string &details)
Serve usage information.
Definition OladHTTPServer.cpp:1006
int GetDmx(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Handle the get DMX command.
Definition OladHTTPServer.cpp:563
int JsonAvailablePorts(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return a list of unbound ports.
Definition OladHTTPServer.cpp:385
int SetPluginState(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Set plugin state.
Definition OladHTTPServer.cpp:525
int JsonUniversePluginList(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the list of universes / plugins as a json string.
Definition OladHTTPServer.cpp:316
int CreateNewUniverse(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Create a new universe by binding one or more ports.
Definition OladHTTPServer.cpp:420
int JsonServerStats(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the server stats JSON.
Definition OladHTTPServer.cpp:277
void HandleUniverseInfo(ola::http::HTTPResponse *response, const client::Result &result, const client::OlaUniverse &universe)
Handle the universe info.
Definition OladHTTPServer.cpp:808
int JsonUniverseInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return information about a universe.
Definition OladHTTPServer.cpp:358
void HandlePluginList(ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaPlugin > &plugins)
Handle the plugin list callback.
Definition OladHTTPServer.cpp:675
int HandleSetDmx(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Handle the set DMX command.
Definition OladHTTPServer.cpp:587
void HandlePartialPluginInfo(ola::http::HTTPResponse *response, int plugin_id, const client::Result &result, const std::string &description)
Handle the plugin description response.
Definition OladHTTPServer.cpp:745
int ReloadPlugins(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Reload all plugins.
Definition OladHTTPServer.cpp:643
void HandleCandidatePorts(ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaDevice > &devices)
Handle the list of candidate ports.
Definition OladHTTPServer.cpp:885
void HandlePluginInfo(ola::http::HTTPResponse *response, std::string description, const client::Result &result, const ola::client::PluginState &state)
Handle the plugin description response.
Definition OladHTTPServer.cpp:767
int DisplayQuit(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Cause the server to shutdown.
Definition OladHTTPServer.cpp:619
int ModifyUniverse(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Modify an existing universe.
Definition OladHTTPServer.cpp:466
int ReloadPidStore(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Reload the PID Store.
Definition OladHTTPServer.cpp:657
Definition RDMHTTPModule.h:45
The callback based C++ client for OLA.
Definition OlaClient.h:45
Represents a device.
Definition ClientTypes.h:219
The base class that represents a port.
Definition ClientTypes.h:119
Represents a universe.
Definition ClientTypes.h:264
Indicates the result of a OLA API call.
Definition Result.h:52
Definition HTTPServer.h:65
Definition HTTPServer.h:110
static int ServeRedirect(HTTPResponse *response, const std::string &location)
Serve a redirect.
Definition HTTPServer.cpp:776
Definition OlaHTTPServer.h:38
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition Descriptor.h:283
Definition Interface.h:35
The root of the RDM parameter descriptor store.
Definition PidStore.h:68
A JSON object. JSON Objects are key : value mappings, similar to dictionaries in Python.
Definition Json.h:899
PatchAction
The patch action, used with OlaClient::Patch()
Definition ClientArgs.h:38
PortDirection
The port direction.
Definition ClientArgs.h:54
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
Definition OladHTTPServer.h:45
The state of a plugin. This information can be used to detect conflicts between plugins.
Definition ClientTypes.h:93
Definition HTTPServer.h:162