GithubHelp home page GithubHelp logo

isabella232 / node-zonecfg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tritondatacenter/node-zonecfg

0.0 0.0 0.0 33 KB

Node.js bindings to a small subset of illumos/smartos's libzonecfg (obsolete, use node-zutil v2 or later)

Python 1.05% JavaScript 14.94% C 35.52% Makefile 15.08% C++ 33.40%

node-zonecfg's Introduction

This is a binary Node.js binding to a small subset of libzonecfg on illumos/SmartOS. It uses N-API, which IIUC was added to node in v6. Currently testing is done against node v6.

Install / Build

npm install

Note: If you are running as root you will see this warning (see npm/npm#3497):

npm WARN lifecycle [email protected]~install: cannot run in wd [email protected] node-gyp rebuild (wd=...)

You then need to use:

npm install --unsafe-perm

Usage

TODO

Reference

Raw API

These are APIs that attempt to match as closely as possible to the raw libzonecfg APIs. See:

zone_get_state(zone_name)

Returns the zone_state_t (an integer) state of the given zone. Throws an Error on any failure. Use zone_state_str() to convert that to the zone state string like "running". See convenience method zone_get_state_str.

Parameters:

  • zone_name - String zone name. Typically on SmartOS this is 'global' or a UUID.

zone_state_str(zone_state_t)

Converts a zone_state_t (an integer), as from zone_get_state, to a zone state string like "running" or "configured".

Parameters:

  • zone_state_t - Integer, typically from zone_get_state.

Convenience API

These are APIs that wrap one or more raw libzonecfg APIs to provide something typically more convenient for Node.js usage. Opinions on usefulness may vary.

zone_get_state_str(zone_name)

Gets the zone state string (e.g. "running", "configured") for the given zone_name string. Throws an Error on any failure.

Parameters:

  • zone_name - String zone name. Typically on SmartOS this is 'global' or a UUID.

See Also

  • node-zutil has bindings for some of libzonecfg and libzone (?, at least for /usr/include/zone.h) on illumos/SmartOS. However, it uses waf and supports node 0.6 and node 0.8 only (with a patch floating around in orlandov/node-zutil for node 0.10 support).

node-zonecfg's People

Contributors

trentm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.