Socket
Socket
Sign inDemoInstall

dockerode

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dockerode - npm Package Compare versions

Comparing version 2.4.3 to 2.5.0

16

lib/docker.js

@@ -503,14 +503,20 @@ var EventEmitter = require('events').EventEmitter,

*/
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) {

@@ -526,3 +532,3 @@ self.modem.dial(optsf, function(err, data) {

this.modem.dial(optsf, function(err, data) {
callback(err, data);
args.callback(err, data);
});

@@ -529,0 +535,0 @@ }

@@ -100,7 +100,8 @@ var util = require('./util');

*/
Node.prototype.remove = function(callback) {
Node.prototype.remove = function(opts, callback) {
var self = this;
var args = util.processArgs(opts, callback);
var optsf = {
path: '/nodes/' + this.id,
path: '/nodes/' + this.id + '?',
method: 'DELETE',

@@ -111,6 +112,7 @@ statusCodes: {

500: 'server error'
}
},
options: args.opts
};
if(callback === undefined) {
if(args.callback === undefined) {
return new this.modem.Promise(function(resolve, reject) {

@@ -126,3 +128,3 @@ self.modem.dial(optsf, function(err, data) {

this.modem.dial(optsf, function(err, data) {
callback(err, data);
args.callback(err, data);
});

@@ -129,0 +131,0 @@ }

@@ -91,6 +91,12 @@ var util = require('./util');

var self = this;
if (!callback && typeof opts === 'function') {
callback = opts;
opts = auth;
auth = opts.authconfig || undefined;
if (!callback) {
var t = typeof opts;
if(t === 'function'){
callback = opts;
opts = auth;
auth = opts.authconfig || undefined;
} else if (t === 'undefined'){
opts = auth;
auth = opts.authconfig || undefined;
}
}

@@ -128,2 +134,43 @@

/**
* Service logs
* @param {Object} opts Logs options. (optional)
* @param {Function} callback Callback with data
*/
Service.prototype.logs = function(opts, callback) {
var self = this;
var args = util.processArgs(opts, callback, {});
var optsf = {
path: '/services/' + this.id + '/logs?',
method: 'GET',
isStream: true,
statusCodes: {
200: true,
404: 'no such service',
500: 'server error',
503: 'node is not part of a swarm'
},
options: args.opts
};
if(args.callback === undefined) {
return new this.modem.Promise(function(resolve, reject) {
self.modem.dial(optsf, function(err, data) {
if (err) {
return reject(err);
}
resolve(data);
});
});
} else {
this.modem.dial(optsf, function(err, data) {
args.callback(err, data);
});
}
};
module.exports = Service;
{
"name": "dockerode",
"description": "Docker Remote API module.",
"version": "2.4.3",
"version": "2.5.0",
"author": "Pedro Dias <petermdias@gmail.com>",

@@ -19,3 +19,3 @@ "maintainers": [

"concat-stream": "~1.5.1",
"docker-modem": "0.3.x",
"docker-modem": "^1.0.0",
"tar-fs": "~1.12.0"

@@ -22,0 +22,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc