Commit for testing

This commit is contained in:
Loic GUEGAN 2016-05-04 19:38:09 +02:00
parent f819bc0c90
commit 0266c16ffc
4 changed files with 32 additions and 24 deletions

View file

@ -105,6 +105,21 @@ mainApp.factory('Compute', ['$http', 'Identity', function ($http, Identity) {
});
};
var createMachine = function (callback, machine) {
// Send listServers request
var result = $http.post('../server/index.php',
$.param({"token": Identity.getToken(), "task": "compute", "action": "createServer", 'name':machine.name, "imageId":machine.imageId,"flavorId":machine.flavorId}));
// Wait and handle the response
result.then(function (response) {
callback();
console.log(response.data.Error)
}, function (response) {
console.log("error")
callback();
});
};
/**
* Retrieve all data
@ -134,6 +149,7 @@ mainApp.factory('Compute', ['$http', 'Identity', function ($http, Identity) {
return {
pullMachines: pullMachines,
pullData: pullData,
createMachine:createMachine,
getData: getData
};