Add docker.inspect() api
This commit is contained in:
@@ -14,6 +14,7 @@ exports = module.exports = {
|
||||
deleteContainers: deleteContainers,
|
||||
createSubcontainer: createSubcontainer,
|
||||
getContainerIdByIp: getContainerIdByIp,
|
||||
inspect: inspect,
|
||||
execContainer: execContainer
|
||||
};
|
||||
|
||||
@@ -387,6 +388,18 @@ function getContainerIdByIp(ip, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function inspect(containerId, callback) {
|
||||
assert.strictEqual(typeof containerId, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var container = exports.connection.getContainer(containerId);
|
||||
|
||||
container.inspect(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
callback(null, result);
|
||||
});
|
||||
}
|
||||
|
||||
function execContainer(containerId, cmd, options, callback) {
|
||||
assert.strictEqual(typeof containerId, 'string');
|
||||
assert(util.isArray(cmd));
|
||||
|
||||
Reference in New Issue
Block a user