Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,68 +28,68 @@ the envvar `DEBUG` to `fleetctl` when you run your program that uses this module

## API

**.cat(unitName)**
**.cat(unitName)**
Output the contents of a submitted unit.

**.debugInfo()**
**.debugInfo()**
Print out debug information.

**.destroy(unitName)**
**.destroy(unitName)**
Destroy one or more units in the cluster.

**.journal(unitName, options)**
Print the journal of a unit in the cluster to stdout.
**.journal(unitName, options)**
Print the journal of a unit in the cluster to stdout.
Options:
* `follow` Continuously print new entries as they are appended to the journal.
* `lines` Number of recent log lines to return

**.listMachines()**
**.listMachines()**
Enumerate the current hosts in the cluster.

**.listUnits()**
**.listUnits()**
Enumerate units loaded in the cluster.

**.load(unitName, options)**
Schedule one or more units in the cluster, first submitting them if necessary. You must supply either one of the `unitFile` or `unitFileData` options, below.
**.load(unitName, options)**
Schedule one or more units in the cluster, first submitting them if necessary. You must supply either one of the `unitFile` or `unitFileData` options, below.
Options:
* `unitFile` The path to the unit file to load.
* `unitFileData` The contents of the unit file itself, base64-encoded.
* `blockAttempts` Wait until the jobs are loaded, performing up to N attempts before giving up. A value of 0 indicates no limit.
* `noBlock` Do not wait until the jobs have been loaded before exiting.
* `sign` Sign unit file signatures and verify submitted units using local SSH identities.

**.start(unitName, options)**
Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary. You must supply either one of the `unitFile` or `unitFileData` options, below.
**.start(unitName, options)**
Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.
Options:
* `unitFile` The path to the unit file to start.
* `unitFileData` The contents of the unit file itself, base64-encoded.
* `blockAttempts` Wait until the jobs are launched, performing up to N attempts before giving up. A value of 0 indicates no limit.
* `noBlock` Do not wait until the jobs have been launched before exiting.
* `sign` Sign unit file signatures using local SSH identities.

**.status(unitFile)**
**.status(unitName)**
Output the status of one or more units in the cluster

**.stop(unitFile)**
Instruct systemd to stop one or more units in the cluster.
**.stop(unitName)**
Instruct systemd to stop one or more units in the cluster.
Options:
* `blockAttempts` Wait until the jobs are stopped, performing up to N attempts before giving up. A value of 0 indicates no limit.
* `noBlock` Do not wait until the jobs have stopped before exiting.

**.submit(unitFile, options)**
Upload one or more units to the cluster without starting them. You must supply either one of the `unitFile` or `unitFileData` options, below.
**.submit(unitFile, options)**
Upload one or more units to the cluster without starting them. You must supply either one of the `unitFile` or `unitFileData` options, below.
Options:
* `unitFile` The path to the unit file to submit.
* `unitFileData` The contents of the unit file itself, base64-encoded.
* `sign` Sign unit files units using local SSH identities

**.unload(unitFile, options)**
Unschedule one or more units in the cluster.
**.unload(unitName, options)**
Unschedule one or more units in the cluster.
Options:
* `blockAttempts` Wait until the jobs are inactive, performing up to N attempts before giving up. A value of 0 indicates no limit.
* `noBlock` Do not wait until the jobs have become inactive before exiting.

**.verify(unitFile)**
**.verify(unitFile)**
Verify unit file signatures using local SSH identities.

## Licence
Expand Down
4 changes: 2 additions & 2 deletions bin/fleetctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [[ $FLEETW_UNIT && ($FLEETW_UNIT_DATA || $FLEETW_UNIT_FILE) ]]; then

SCP_OPTIONS=$OPTIONS
[[ $FLEETW_PORT ]] && SCP_OPTIONS="-P $FLEETW_PORT $SCP_OPTIONS"
ssh $SSH_OPTIONS core@$FLEETW_HOST "cat - > $FLEETW_UNIT ; fleetctl $@ $FLEETW_UNIT" < $unitfile
2>&1 ssh $SSH_OPTIONS core@$FLEETW_HOST "2>&1 cat - > $FLEETW_UNIT ; fleetctl $@ $FLEETW_UNIT" < $unitfile
else
ssh $SSH_OPTIONS core@$FLEETW_HOST fleetctl $@
2>&1 ssh $SSH_OPTIONS core@$FLEETW_HOST fleetctl $@
fi
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ FleetAPI.prototype._ssh_fleetctl = function (command, args, options, cb) {
if (options.unitFileData) {
env.FLEETW_UNIT_DATA = options.unitFileData;
}
else {
env.FLEETW_UNIT_FILE = options.unitFile || getUnitFilename(options.unit);
else if (options.unitFile) {
env.FLEETW_UNIT_FILE = options.unitFile;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetctl-ssh",
"version": "0.2.1",
"name": "fleetctl-ssh-fork",
"version": "0.4.0",
"description": "A Node.js workalike module for CoreOS' fleetctl that that runs remotely over SSH, allowing you to use it from inside a Docker container. Inspired by @opendeis' scheduler.",
"repository": {
"type": "git",
Expand Down