Skip to content

Commit

Permalink
[api] Add an API for starting app on number of drones
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 26, 2012
1 parent 237376c commit 425a545
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions node.js/lib/client/apps.js
Expand Up @@ -159,3 +159,19 @@ Apps.prototype.available = function (app, callback) {
callback(null, result || res.statusCode);
});
};

//
// ### function setDrones (app, callback)
// #### @app {string} Name of the application to set number of drones for.
// #### @drones {Number} Number of drones to run.
// #### @callback {function} Continuation to respond to when complete.
// Runs `app` on `drones` drones.
//
Apps.prototype.setDrones = function (appName, drones, callback) {
appName = defaultUser.call(this, appName);
argv = ['apps'].concat(appName.split('/')).concat('drones');

this.request('POST', argv, { drones: drones }, callback, function (res, result) {
callback(null, result || res.statusCode);
});
};

0 comments on commit 425a545

Please sign in to comment.