Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,19 @@ HAProxy.prototype.enable = function enable(backend, server, fn) {
return this.send('enable server %s/%s', backend, server).call(fn);
};

/**
* Set the server state to [ ready / maint / drain ]
*
* @param {String} backend Name of the backend server.
* @param {String} server The server that needs to be disabled in the backend.
* @param {String} newState new state for the server [ ready / maint / drain ]
* @param {Function} fn Callback.
* @api public
*/
HAProxy.prototype.state = function state(backend, server, newState, fn) {
return this.send('set server %s/%s state %s', backend || '', server || '', newState || '').call(fn);
};

/**
* Mark the frontend as temporarilty stopped. This corresponds to the mode which
* is used during a soft restart. THe frontend releases the port but it can be
Expand Down