A client for communicating with a local or remote instance of LXD.
$ npm install --save @wolfogaming/node-lxd
The following example connects to the local LXD instance and launches a new instance.
var { Client } = require("@wolfogaming/node-lxd");
var client = new Client(null, {type:"unix"});
client.createInstance("improved-elk", {
"config": {
"limits.cpu": 3,
"limits.memory": "1GB",
"security.nesting": true
},
"image": "ubuntu/21.04",
"description": "test Instance",
"profiles": ["default"]
}).then((emitter) => {
emitter.on('progress', (progress) => {
console.log(progress, "% completed")
})
emitter.on('finished', (instance) => {
console.log("finished creating instance " + instance.name())
})
})
SFTP support: node-lxd-sftp