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.
npm install --save @zombiec0rn/zombie-node-format
var znf = require('@zombiec0rn/zombie-node-format')
try {
znf.validate(nodes)
} catch(e) {
console.log(e instanceof znf.exception, e.trace)
}
The main usecase for this module is to validate node configs. See usage example above.
Generate random node configs. Useful for testing etc.
var znf = require('@zombiec0rn/zombie-node-format')
var services = znf.random(5, { swarm: 'anklebiters' })
The znf json schema.
The znf exception throws if bad config.
{
"hostname" : "anklebiters-gateway",
"swarm" : "anklebiters",
"engines" : ["docker:4243"],
"tags" : ["google","gateway"],
"memory": 1779699712,
"cpus": [
{
"model": "Intel(R) Xeon(R) CPU @ 2.60GHz",
"speed": 2600
}
]
}
The node hostname
. Considered a unique identifier of te node.
A swarm is a collection of nodes. A node can be part of a single swarm only.
Engines is a list of supported service drivers on the node.
A list of tags.
The memory capacity of the node.
The cpu capacity of the node. A list of cpus.
- Initial release 🎉