diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index e1d04d6da..f5dd9a397 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -307,16 +307,6 @@ enum {
HTTP_ERR_SIZE
};
-/* Actions available for the stats admin forms */
-enum {
- ST_ADM_ACTION_NONE = 0,
- ST_ADM_ACTION_DISABLE,
- ST_ADM_ACTION_ENABLE,
- ST_ADM_ACTION_STOP,
- ST_ADM_ACTION_START,
- ST_ADM_ACTION_SHUTDOWN,
-};
-
/* status codes available for the stats admin page */
enum {
STAT_STATUS_INIT = 0,
diff --git a/src/dumpstats.c b/src/dumpstats.c
index cca1d123d..4e4b657c9 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -86,6 +86,20 @@ enum {
STAT_CLI_O_POOLS, /* dump memory pools */
};
+/* Actions available for the stats admin forms */
+enum {
+ ST_ADM_ACTION_NONE = 0,
+ ST_ADM_ACTION_READY,
+ ST_ADM_ACTION_DRAIN,
+ ST_ADM_ACTION_MAINT,
+ ST_ADM_ACTION_SHUTDOWN,
+ /* these are the ancient actions, still available for compatibility */
+ ST_ADM_ACTION_DISABLE,
+ ST_ADM_ACTION_ENABLE,
+ ST_ADM_ACTION_STOP,
+ ST_ADM_ACTION_START,
+};
+
static int stats_dump_info_to_buffer(struct stream_interface *si);
static int stats_dump_pools_to_buffer(struct stream_interface *si);
static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct session *sess);
@@ -3446,10 +3460,9 @@ static void stats_dump_html_px_end(struct stream_interface *si, struct proxy *px
"Choose the action to perform on the checked servers : "
""
""
@@ -4206,7 +4219,20 @@ static int stats_process_http_post(struct stream_interface *si)
}
}
else if (!action && (strcmp(key, "action") == 0)) {
- if (strcmp(value, "disable") == 0) {
+ if (strcmp(value, "ready") == 0) {
+ action = ST_ADM_ACTION_READY;
+ }
+ else if (strcmp(value, "drain") == 0) {
+ action = ST_ADM_ACTION_DRAIN;
+ }
+ else if (strcmp(value, "maint") == 0) {
+ action = ST_ADM_ACTION_MAINT;
+ }
+ else if (strcmp(value, "shutdown") == 0) {
+ action = ST_ADM_ACTION_SHUTDOWN;
+ }
+ /* else these are the old supported methods */
+ else if (strcmp(value, "disable") == 0) {
action = ST_ADM_ACTION_DISABLE;
}
else if (strcmp(value, "enable") == 0) {
@@ -4218,9 +4244,6 @@ static int stats_process_http_post(struct stream_interface *si)
else if (strcmp(value, "start") == 0) {
action = ST_ADM_ACTION_START;
}
- else if (strcmp(value, "shutdown") == 0) {
- action = ST_ADM_ACTION_SHUTDOWN;
- }
else {
appctx->ctx.stats.st_code = STAT_STATUS_ERRP;
goto out;
@@ -4268,6 +4291,21 @@ static int stats_process_http_post(struct stream_interface *si)
total_servers++;
}
break;
+ case ST_ADM_ACTION_READY:
+ srv_adm_set_ready(sv);
+ altered_servers++;
+ total_servers++;
+ break;
+ case ST_ADM_ACTION_DRAIN:
+ srv_adm_set_drain(sv);
+ altered_servers++;
+ total_servers++;
+ break;
+ case ST_ADM_ACTION_MAINT:
+ srv_adm_set_maint(sv);
+ altered_servers++;
+ total_servers++;
+ break;
case ST_ADM_ACTION_SHUTDOWN:
if (px->state != PR_STSTOPPED) {
struct session *sess, *sess_bck;