Patch up the addon memory configuration
This commit is contained in:
@@ -686,26 +686,29 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.getAddon = function (addon, callback) {
|
||||
get('/api/v1/addons/' + addon).success(function (data, status) {
|
||||
Client.prototype.getAddon = function (addonName, callback) {
|
||||
get('/api/v1/addons/' + addonName).success(function (data, status) {
|
||||
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
callback(null, data.addon);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.configureAddon = function (addonName, memoryLimit, callback) {
|
||||
callback(new Error('not implemented'));
|
||||
};
|
||||
|
||||
Client.prototype.startAddon = function (addon, callback) {
|
||||
post('/api/v1/addons/' + addon + '/start').success(function (data, status) {
|
||||
post('/api/v1/addons/' + addonName, { memory: memoryLimit }).success(function (data, status) {
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.stopAddon = function (addon, callback) {
|
||||
post('/api/v1/addons/' + addon + '/stop').success(function (data, status) {
|
||||
Client.prototype.startAddon = function (addonName, callback) {
|
||||
post('/api/v1/addons/' + addonName + '/start').success(function (data, status) {
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.stopAddon = function (addonName, callback) {
|
||||
post('/api/v1/addons/' + addonName + '/stop').success(function (data, status) {
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
|
||||
Reference in New Issue
Block a user