mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
dockerode: Improve GetEventsOptions to allow passing a filter object (#43100)
* dockerode: apply prettier * dockerode: improve GetEventsOptions to allow passing a filter object
This commit is contained in:
parent
a805ad4309
commit
f614dfc4ce
@ -9,213 +9,221 @@ const docker3 = new Docker({ protocol: 'http', host: '127.0.0.1', port: 3000 });
|
||||
const docker4 = new Docker({ host: '127.0.0.1', port: 3000 });
|
||||
|
||||
const docker5 = new Docker({
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: 'ca',
|
||||
cert: 'cert',
|
||||
key: 'key'
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: 'ca',
|
||||
cert: 'cert',
|
||||
key: 'key',
|
||||
});
|
||||
|
||||
const docker6 = new Docker({
|
||||
protocol: 'https', // you can enforce a protocol
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: 'ca',
|
||||
cert: 'cert',
|
||||
key: 'key'
|
||||
protocol: 'https', // you can enforce a protocol
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: 'ca',
|
||||
cert: 'cert',
|
||||
key: 'key',
|
||||
});
|
||||
|
||||
const docker7 = new Docker({
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: fs.readFileSync('ca.pem'),
|
||||
cert: fs.readFileSync('cert.pem'),
|
||||
key: fs.readFileSync('key.pem'),
|
||||
version: 'v1.25' // required when Docker >= v1.13, https://docs.docker.com/engine/api/version-history/
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: fs.readFileSync('ca.pem'),
|
||||
cert: fs.readFileSync('cert.pem'),
|
||||
key: fs.readFileSync('key.pem'),
|
||||
version: 'v1.25', // required when Docker >= v1.13, https://docs.docker.com/engine/api/version-history/
|
||||
});
|
||||
|
||||
const docker8 = new Docker({
|
||||
protocol: 'https', // you can enforce a protocol
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: fs.readFileSync('ca.pem'),
|
||||
cert: fs.readFileSync('cert.pem'),
|
||||
key: fs.readFileSync('key.pem')
|
||||
protocol: 'https', // you can enforce a protocol
|
||||
host: '192.168.1.10',
|
||||
port: process.env.DOCKER_PORT || 2375,
|
||||
ca: fs.readFileSync('ca.pem'),
|
||||
cert: fs.readFileSync('cert.pem'),
|
||||
key: fs.readFileSync('key.pem'),
|
||||
});
|
||||
|
||||
const docker9 = new Docker({
|
||||
Promise
|
||||
Promise,
|
||||
});
|
||||
|
||||
async function foo() {
|
||||
const containers = await docker7.listContainers();
|
||||
for (const container of containers) {
|
||||
const foo = await docker7.getContainer(container.Id);
|
||||
const inspect = await foo.inspect();
|
||||
}
|
||||
const containers = await docker7.listContainers();
|
||||
for (const container of containers) {
|
||||
const foo = await docker7.getContainer(container.Id);
|
||||
const inspect = await foo.inspect();
|
||||
}
|
||||
|
||||
const images = await docker5.listImages();
|
||||
for (const image of images) {
|
||||
const foo = await docker5.getImage(image.Id);
|
||||
const inspect = await foo.inspect();
|
||||
await foo.remove();
|
||||
}
|
||||
const images = await docker5.listImages();
|
||||
for (const image of images) {
|
||||
const foo = await docker5.getImage(image.Id);
|
||||
const inspect = await foo.inspect();
|
||||
await foo.remove();
|
||||
}
|
||||
}
|
||||
|
||||
docker.getEvents(
|
||||
{
|
||||
since: new Date().getTime() / 1000,
|
||||
filters: `{ "event": ["pull"] }`,
|
||||
},
|
||||
(err, stream) => {
|
||||
// NOOP
|
||||
},
|
||||
{
|
||||
since: new Date().getTime() / 1000,
|
||||
filters: `{ "event": ["pull"] }`,
|
||||
},
|
||||
(err, stream) => {
|
||||
// NOOP
|
||||
},
|
||||
);
|
||||
|
||||
docker.getEvents(
|
||||
{
|
||||
since: new Date().getTime() / 1000,
|
||||
filters: { event: ['pull'] },
|
||||
},
|
||||
(err, stream) => {
|
||||
// NOOP
|
||||
},
|
||||
);
|
||||
|
||||
docker.getEvents((err, stream) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.getEvents().then(stream => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
const container = docker.getContainer('container-id');
|
||||
container.inspect((err, data) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
container.start((err, data) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
container.remove((err, data) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.listContainers((err, containers) => {
|
||||
containers.forEach(container => {
|
||||
docker
|
||||
.getContainer(container.Id)
|
||||
.stop((err, data) => {
|
||||
// NOOP
|
||||
});
|
||||
});
|
||||
containers.forEach(container => {
|
||||
docker.getContainer(container.Id).stop((err, data) => {
|
||||
// NOOP
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
docker.listContainers().then(containers => {
|
||||
return containers.map(container => docker.getContainer(container.Id));
|
||||
return containers.map(container => docker.getContainer(container.Id));
|
||||
});
|
||||
|
||||
docker.buildImage('archive.tar', { t: 'imageName' }, (err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.buildImage({context: '.', src: ['Dockerfile', 'test.sh']}, { t: 'imageName' }, (err, response) => {
|
||||
// NOOP
|
||||
docker.buildImage({ context: '.', src: ['Dockerfile', 'test.sh'] }, { t: 'imageName' }, (err, response) => {
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.createContainer({ Tty: true }, (err, container) => {
|
||||
container.start((err, data) => {
|
||||
// NOOP
|
||||
});
|
||||
container.start((err, data) => {
|
||||
// NOOP
|
||||
});
|
||||
});
|
||||
|
||||
docker.pruneContainers((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.pruneImages((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.pruneNetworks((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
docker.pruneVolumes((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
const plugin = docker.getPlugin('pluginName', 'remoteName');
|
||||
plugin.configure((err, response) => {
|
||||
// NOOP;
|
||||
// NOOP;
|
||||
});
|
||||
|
||||
plugin.disable((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.enable((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.inspect((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.privileges((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.pull({}, (err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.push((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.remove((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
plugin.upgrade({}, (err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
const secret = docker.getSecret('secretName');
|
||||
secret.inspect((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
secret.remove((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
secret.update((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
const node = docker.getNode('nodeName');
|
||||
node.inspect((err, reponse) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.inspect().then(response => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.update({}, (err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.update((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.update({}).then(response => {
|
||||
// NOOP;
|
||||
// NOOP;
|
||||
});
|
||||
|
||||
node.remove({}, (err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.remove((err, response) => {
|
||||
// NOOP
|
||||
// NOOP
|
||||
});
|
||||
|
||||
node.remove({}).then(response => {
|
||||
// NOOP;
|
||||
// NOOP;
|
||||
});
|
||||
|
||||
2314
types/dockerode/index.d.ts
vendored
2314
types/dockerode/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user