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[];
207 #endif // OLAD_OLADHTTPSERVER_H_ Definition: OlaHTTPServer.h:38
int JsonAvailablePorts(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return a list of unbound ports.
Definition: OladHTTPServer.cpp:551
int CreateNewUniverse(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Create a new universe by binding one or more ports.
Definition: OladHTTPServer.cpp:586
int JsonPluginInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the plugin info as a JSON string.
Definition: OladHTTPServer.cpp:498
PortDirection
The port direction.
Definition: ClientArgs.h:54
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:933
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
int JsonUniversePluginList(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the list of universes / plugins as a json string.
Definition: OladHTTPServer.cpp:482
Represents a device.
Definition: ClientTypes.h:219
A container for the exported variables.
Definition: ExportMap.h:324
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
int DisplayQuit(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Cause the server to shutdown.
Definition: OladHTTPServer.cpp:785
Definition: HTTPServer.h:65
void SetPidStore(const ola::rdm::RootPidStore *pid_store)
Can be called while the HTTP server is running.
Definition: OladHTTPServer.cpp:422
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:78
Definition: HTTPServer.h:161
Definition: OladHTTPServer.h:44
int JsonUniverseInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return information about a universe.
Definition: OladHTTPServer.cpp:524
Holds information about RDM PIDs.
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:911
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
int SetPluginState(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Set plugin state.
Definition: OladHTTPServer.cpp:691
Export variables on the http server.
static int ServeHelpRedirect(ola::http::HTTPResponse *response)
Definition: OladHTTPServer.h:144
PatchAction
The patch action, used with OlaClient::Patch()
Definition: ClientArgs.h:38
The callback based C++ client for OLA.
Definition: OlaClient.h:45
int ReloadPidStore(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Reload the PID Store.
Definition: OladHTTPServer.cpp:823
bool Init()
Setup the OLA HTTP server.
Definition: OladHTTPServer.cpp:401
A JSON object. JSON Objects are key : value mappings, similar to dictionaries in Python.
Definition: Json.h:890
int HandleSetDmx(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Handle the set DMX command.
Definition: OladHTTPServer.cpp:753
Definition: OladHTTPServer.h:42
The state of a plugin. This information can be used to detect conflicts between plugins.
Definition: ClientTypes.h:93
Definition: HTTPServer.h:109
The main OlaServer class.
Definition: OlaServer.h:61
Definition: Interface.h:35
Indicates the result of a OLA API call.
Definition: Result.h:52
Represents a universe.
Definition: ClientTypes.h:264
static int ServeRedirect(HTTPResponse *response, const std::string &location)
Serve a redirect.
Definition: HTTPServer.cpp:794
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:1051
int ModifyUniverse(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Modify an existing universe.
Definition: OladHTTPServer.cpp:632
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
The root of the RDM parameter descriptor store.
Definition: PidStore.h:68
void HandleUniverseInfo(ola::http::HTTPResponse *response, const client::Result &result, const client::OlaUniverse &universe)
Handle the universe info.
Definition: OladHTTPServer.cpp:974
static int ServeUsage(ola::http::HTTPResponse *response, const std::string &details)
Serve usage information.
Definition: OladHTTPServer.cpp:1172
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:878
The base class that represents a port.
Definition: ClientTypes.h:119
int JsonServerStats(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Print the server stats JSON.
Definition: OladHTTPServer.cpp:433
Definition: RDMHTTPModule.h:45
Definition: ActionQueue.h:54
int ReloadPlugins(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Reload all plugins.
Definition: OladHTTPServer.cpp:809
void HandlePluginList(ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaPlugin > &plugins)
Handle the plugin list callback.
Definition: OladHTTPServer.cpp:841
int GetDmx(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Handle the get DMX command.
Definition: OladHTTPServer.cpp:729