Skip to content

Commit

Permalink
[api] Accept cloud information in Apps.prototype.start.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Feb 11, 2013
1 parent bfdd5bf commit 0eef437
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion node.js/lib/client/apps.js
Expand Up @@ -123,13 +123,25 @@ Apps.prototype.destroy = function (appName, callback) {
//
// ### function start (appName, callback)
// #### @appName {string} Name of the application to start
// #### @cloud {Object|Array} **Optional** Cloud to start this application in.
// #### @callback {function} Continuation to pass control to when complete
// Starts the application with `name` for the authenticated user.
//
Apps.prototype.start = function (appName, callback) {
Apps.prototype.start = function (appName, cloud, callback) {
if (!callback && typeof cloud === 'function') {
callback = cloud;
cloud = null;
}

appName = defaultUser.call(this, appName);
var argv = ['apps'].concat(appName.split('/')).concat('start');

if (cloud) {
self.clouds[appName] = !Array.isArray(cloud)
? [cloud]
: cloud;
}

this.cloud({ method: 'POST', uri: argv, appName: appName }, this.request, callback);
};

Expand Down

0 comments on commit 0eef437

Please sign in to comment.