diff --git a/lib/docker.js b/lib/docker.js index 0712bde..b794e37 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -500,18 +500,24 @@ Docker.prototype.listServices = function(opts, callback) { * Lists Nodes * @param {Function} callback Callback */ -Docker.prototype.listNodes = function(callback) { +Docker.prototype.listNodes = function(opts, callback) { var self = this; + var args = util.processArgs(opts, callback); + var optsf = { - path: '/nodes', + path: '/nodes?', method: 'GET', + options: args.opts, statusCodes: { 200: true, - 500: 'server error' + 400: 'bad parameter', + 404: 'no such node', + 500: 'server error', + 503: 'node is not part of a swarm', } }; - if (callback === undefined) { + if (args.callback === undefined) { return new this.modem.Promise(function(resolve, reject) { self.modem.dial(optsf, function(err, data) { if (err) { @@ -522,7 +528,7 @@ Docker.prototype.listNodes = function(callback) { }); } else { this.modem.dial(optsf, function(err, data) { - callback(err, data); + args.callback(err, data); }); } };