Skip to content

Commit

Permalink
added support for state change for backend server
Browse files Browse the repository at this point in the history
  • Loading branch information
goodwill committed Jul 15, 2017
1 parent 93d7bf9 commit 2063a1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,18 @@ HAProxy.prototype.enable = function enable(backend, server, fn) {
return this.send('enable server %s/%s', backend, server).call(fn);
};

/**
* Set the server attribute
*
* @param {String} backend Name of the backend server.
* @param {String} server The server that needs to be disabled in the backend.
* @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

0 comments on commit 2063a1e

Please sign in to comment.