Comparing version 2.0.2 to 2.0.3
@@ -58,2 +58,25 @@ var EventEmitter = require('events').EventEmitter, | ||
Docker.prototype.loadImage = function(file, opts, callback) { | ||
if (!callback && typeof(opts) === 'function') { | ||
callback = opts; | ||
opts = null; | ||
} | ||
var self = this; | ||
var optsf = { | ||
path: '/images/load?', | ||
method: 'POST', | ||
options: opts, | ||
file: file, | ||
statusCodes: { | ||
200: true, | ||
500: "server error" | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
callback(err, data); | ||
}); | ||
}; | ||
Docker.prototype.checkAuth = function(opts, callback) { | ||
@@ -269,6 +292,10 @@ var self = this; | ||
Docker.prototype.run = function(image, cmd, streamo, options, callback) { | ||
if (!callback && typeof(options) === 'function') { | ||
callback = options; | ||
options = {}; | ||
Docker.prototype.run = function(image, cmd, streamo, createOptions, startOptions, callback) { | ||
if (!callback && typeof(createOptions) === 'function') { | ||
callback = createOptions; | ||
createOptions = {}; | ||
startOptions = {}; | ||
} else if (!callback && typeof(startOptions) === 'function') { | ||
callback = startOptions; | ||
startOptions = {}; | ||
} | ||
@@ -301,3 +328,3 @@ | ||
container.start(function(err, data) { | ||
container.start(startOptions, function(err, data) { | ||
if(err) return callback(err, data); | ||
@@ -329,3 +356,3 @@ | ||
_.extend(optsc, options); | ||
_.extend(optsc, createOptions); | ||
@@ -332,0 +359,0 @@ this.createContainer(optsc, handler); |
@@ -42,2 +42,18 @@ var Image = function(modem, name) { | ||
Image.prototype.get = function(callback) { | ||
var opts = { | ||
path: '/images/' + this.name + '/get', | ||
method: 'GET', | ||
isStream: true, | ||
statusCodes: { | ||
200: true, | ||
500: "server error" | ||
} | ||
}; | ||
this.modem.dial(opts, function(err, data) { | ||
callback(err, data); | ||
}); | ||
}; | ||
Image.prototype.push = function(opts, callback, auth) { | ||
@@ -44,0 +60,0 @@ var self = this; |
{ | ||
"name": "dockerode", | ||
"description": "Docker.io / Docker remote API implementation.", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "Pedro Dias <petermdias@gmail.com>", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -131,3 +131,4 @@ # dockerode | ||
* `stream` - stream(s) which will be used for execution output. | ||
* `[create_options]` - options used for container creation. | ||
* `create_options` - options used for container creation. (optional) | ||
* `start_options` - options used for container start. (optional) | ||
* `callback` - callback called when execution ends. | ||
@@ -134,0 +135,0 @@ |
30203
844
185