MEDIUM: server: change server ip address from stats socket
New command available on the stats socket to change a server addr using
the command "set server <backend>/<server> addr <ip4|ip6>"
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 31bc0ba..cd19279 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -186,7 +186,7 @@
" show table [id]: report table usage stats or dump this table's contents\n"
" get weight : report a server's current weight\n"
" set weight : change a server's weight\n"
- " set server : change a server's state or weight\n"
+ " set server : change a server's state, weight or address\n"
" set table [id] : update or create a table entry's data\n"
" set timeout : change a timeout setting\n"
" set maxconn : change a maxconn setting\n"
@@ -1510,8 +1510,15 @@
appctx->st0 = STAT_CLI_PRINT;
}
}
+ else if (strcmp(args[3], "addr") == 0) {
+ warning = server_parse_addr_change_request(sv, args[4]);
+ if (warning) {
+ appctx->ctx.cli.msg = warning;
+ appctx->st0 = STAT_CLI_PRINT;
+ }
+ }
else {
- appctx->ctx.cli.msg = "'set server <srv>' only supports 'agent', 'health', 'state' and 'weight'.\n";
+ appctx->ctx.cli.msg = "'set server <srv>' only supports 'agent', 'health', 'state', 'weight' and 'addr'.\n";
appctx->st0 = STAT_CLI_PRINT;
}
return 1;