MXS-1220: Make modules proper resources

The /maxscale/modules/ endpoint is now a resource collection and the
/maxscale/modules/:module endpoint exposes the individual resources.
This commit is contained in:
Markus Mäkelä
2017-05-05 09:41:25 +03:00
parent 08dca8c273
commit ac21443529
6 changed files with 69 additions and 14 deletions

View File

@ -161,10 +161,21 @@ bool mxs_module_iterator_has_next(const MXS_MODULE_ITERATOR* iterator);
*/
MXS_MODULE* mxs_module_iterator_get_next(MXS_MODULE_ITERATOR* iterator);
/**
* @brief Convert module to JSON
*
* @param module Module to convert
* @param host Hostname of this server
*
* @return The module in JSON format
*/
json_t* module_to_json(const MXS_MODULE* module, const char* host);
/**
* @brief Convert all modules to JSON
*
* @param host The hostname of this server
*
* @return Array of modules in JSON format
*/
json_t* module_list_to_json(const char* host);