Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-docker-api

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-docker-api - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

7

lib/service.d.ts

@@ -37,2 +37,9 @@ import Modem = require('docker-modem');

remove(opts?: Object): Promise<String>;
/**
* Logs of a service
* https://docs.docker.com/engine/api/v1.27/#operation/ServiceLogs
* @param {Object} opts Query params in the request (optional)
* @return {Promise} Promise return the result
*/
logs(opts?: Object): Promise<String>;
}

@@ -39,0 +46,0 @@ export default class {

@@ -96,2 +96,30 @@ 'use strict';

}
/**
* Logs of a service
* https://docs.docker.com/engine/api/v1.27/#operation/ServiceLogs
* @param {Object} opts Query params in the request (optional)
* @return {Promise} Promise return the result
*/
logs(opts) {
const call = {
path: `/services/${this.id}/logs?`,
method: 'GET',
options: opts,
statusCodes: {
101: true,
200: true,
404: 'no such service',
500: 'server error',
501: 'use --experimental to see this',
503: 'node is not part of a swarm'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, res) => {
if (err)
return reject(err);
resolve(res);
});
});
}
}

@@ -98,0 +126,0 @@ exports.Service = Service;

2

package.json
{
"name": "node-docker-api",
"version": "1.1.9",
"version": "1.1.10",
"description": "Docker Remote API driver for node",

@@ -5,0 +5,0 @@ "main": "./lib/docker",

@@ -105,2 +105,31 @@ 'use strict'

}
/**
* Logs of a service
* https://docs.docker.com/engine/api/v1.27/#operation/ServiceLogs
* @param {Object} opts Query params in the request (optional)
* @return {Promise} Promise return the result
*/
logs (opts?: Object): Promise<String> {
const call = {
path: `/services/${this.id}/logs?`,
method: 'GET',
options: opts,
statusCodes: {
101: true,
200: true,
404: 'no such service',
500: 'server error',
501: 'use --experimental to see this',
503: 'node is not part of a swarm'
}
}
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, res: String) => {
if (err) return reject(err)
resolve(res)
})
})
}
}

@@ -107,0 +136,0 @@

@@ -108,2 +108,7 @@ import test from 'ava'

})
test('logs-service', async t => {
const res = await (await createService()).logs({stdout: true})
t.is(res.constructor, String)
})

@@ -110,0 +115,0 @@

Sorry, the diff of this file is not supported yet

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