Skip to content

A Node.JS client for communicating with a local or remote instance of LXD written in typescript.

Notifications You must be signed in to change notification settings

Wolfo-Gaming/node-lxd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node LXD

npm npm version typescript

A client for communicating with a local or remote instance of LXD.

Installing

$ npm install --save @wolfogaming/node-lxd

Getting Started

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())
   })
})

Optional dependencies

SFTP support: node-lxd-sftp

About

A Node.JS client for communicating with a local or remote instance of LXD written in typescript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published