added script function and put in a layout of module-specific functions for automation to be called from objects of various classes of our app

This commit is contained in:
stupidon 2016-03-29 08:07:35 +02:00
parent 804fa322d8
commit cb2e0a46df
2 changed files with 32 additions and 18 deletions

View file

@ -170,7 +170,7 @@ class compute
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing, son!");
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
@ -204,7 +204,7 @@ class compute
try{
$flavorId = $this->app->getPostParam("flavorId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Flavor ID is missing, son!");
$this->app->setOutput("Error", "Flavor ID is missing!");
return;
}
$opt = array('id' => $flavorId);
@ -238,7 +238,7 @@ class compute
try{
$imageId = $this->app->getPostParam("imageId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Image ID is missing, son!");
$this->app->setOutput("Error", "Image ID is missing!");
return;
}
$opt = array('id' => $imageId);
@ -274,7 +274,7 @@ class compute
$imageId = $this->app->getPostParam("imageId");
$flavorId = $this->app->getPostParam("flavorId");
if(!isset($name) || !isset($imageId) || !isset($flavorId)){
$this->app->setOutput("Error", "No, we don't let you create a server without a name OR image ID OR flavor ID.");
$this->app->setOutput("Error", "Server name OR image ID OR flavor ID is missing.");
return;
}
$opt = array('name' => $name, 'imageId' => $imageId, 'flavorId' => $flavorId);
@ -353,7 +353,7 @@ class compute
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing, son!");
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
@ -422,7 +422,7 @@ class compute
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing, son!");
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);