From dd843784e88e41ed5a85d57ce65dffd4ebf27bfd Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Fri, 20 Feb 2015 14:04:16 +0000 Subject: [PATCH] Fix for /sessions URI and addition of /clients URI --- server/modules/routing/maxinfo/maxinfo.c | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/maxinfo/maxinfo.c b/server/modules/routing/maxinfo/maxinfo.c index 63d058ccd..cde14344b 100644 --- a/server/modules/routing/maxinfo/maxinfo.c +++ b/server/modules/routing/maxinfo/maxinfo.c @@ -54,7 +54,7 @@ MODULE_INFO info = { MODULE_API_ROUTER, - MODULE_GA, + MODULE_ALPHA_RELEASE, ROUTER_VERSION, "The MaxScale Information Schema" }; @@ -664,6 +664,26 @@ PARSE_ERROR err; return 1; } +/** + * Session all result set + * @return A resultset for all sessions + */ +static RESULTSET * +maxinfoSessionsAll() +{ + return sessionGetList(SESSION_LIST_ALL); +} + +/** + * Client session result set + * @return A resultset for all sessions + */ +static RESULTSET * +maxinfoClientSessions() +{ + return sessionGetList(SESSION_LIST_CONNECTION); +} + typedef RESULTSET *(*RESULTSETFUNC)(); /** @@ -678,7 +698,8 @@ static struct uri_table { { "/listeners", serviceGetListenerList }, { "/modules", moduleGetList }, { "/monitors", monitorGetList }, - { "/sessions", sessionGetList }, + { "/sessions", maxinfoSessionsAll }, + { "/clients", maxinfoClientSessions }, { "/servers", serverGetList }, { "/variables", maxinfo_variables }, { "/status", maxinfo_status },