MXS-1220: Implement /maxscale/ resource
The resource exposes the various directories that MaxScale uses. Further information, like uptime, could be added at a later point.
This commit is contained in:
@ -3796,3 +3796,23 @@ int config_parse_server_list(const char *servers, char ***output_array)
|
||||
}
|
||||
return output_ind;
|
||||
}
|
||||
|
||||
json_t* config_paths_to_json(const char* host)
|
||||
{
|
||||
json_t* obj = json_object();
|
||||
|
||||
json_object_set_new(obj, "libdir", json_string(get_libdir()));
|
||||
json_object_set_new(obj, "datadir", json_string(get_datadir()));
|
||||
json_object_set_new(obj, "process_datadir", json_string(get_process_datadir()));
|
||||
json_object_set_new(obj, "cachedir", json_string(get_cachedir()));
|
||||
json_object_set_new(obj, "configdir", json_string(get_configdir()));
|
||||
json_object_set_new(obj, "config_persistdir", json_string(get_config_persistdir()));
|
||||
json_object_set_new(obj, "module_configdir", json_string(get_module_configdir()));
|
||||
json_object_set_new(obj, "piddir", json_string(get_piddir()));
|
||||
json_object_set_new(obj, "logdir", json_string(get_logdir()));
|
||||
json_object_set_new(obj, "langdir", json_string(get_langdir()));
|
||||
json_object_set_new(obj, "execdir", json_string(get_execdir()));
|
||||
json_object_set_new(obj, "connector_plugindir", json_string(get_connector_plugindir()));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
@ -306,8 +306,7 @@ HttpResponse cb_get_session(const HttpRequest& request)
|
||||
|
||||
HttpResponse cb_maxscale(const HttpRequest& request)
|
||||
{
|
||||
// TODO: Show logs
|
||||
return HttpResponse(MHD_HTTP_OK);
|
||||
return HttpResponse(MHD_HTTP_OK, config_paths_to_json(request.host()));
|
||||
}
|
||||
|
||||
HttpResponse cb_logs(const HttpRequest& request)
|
||||
|
||||
Reference in New Issue
Block a user