Open Lighting Architecture: ola::OladHTTPServer Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ola::OladHTTPServer Class Reference
Inheritance diagram for ola::OladHTTPServer:

## Classes
struct | OladHTTPServerOptions

## Public Member Functions
| 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.
bool | Init ()
| Setup the OLA HTTP server.
void | SetPidStore (const ola::rdm::RootPidStore *pid_store)
| Can be called while the HTTP server is running.
int | JsonServerStats (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Print the server stats JSON.
int | JsonUniversePluginList (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Print the list of universes / plugins as a json string.
int | JsonPluginInfo (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Print the plugin info as a JSON string.
int | SetPluginState (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Set plugin state.
int | JsonUniverseInfo (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Return information about a universe.
int | JsonAvailablePorts (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Return a list of unbound ports.
int | CreateNewUniverse (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Create a new universe by binding one or more ports.
int | ModifyUniverse (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Modify an existing universe.
int | GetDmx (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Handle the get DMX command.
int | HandleSetDmx (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Handle the set DMX command.
int | DisplayQuit (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Cause the server to shutdown.
int | ReloadPlugins (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Reload all plugins.
int | ReloadPidStore (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
| Reload the PID Store.
void | HandlePluginList (ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaPlugin > &plugins)
| Handle the plugin list callback.
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.
void | HandlePartialPluginInfo (ola::http::HTTPResponse *response, int plugin_id, const client::Result &result, const std::string &description)
| Handle the plugin description response.
void | HandlePluginInfo (ola::http::HTTPResponse *response, std::string description, const client::Result &result, const ola::client::PluginState &state)
| Handle the plugin description response.
void | HandleUniverseInfo (ola::http::HTTPResponse *response, const client::Result &result, const client::OlaUniverse &universe)
| Handle the universe info.
void | HandlePortsForUniverse (ola::http::HTTPResponse *response, ola::web::JsonObject *json, unsigned int universe_id, const client::Result &result, const std::vector< client::OlaDevice > &devices)
void | HandleCandidatePorts (ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaDevice > &devices)
| Handle the list of candidate ports.
void | CreateUniverseComplete (ola::http::HTTPResponse *response, unsigned int universe_id, bool included_name, class ActionQueue *action_queue)
void | SendCreateUniverseResponse (ola::http::HTTPResponse *response, unsigned int universe_id, bool included_name, class ActionQueue *action_queue)
void | ModifyUniverseComplete (ola::http::HTTPResponse *response, class ActionQueue *action_queue)
void | SendModifyUniverseResponse (ola::http::HTTPResponse *response, class ActionQueue *action_queue)
Public Member Functions inherited from ola::http::OlaHTTPServer
| OlaHTTPServer (const HTTPServer::HTTPServerOptions &options, ola::ExportMap *export_map)
bool | Start ()
void | Stop ()

## Static Public Member Functions
static int | ServeHelpRedirect (ola::http::HTTPResponse *response)
static int | ServeUsage (ola::http::HTTPResponse *response, const std::string &details)
| Serve usage information.

## Static Public Attributes
static const char | HELP_PARAMETER [] = "help"

## Additional Inherited Members
Protected Member Functions inherited from ola::http::OlaHTTPServer
void | RegisterFile (const std::string &file, const std::string &content_type)
Protected Attributes inherited from ola::http::OlaHTTPServer
Clock | m_clock
ola::ExportMap * | m_export_map
HTTPServer | m_server
TimeStamp | m_start_time

## Constructor & Destructor Documentation

## ◆ OladHTTPServer()

ola::OladHTTPServer::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.

Parameters

  export_map | the ExportMap to display when /debug is called
  options | the OladHTTPServerOptions for the OLA HTTP server
  client_socket | A ConnectedDescriptor which is used to communicate with the server.
  ola_server | the OlaServer to use
  iface | the network interface to bind to

## Member Function Documentation

## ◆ CreateNewUniverse()

int ola::OladHTTPServer::CreateNewUniverse | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Create a new universe by binding one or more ports.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ DisplayQuit()

int ola::OladHTTPServer::DisplayQuit | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Cause the server to shutdown.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ GetDmx()

int ola::OladHTTPServer::GetDmx | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Handle the get DMX command.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ HandleCandidatePorts()

void ola::OladHTTPServer::HandleCandidatePorts | ( | ola::http::HTTPResponse * | response,
|  | const client::Result & | result,
|  | const std::vector< client::OlaDevice > & | devices )

Handle the list of candidate ports.

Parameters

  response | the HTTPResponse that is associated with the request.
  result | the result of the API call
  devices | the possible devices & ports

## ◆ HandlePartialPluginInfo()

void ola::OladHTTPServer::HandlePartialPluginInfo | ( | ola::http::HTTPResponse * | response,
|  | int | plugin_id,
|  | const client::Result & | result,
|  | const std::string & | description )

Handle the plugin description response.

Parameters

  response | the HTTPResponse that is associated with the request.
  plugin_id | the plugin id.
  result | the result of the API call.
  description | the plugin description.

## ◆ HandlePluginInfo()

void ola::OladHTTPServer::HandlePluginInfo | ( | ola::http::HTTPResponse * | response,
|  | std::string | description,
|  | const client::Result & | result,
|  | const ola::client::PluginState & | state )

Handle the plugin description response.

Parameters

  response | the HTTPResponse that is associated with the request.
  description | the plugin description
  result | the result of the API call.
  state | the state of the plugin.

## ◆ HandlePluginList()

void ola::OladHTTPServer::HandlePluginList | ( | ola::http::HTTPResponse * | response,
|  | const client::Result & | result,
|  | const std::vector< client::OlaPlugin > & | plugins )

Handle the plugin list callback.

Parameters

  response | the HTTPResponse that is associated with the request.
  result | the result of the API call
  plugins | a list of plugins

## ◆ HandleSetDmx()

int ola::OladHTTPServer::HandleSetDmx | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Handle the set DMX command.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ HandleUniverseInfo()

void ola::OladHTTPServer::HandleUniverseInfo | ( | ola::http::HTTPResponse * | response,
|  | const client::Result & | result,
|  | const client::OlaUniverse & | universe )

Handle the universe info.

Parameters

  response | the HTTPResponse that is associated with the request.
  result | the result of the API call
  universe | the OlaUniverse object

## ◆ HandleUniverseList()

void ola::OladHTTPServer::HandleUniverseList | ( | ola::http::HTTPResponse * | response,
|  | ola::web::JsonObject * | json,
|  | const client::Result & | result,
|  | const std::vector< client::OlaUniverse > & | universes )

Handle the universe list callback.

Parameters

  response | the HTTPResponse that is associated with the request.
  JSON | the JsonObject to add the data to
  result | the result of the API call
  universes | the vector of OlaUniverse

## ◆ Init()

bool ola::OladHTTPServer::Init | ( |  | ) |
| virtual

Setup the OLA HTTP server.

Returns
  true if this worked, false otherwise.

Reimplemented from ola::http::OlaHTTPServer.

## ◆ JsonAvailablePorts()

int ola::OladHTTPServer::JsonAvailablePorts | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Return a list of unbound ports.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ JsonPluginInfo()

int ola::OladHTTPServer::JsonPluginInfo | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Print the plugin info as a JSON string.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ JsonServerStats()

int ola::OladHTTPServer::JsonServerStats | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Print the server stats JSON.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ JsonUniverseInfo()

int ola::OladHTTPServer::JsonUniverseInfo | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Return information about a universe.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ JsonUniversePluginList()

int ola::OladHTTPServer::JsonUniversePluginList | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Print the list of universes / plugins as a json string.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ ModifyUniverse()

int ola::OladHTTPServer::ModifyUniverse | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Modify an existing universe.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ ReloadPidStore()

int ola::OladHTTPServer::ReloadPidStore | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Reload the PID Store.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ ReloadPlugins()

int ola::OladHTTPServer::ReloadPlugins | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Reload all plugins.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

## ◆ ServeHelpRedirect()

int ola::OladHTTPServer::ServeHelpRedirect | ( | ola::http::HTTPResponse * | response | ) |
| inlinestatic

Serve a help redirect

Parameters

  response | the response to use

## ◆ ServeUsage()

int ola::OladHTTPServer::ServeUsage | ( | ola::http::HTTPResponse * | response,
|  | const std::string & | details )
| static

Serve usage information.

Parameters

  response | the response to use.
  details | the usage information

## ◆ SetPluginState()

int ola::OladHTTPServer::SetPluginState | ( | const ola::http::HTTPRequest * | request,
|  | ola::http::HTTPResponse * | response )

Set plugin state.

Parameters

  request | the HTTPRequest
  response | the HTTPResponse

Returns
  MHD_NO or MHD_YES

The documentation for this class was generated from the following files:

- olad/OladHTTPServer.h
- olad/OladHTTPServer.cpp