diff --git a/server/core/Compute.php b/server/core/Compute.php index 4a50f4a..8524c86 100644 --- a/server/core/Compute.php +++ b/server/core/Compute.php @@ -111,24 +111,7 @@ class compute $this->app->setOutput("Images", $images); return; } - /** - * Create server. - * @return array - */ - public function createServer() - { - $name = $this->app->getPostParam("name"); - $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."); - return; - } - $opt = array('name' => $name, 'imageId' => $imageId, 'flavorId' => $flavorId); - $server = $this->libClass->createServer($opt); - } - */ - /** + /** * Get server details. * @return array */ @@ -179,6 +162,27 @@ class compute $this->app->setOutput("MyImage", $image); return; } + /** + * Create server. + * @return array + */ + public function createServer() + { + $name = $this->app->getPostParam("name"); + $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."); + return; + } + $opt = array('name' => $name, 'imageId' => $imageId, 'flavorId' => $flavorId); + $server = $this->libClass->createServer($opt); + } + + /** + * update a server + * @return void + */ public function updateServer() { $serverId = $this->app->getPostParam("serverId"); @@ -204,6 +208,9 @@ class compute $this->app->setOutput("Success", $serverId." has been updated successfully."); return; } + /** + * Delete a server + * @return void */ public function deleteServer() {