Skip to content

A simple RPC communication library for the JSON LUCI RPC API

Notifications You must be signed in to change notification settings

AlchemillaHQ/luci-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

luci-rpc

A simple RPC communication library for the JSON LUCI RPC API.

Example

const { LUCI } = require('luci-rpc')

async function main() {
    const luci = new LUCI('https://192.168.1.2', 'root', 'x')

    await luci.init()
    let updateInterval = 1000 * 60 * 30
    luci.autoUpdateToken(updateInterval);

    console.log(await luci.getAll("network"))
    console.log(await luci.get(["network", "@device[0]", "ports"]))

    await luci.set(["network", "lan", "ipaddr", "192.168.1.1"])
    console.log(await luci.getChangedSections())
    console.log(await luci.getChanges())
    console.log(await luci.commit("network"))
    console.log(await luci.commitSpecific(["network", "lan"]))
}

main()

LICENSE

GPL-3.0

About

A simple RPC communication library for the JSON LUCI RPC API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published