strong-mesh-client
Background
This module provides a node.js and browser client that interacts with a set of strong-pm APIs.
Usage
Node.js
Below is an example setting up the mesh client for use in node.js.
var mesh = MeshClient; meshManagerHost;
Browser + Proxy
First mount the proxy as an express middleware / route handler.
// app => an express / loopback appvar meshProxy = '/path/to/config/file.json' interval: 2000; app;
Add the client script.
Interact with mesh from the browser via the proxy.
var mesh = 'http://localhost:3000';; // get notifications when hosts changemeshnotifications; // adding a host to the manager (that is a PM)meshManagerHost; // delete from the configManagerHost; // perform an action on a specific hostmanagerHostaction cmd: 'stop' cb;
Models
ManagerHost
host: 'foo.com' port: 3000 error: message: '...' status: 500 errorType: 'connection' // correspond to the error property app: name: 'appname' version: '1.2.3' port: 4000 // if null, app is not running actions: 'start' 'edit' // always included 'delete' // always included // list of available actions depending on the state of the host processes: targetCount: 7 pids: id: '...' pid: 123 credentials: username: '...' password: '...'
LoadBalancer
host: 'foo.com' port: 3000 credentials: username: '...' password: '...' error: status: 500 message: '...'