MXS-1220: Add threads resource

The threads are now a REST API resource exposed via the /maxscale/threads
resource collection.
This commit is contained in:
Markus Mäkelä
2017-05-05 09:48:30 +03:00
parent ac21443529
commit 0e57bec4ef
4 changed files with 151 additions and 9 deletions

View File

@ -15,6 +15,7 @@
#include <maxscale/cdefs.h>
#include <maxscale/poll.h>
#include <maxscale/thread.h>
#include <maxscale/jansson.h>
MXS_BEGIN_DECLS
@ -142,4 +143,25 @@ MXS_SESSION* mxs_worker_deregister_session(uint64_t id);
*/
MXS_SESSION* mxs_worker_find_session(uint64_t id);
/**
* @brief Convert a worker to JSON format
*
* @param host Hostname of this server
* @param id ID of the worker
*
* @return JSON resource representing the worker
*/
json_t* mxs_worker_to_json(const char* host, int id);
/**
* Convert workers into JSON format
*
* @param host Hostname of this server
*
* @return A JSON resource collection of workers
*
* @see mxs_json_resource()
*/
json_t* mxs_worker_list_to_json(const char* host);
MXS_END_DECLS