Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1997)

Unified Diff: app/store/env/sandbox.js

Issue 8236043: Added add_unit integration to fake PyJujuAPI
Patch Set: Added add_unit integration to fake PyJujuAPI Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « [revision details] ('k') | test/test_sandbox.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/store/env/sandbox.js
=== modified file 'app/store/env/sandbox.js'
--- app/store/env/sandbox.js 2013-03-22 00:19:09 +0000
+++ app/store/env/sandbox.js 2013-04-01 22:32:24 +0000
@@ -352,6 +352,26 @@
PLACEHOLDER. This exists to demo existing functionality.
**/
performOp_update_annotations: function(data) {
+ },
+
+ /**
+ Handles add unit operations from the client.
+
+ @method performOp_add_unit
+ @param {Object} data contains serviceName and numUnits required for adding
+ additional units.
+ */
+ performOp_add_unit: function(data) {
+ var res = this.get('state').addUnit(data.service_name, data.num_units);
+ if (res.error) {
+ data.err = res.error;
+ } else {
+ data.result = Y.Array.map(res.units, function(unit) {
+ return unit.id;
+ });
+ }
+ // respond with the new data or error
+ this.get('client').receiveNow(data);
}
});
« no previous file with comments | « [revision details] ('k') | test/test_sandbox.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b