Permalink
Browse files

[api] Add an API for starting app on number of drones

  • Loading branch information...
mmalecki committed Oct 26, 2012
1 parent 237376c commit 425a54556da91effef48c8c0282bf74bda8783b4
Showing with 16 additions and 0 deletions.
  1. +16 −0 node.js/lib/client/apps.js
@@ -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.