Management API server for a C++ microservice.
More...
#include <management_api.h>
|
| | ManagementApi (const std::string &name, const unsigned short port) |
| | Construct a microservices management API manager class. More...
|
| |
|
| ~ManagementApi () |
| | Management API destructor.
|
| |
|
void | start () |
| |
|
void | startServer () |
| |
|
void | stop () |
| |
|
void | stopServer () |
| |
| void | registerStats (JSONProvider *statsProvider) |
| | Register a statistics provider. More...
|
| |
| void | registerProvider (JSONProvider *provider) |
| | Register a generic provider. More...
|
| |
|
void | registerService (ServiceHandler *serviceHandler) |
| |
|
unsigned short | getListenerPort () |
| |
| void | ping (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a ping request, construct a reply and return to caller. More...
|
| |
| void | shutdown (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a shutdown request, construct a reply and return to caller. More...
|
| |
| void | configChange (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a config change request, construct a reply and return to caller. More...
|
| |
| void | configChildCreate (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a children creation request, construct a reply and return to caller. More...
|
| |
| void | configChildDelete (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a children deletion request, construct a reply and return to caller. More...
|
| |
| void | securityChange (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request) |
| | Received a security change request, construct a reply and return to caller. More...
|
| |
|
|
std::string | m_name |
| |
|
Logger * | m_logger |
| |
|
time_t | m_startTime |
| |
|
HttpServer * | m_server |
| |
|
JSONProvider * | m_statsProvider |
| |
|
ServiceHandler * | m_serviceHandler |
| |
|
std::thread * | m_thread |
| |
Management API server for a C++ microservice.
◆ ManagementApi()
| ManagementApi::ManagementApi |
( |
const std::string & |
name, |
|
|
const unsigned short |
port |
|
) |
| |
Construct a microservices management API manager class.
- Parameters
-
| name | The service name |
| port | The management API port |
◆ configChange()
| void ManagementApi::configChange |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a config change request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
◆ configChildCreate()
| void ManagementApi::configChildCreate |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a children creation request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
◆ configChildDelete()
| void ManagementApi::configChildDelete |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a children deletion request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
◆ getInstance()
Return the signleton instance of the management interface.
Note if one has not been explicitly created then this will return 0.
◆ ping()
| void ManagementApi::ping |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a ping request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
◆ registerProvider()
| void ManagementApi::registerProvider |
( |
JSONProvider * |
provider | ) |
|
Register a generic provider.
There can be multiple providers for a single service
- Parameters
-
| provider | The JSON status provider to add |
◆ registerStats()
| void ManagementApi::registerStats |
( |
JSONProvider * |
statsProvider | ) |
|
Register a statistics provider.
- Parameters
-
| statsProvider | The statistics provider for the service |
◆ securityChange()
| void ManagementApi::securityChange |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a security change request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
◆ shutdown()
| void ManagementApi::shutdown |
( |
std::shared_ptr< HttpServer::Response > |
response, |
|
|
std::shared_ptr< HttpServer::Request > |
request |
|
) |
| |
Received a shutdown request, construct a reply and return to caller.
- Parameters
-
| response | The HTTP response |
| request | The HTTP request |
The documentation for this class was generated from the following files: