Fledge
An open source edge computing platform for industrial users
CoreManagementApi Class Reference

Management API server for a C++ microservice. More...

#include <core_management_api.h>

Inheritance diagram for CoreManagementApi:
Collaboration diagram for CoreManagementApi:

Public Member Functions

 CoreManagementApi (const std::string &name, const unsigned short port)
 Construct a microservices management API manager class.
 
void registerMicroService (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a service registration request. More...
 
void unRegisterMicroService (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a service unregister request.
 
void getAllCategories (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a GET /fledge/service/category.
 
void getCategory (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a GET /fledge/service/category/{categoryName}.
 
void getCategoryItem (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a GET /fledge/service/category/{categoryName}/{itemName].
 
void deleteCategoryItemValue (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received a DELETE /fledge/service/category/{categoryName}/{configItem}/value.
 
void setCategoryItemValue (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Received PUT /fledge/service/category/{categoryName}/{configItem} Payload is {"value" : "some_data"} Send to client the JSON string of category item properties.
 
void deleteCategory (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Delete a config category Received DELETE /fledge/service/category/{categoryName} Send to client the JSON string of all remaining categories.
 
void deleteChildCategory (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Delete child categories of a config category Received DELETE /fledge/service/category/{categoryName}/children/{childCategory} Send to client the JSON string of all remaining categories.
 
void createCategory (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Create a new configuration category Received POST /fledge/service/category. More...
 
void addChildCategory (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Add child categories to a given category name Received POST /fledge/service/category/{categoryName}/children. More...
 
void defaultResource (std::shared_ptr< HttpServer::Response > response, std::shared_ptr< HttpServer::Request > request)
 Handle a bad URL endpoint call.
 
- Public Member Functions inherited from ManagementApi
 ManagementApi (const std::string &name, const unsigned short port)
 Construct a microservices management API manager class.
 
 ~ManagementApi ()
 Management API destructor.
 
void start ()
 
void startServer ()
 
void stop ()
 
void stopServer ()
 
void registerStats (JSONProvider *statsProvider)
 Register a statistics provider.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Static Public Member Functions

static CoreManagementApigetInstance ()
 Return the singleton instance of the core management interface. More...
 
- Static Public Member Functions inherited from ManagementApi
static ManagementApigetInstance ()
 Return the signleton instance of the management interface. More...
 

Additional Inherited Members

- Protected Attributes inherited from ManagementApi
std::string m_name
 
Loggerm_logger
 
time_t m_startTime
 
HttpServer * m_server
 
JSONProviderm_statsProvider
 
ServiceHandlerm_serviceHandler
 
std::thread * m_thread
 
- Static Protected Attributes inherited from ManagementApi
static ManagementApim_instance = 0
 

Detailed Description

Management API server for a C++ microservice.

Member Function Documentation

◆ addChildCategory()

void CoreManagementApi::addChildCategory ( std::shared_ptr< HttpServer::Response >  response,
std::shared_ptr< HttpServer::Request >  request 
)

Add child categories to a given category name Received POST /fledge/service/category/{categoryName}/children.

Send to client the JSON string with child categories

◆ createCategory()

void CoreManagementApi::createCategory ( std::shared_ptr< HttpServer::Response >  response,
std::shared_ptr< HttpServer::Request >  request 
)

Create a new configuration category Received POST /fledge/service/category.

Send to client the JSON string of new category's items

◆ getInstance()

CoreManagementApi * CoreManagementApi::getInstance ( )
static

Return the singleton instance of the core management interface.

Note if one has not been explicitly created then this will return 0.

◆ registerMicroService()

void CoreManagementApi::registerMicroService ( std::shared_ptr< HttpServer::Response >  response,
std::shared_ptr< HttpServer::Request >  request 
)

Received a service registration request.

Storage layer is registered Setup ConfigurationManager instance and URL entry points


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