MXS-1220: Add monitor to JSON conversion

Monitors can now be printed in JSON format. The REST API resource
`/monitors` accepts GET requests and returns a JSON representation of the
monitors as a response.
This commit is contained in:
Markus Mäkelä
2017-04-17 19:18:27 +03:00
committed by Markus Mäkelä
parent d2e4d9cc64
commit 75b44198ba
3 changed files with 106 additions and 2 deletions

View File

@ -244,4 +244,20 @@ void mon_process_state_changes(MXS_MONITOR *monitor, const char *script, uint64_
*/
void mon_hangup_failed_servers(MXS_MONITOR *monitor);
/**
* @brief Convert monitor to JSON
*
* @param monitor Monitor to convert
*
* @return JSON representation of the monitor
*/
json_t* monitor_to_json(const MXS_MONITOR* monitor);
/**
* @brief Convert all monitors to JSON
*
* @return JSON array containing all monitors
*/
json_t* monitor_list_to_json();
MXS_END_DECLS