fleetctl
A nodejs module for interacting with fleet.
Last updated 6 years ago by normanjoyner .
GPLv2 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fleetctl 
SYNC missed versions from official npm registry.

node-fleetctl

##About

###Description A nodejs module for interacting with fleetctl. This module should be updated when a stable HTTP API for fleet is released. In the interim, this module resorts to shelling out and parsing stdout.

###Author Norman Joyner - norman.joyner@gmail.com

##Getting Started

###Installation npm install fleetctl

###Usage To get started, simply require fleetctl in your program, and instantiate a new Fleetctl object. Once instantiated, you are free to make calls to fleetctl.

var Fleetctl = require("fleetctl");
var fleetctl = new Fleetctl();

If the fleetctl binary is not installed in your PATH, you can specify the path to it when instantiating a Fleetctl object.

var Fleetctl = require("fleetctl");
var fleetctl = new Fleetctl({
    binary: "/Users/normanjoyner/Development/fleet/fleetctl"
});

Alternatively, you can call the configure() method after instantiation. When configuring, you can pass any available global Fleetctl option.

var Fleetctl = require("fleetctl");
var fleetctl = new Fleetctl();
fleetctl.configure({
    binary: "/Users/normanjoyner/Development/fleet/fleetctl"
    tunnel: "10.10.10.10"
});

The following fleetctl sub-commands are available in this module:

list-machines

fleetctl.list_machines(function(err, machines){
    if(err)
        throw err;

    console.log(machines);
});

list-units

fleetctl.list_units(function(err, units){
    if(err)
        throw err;

    console.log(units);
});

list-unit-files

fleetctl.list_unit_files(function(err, unit_files){
    if(err)
        throw err;

    console.log(unit_files);
});

submit

fleetctl.submit(["unit1", "unit2"], function(err){
    if(err)
        throw err;
});

load

fleetctl.load(["unit1", "unit2"], function(err){
    if(err)
        throw err;
});

unload

fleetctl.unload("unit1", function(err){
    if(err)
        throw err;
});

start

fleetctl.start("unit1", function(err){
    if(err)
        throw err;
});

stop

fleetctl.stop("unit1", {"no-block": true}, function(err){
    if(err)
        throw err;
});

destroy

fleetctl.destroy("unit1", function(err){
    if(err)
        throw err;
});

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

9 Versions

  • 1.0.0                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (1)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |