Comparing version 2.2.10 to 2.3.0
@@ -7,2 +7,5 @@ var EventEmitter = require('events').EventEmitter, | ||
Network = require('./network'), | ||
Service = require('./service'), | ||
Task = require('./task'), | ||
Node = require('./node'), | ||
Exec = require('./exec'), | ||
@@ -116,3 +119,3 @@ util = require('./util'), | ||
opts.fromSrc = '-' | ||
opts.fromSrc = '-'; | ||
@@ -228,2 +231,26 @@ var self = this; | ||
/** | ||
* Fetches a Service by id | ||
* @param {String} id Services's id | ||
*/ | ||
Docker.prototype.getService = function(id) { | ||
return new Service(this.modem, id); | ||
}; | ||
/** | ||
* Fetches a Task by id | ||
* @param {String} id Task's id | ||
*/ | ||
Docker.prototype.getTask = function(id) { | ||
return new Task(this.modem, id); | ||
}; | ||
/** | ||
* Fetches Node by id | ||
* @param {String} id Node's id | ||
*/ | ||
Docker.prototype.getNode = function(id) { | ||
return new Node(this.modem, id); | ||
}; | ||
/** | ||
* Fetches a Network by id | ||
@@ -293,2 +320,67 @@ * @param {String} id network's id | ||
/** | ||
* Lists Services | ||
* @param {Function} callback Callback | ||
*/ | ||
Docker.prototype.listServices = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/services?', | ||
method: 'GET', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Lists Nodes | ||
* @param {Function} callback Callback | ||
*/ | ||
Docker.prototype.listNodes = function(callback) { | ||
var optsf = { | ||
path: '/nodes', | ||
method: 'GET', | ||
statusCodes: { | ||
200: true, | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Lists Tasks | ||
* @param {Function} callback Callback | ||
*/ | ||
Docker.prototype.listTasks = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/tasks?', | ||
method: 'GET', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Creates a new volume | ||
@@ -319,2 +411,29 @@ * @param {Object} opts Create options | ||
/** | ||
* Creates a new service | ||
* @param {Object} opts Create options | ||
* @param {Function} callback Callback | ||
*/ | ||
Docker.prototype.createService = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var self = this; | ||
var optsf = { | ||
path: '/services/create', | ||
method: 'POST', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, | ||
201: true, | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
if (err) return args.callback(err, data); | ||
args.callback(err, self.getService(data.ID || data.Id)); | ||
}); | ||
}; | ||
/** | ||
* Lists volumes | ||
@@ -457,7 +576,2 @@ * @param {Options} opts Options (optional) | ||
Docker.prototype.ping = function(callback) { | ||
if (!callback && typeof opts === 'function') { | ||
callback = opts; | ||
opts = null; | ||
} | ||
var optsf = { | ||
@@ -581,2 +695,3 @@ path: '/_ping', | ||
if (err) return callback(err, data, container); | ||
hub.emit('start', container); | ||
@@ -614,2 +729,100 @@ container.wait(function(err, data) { | ||
/** | ||
* Init swarm. | ||
* | ||
* @param {object} options | ||
* @param {function} callback | ||
*/ | ||
Docker.prototype.swarmInit = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/swarm/init', | ||
method: 'POST', | ||
statusCodes: { | ||
200: true, | ||
400: 'bad parameter', | ||
406: 'node is already part of a Swarm' | ||
}, | ||
options: args.opts | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Join swarm. | ||
* | ||
* @param {object} options | ||
* @param {function} callback | ||
*/ | ||
Docker.prototype.swarmJoin = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/swarm/join', | ||
method: 'POST', | ||
statusCodes: { | ||
200: true, | ||
400: 'bad parameter', | ||
406: 'node is already part of a Swarm' | ||
}, | ||
options: args.opts | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Leave swarm. | ||
* | ||
* @param {function} callback | ||
*/ | ||
Docker.prototype.swarmLeave = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/swarm/leave?', | ||
method: 'POST', | ||
statusCodes: { | ||
200: true, | ||
406: 'node is not part of a Swarm' | ||
}, | ||
options: args.opts | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
/** | ||
* Update swarm. | ||
* | ||
* @param {function} callback | ||
*/ | ||
Docker.prototype.swarmUpdate = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var optsf = { | ||
path: '/swarm/update', | ||
method: 'POST', | ||
statusCodes: { | ||
200: true, | ||
400: 'bad parameter', | ||
406: 'node is already part of a Swarm' | ||
}, | ||
options: args.opts | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
args.callback(err, data); | ||
}); | ||
}; | ||
module.exports = Docker; |
302
package.json
{ | ||
"name": "dockerode", | ||
"description": "Docker Remote API module.", | ||
"version": "2.2.10", | ||
"version": "2.3.0", | ||
"author": "Pedro Dias <petermdias@gmail.com>", | ||
@@ -33,166 +33,138 @@ "maintainers": [ | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Pedro Dias", | ||
"email": "petermdias@gmail.com", | ||
"url": "https://github.com/apocas", | ||
"contributions": 150 | ||
}, | ||
{ | ||
"name": "James Lal", | ||
"email": "jlal@mozilla.com", | ||
"url": "https://github.com/lightsofapollo", | ||
"contributions": 12 | ||
}, | ||
{ | ||
"name": "Ron Waldon", | ||
"email": "jokeyrhyme@gmail.com", | ||
"url": "https://github.com/jokeyrhyme", | ||
"contributions": 7 | ||
}, | ||
{ | ||
"name": "Everton Ribeiro", | ||
"email": "nuxlli@gmail.com", | ||
"url": "https://github.com/nuxlli", | ||
"contributions": 4 | ||
}, | ||
{ | ||
"name": "Sam Rijs", | ||
"email": "srijs@airpost.net", | ||
"url": "https://github.com/srijs", | ||
"contributions": 4 | ||
}, | ||
{ | ||
"name": "Shannon Poole", | ||
"email": "shannon.m.poole@gmail.com", | ||
"url": "https://github.com/shannonmpoole", | ||
"contributions": 3 | ||
}, | ||
{ | ||
"name": "Max Claus Nunes", | ||
"email": "maxcnunes@gmail.com", | ||
"url": "https://github.com/maxcnunes", | ||
"contributions": 2 | ||
}, | ||
{ | ||
"name": "Mike MacCana", | ||
"email": "mike.maccana@gmail.com", | ||
"url": "https://github.com/mikemaccana", | ||
"contributions": 2 | ||
}, | ||
{ | ||
"name": "Niclas Hoyer", | ||
"email": "", | ||
"url": "https://github.com/niclashoyer", | ||
"contributions": 2 | ||
}, | ||
{ | ||
"name": "Nicholas Morsman", | ||
"email": "nicholas@publishlab.com", | ||
"url": "https://github.com/nmorsman", | ||
"contributions": 2 | ||
}, | ||
{ | ||
"name": "Philip Reichenberger", | ||
"email": null, | ||
"url": "https://github.com/preichenberger", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Anton Serdyuk", | ||
"email": "anton.serdyuk@gmail.com", | ||
"url": "https://github.com/m00t", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Dan Williams", | ||
"email": "me+github@deedubs.com", | ||
"url": "https://github.com/deedubs", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Alex Wolfe", | ||
"email": "alexkwolfe@gmail.com", | ||
"url": "https://github.com/alexkwolfe", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Henry Allen-Tilford", | ||
"email": "htilford@gmail.com", | ||
"url": "https://github.com/generalhenry", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Geoffrey Bachelet", | ||
"email": "geoffrey.bachelet@gmail.com", | ||
"url": "https://github.com/ubermuda", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Jacob Friis Saxberg", | ||
"email": "jacob@saxberg.dk", | ||
"url": "https://github.com/webjay", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Jeffrey Morgan", | ||
"email": "jmorganca@gmail.com", | ||
"url": "https://github.com/jeffdm", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Kishore Nallan", | ||
"email": "kishore@kishorelive.com", | ||
"url": "https://github.com/kishorenc", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Mathias Buus", | ||
"email": "mathiasbuus@gmail.com", | ||
"url": "https://github.com/mafintosh", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Matthew Gallagher", | ||
"email": "mattva01@gmail.com", | ||
"url": "https://github.com/mattva01", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Wojciech Kocjan", | ||
"email": null, | ||
"url": "https://github.com/wojciechka", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Mike Macaulay", | ||
"email": "mmacaula@gmail.com", | ||
"url": "https://github.com/mmacaula", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Josh Matthews", | ||
"email": "josh@jmatthews.us", | ||
"url": "https://github.com/jmatth", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Vincent Woo", | ||
"email": "vincent@coderpad.io", | ||
"url": "https://github.com/vincentwoo", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Lewis J Ellis", | ||
"email": "me@lewisjellis.com", | ||
"url": "https://github.com/LewisJEllis", | ||
"contributions": 1 | ||
}, | ||
{ | ||
"name": "Adam Duncan", | ||
"email": "", | ||
"url": "https://github.com/microadam", | ||
"contributions": 1 | ||
} | ||
] | ||
"contributors": [{ | ||
"name": "Pedro Dias", | ||
"email": "petermdias@gmail.com", | ||
"url": "https://github.com/apocas", | ||
"contributions": 150 | ||
}, { | ||
"name": "James Lal", | ||
"email": "jlal@mozilla.com", | ||
"url": "https://github.com/lightsofapollo", | ||
"contributions": 12 | ||
}, { | ||
"name": "Ron Waldon", | ||
"email": "jokeyrhyme@gmail.com", | ||
"url": "https://github.com/jokeyrhyme", | ||
"contributions": 7 | ||
}, { | ||
"name": "Everton Ribeiro", | ||
"email": "nuxlli@gmail.com", | ||
"url": "https://github.com/nuxlli", | ||
"contributions": 4 | ||
}, { | ||
"name": "Sam Rijs", | ||
"email": "srijs@airpost.net", | ||
"url": "https://github.com/srijs", | ||
"contributions": 4 | ||
}, { | ||
"name": "Shannon Poole", | ||
"email": "shannon.m.poole@gmail.com", | ||
"url": "https://github.com/shannonmpoole", | ||
"contributions": 3 | ||
}, { | ||
"name": "Max Claus Nunes", | ||
"email": "maxcnunes@gmail.com", | ||
"url": "https://github.com/maxcnunes", | ||
"contributions": 2 | ||
}, { | ||
"name": "Mike MacCana", | ||
"email": "mike.maccana@gmail.com", | ||
"url": "https://github.com/mikemaccana", | ||
"contributions": 2 | ||
}, { | ||
"name": "Niclas Hoyer", | ||
"email": "", | ||
"url": "https://github.com/niclashoyer", | ||
"contributions": 2 | ||
}, { | ||
"name": "Nicholas Morsman", | ||
"email": "nicholas@publishlab.com", | ||
"url": "https://github.com/nmorsman", | ||
"contributions": 2 | ||
}, { | ||
"name": "Philip Reichenberger", | ||
"email": null, | ||
"url": "https://github.com/preichenberger", | ||
"contributions": 1 | ||
}, { | ||
"name": "Anton Serdyuk", | ||
"email": "anton.serdyuk@gmail.com", | ||
"url": "https://github.com/m00t", | ||
"contributions": 1 | ||
}, { | ||
"name": "Dan Williams", | ||
"email": "me+github@deedubs.com", | ||
"url": "https://github.com/deedubs", | ||
"contributions": 1 | ||
}, { | ||
"name": "Alex Wolfe", | ||
"email": "alexkwolfe@gmail.com", | ||
"url": "https://github.com/alexkwolfe", | ||
"contributions": 1 | ||
}, { | ||
"name": "Henry Allen-Tilford", | ||
"email": "htilford@gmail.com", | ||
"url": "https://github.com/generalhenry", | ||
"contributions": 1 | ||
}, { | ||
"name": "Geoffrey Bachelet", | ||
"email": "geoffrey.bachelet@gmail.com", | ||
"url": "https://github.com/ubermuda", | ||
"contributions": 1 | ||
}, { | ||
"name": "Jacob Friis Saxberg", | ||
"email": "jacob@saxberg.dk", | ||
"url": "https://github.com/webjay", | ||
"contributions": 1 | ||
}, { | ||
"name": "Jeffrey Morgan", | ||
"email": "jmorganca@gmail.com", | ||
"url": "https://github.com/jeffdm", | ||
"contributions": 1 | ||
}, { | ||
"name": "Kishore Nallan", | ||
"email": "kishore@kishorelive.com", | ||
"url": "https://github.com/kishorenc", | ||
"contributions": 1 | ||
}, { | ||
"name": "Mathias Buus", | ||
"email": "mathiasbuus@gmail.com", | ||
"url": "https://github.com/mafintosh", | ||
"contributions": 1 | ||
}, { | ||
"name": "Matthew Gallagher", | ||
"email": "mattva01@gmail.com", | ||
"url": "https://github.com/mattva01", | ||
"contributions": 1 | ||
}, { | ||
"name": "Wojciech Kocjan", | ||
"email": null, | ||
"url": "https://github.com/wojciechka", | ||
"contributions": 1 | ||
}, { | ||
"name": "Mike Macaulay", | ||
"email": "mmacaula@gmail.com", | ||
"url": "https://github.com/mmacaula", | ||
"contributions": 1 | ||
}, { | ||
"name": "Josh Matthews", | ||
"email": "josh@jmatthews.us", | ||
"url": "https://github.com/jmatth", | ||
"contributions": 1 | ||
}, { | ||
"name": "Vincent Woo", | ||
"email": "vincent@coderpad.io", | ||
"url": "https://github.com/vincentwoo", | ||
"contributions": 1 | ||
}, { | ||
"name": "Lewis J Ellis", | ||
"email": "me@lewisjellis.com", | ||
"url": "https://github.com/LewisJEllis", | ||
"contributions": 1 | ||
}, { | ||
"name": "Adam Duncan", | ||
"email": "", | ||
"url": "https://github.com/microadam", | ||
"contributions": 1 | ||
}] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62990
15
1868