@zombiec0rn/zombie-node-format
Zombie Node Format
Last updated 4 years ago by asbjornenge .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @zombiec0rn/zombie-node-format 
SYNC missed versions from official npm registry.

Zombie Node Format

Zombie Node Format (znf) is the configuration format for zombie nodes.

The format describes nodes and their properties. The main purpose of this module is to provide tools and a validation schema for working with zombie nodes. It includes a JSON schema validator for the format.

The format is extensible so other modules can expand it's capabilities and semantics.

Install

npm install --save @zombiec0rn/zombie-node-format

Use

var znf = require('@zombiec0rn/zombie-node-format')

try {
  znf.validate(nodes)
} catch(e) {
  console.log(e instanceof znf.exception, e.trace)
}

API

validate(services)

The main usecase for this module is to validate node configs. See usage example above.

random(num, opts)

Generate random node configs. Useful for testing etc.

var znf = require('@zombiec0rn/zombie-node-format')
var services = znf.random(5, { swarm: 'anklebiters' })

schema

The znf json schema.

exception

The znf exception throws if bad config.

Format

{
  "hostname" : "anklebiters-gateway",
  "swarm"    : "anklebiters",
  "engines"  : ["docker:4243"],
  "tags"     : ["google","gateway"],
  "memory": 1779699712,
  "cpus": [
    {
      "model": "Intel(R) Xeon(R) CPU @ 2.60GHz",
      "speed": 2600
    }
  ]
}

hostname

The node hostname. Considered a unique identifier of te node.

swarm

A swarm is a collection of nodes. A node can be part of a single swarm only.

engines

Engines is a list of supported service drivers on the node.

tags

A list of tags.

memory

The memory capacity of the node.

cpus

The cpu capacity of the node. A list of cpus.

Changelog

1.0.0

  • Initial release :tada:

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |