You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
487 B
JavaScript
18 lines
487 B
JavaScript
6 years ago
|
'use strict';
|
||
|
|
||
|
const path = require("path");
|
||
|
const createError = require("create-error");
|
||
|
|
||
|
const qmp = require("./qmp");
|
||
|
const api = require("./api");
|
||
|
|
||
|
const NotImplementedError = createError("NotImplementedError");
|
||
|
|
||
|
module.exports = function createKvmWrapper(instanceId, options) {
|
||
|
return Promise.try(() => {
|
||
|
return qmp(path.join(__dirname, `../../../qmp-sockets/${instanceId}`));
|
||
|
}).then((socket) => {
|
||
|
return api(socket, Object.assign({instanceId: instanceId}, options));
|
||
|
});
|
||
|
}
|