summaryrefslogtreecommitdiff
path: root/server/core/Compute.php
diff options
context:
space:
mode:
authorstupidon <bhupendra.siyag@gmail.com>2016-03-05 14:05:52 +0100
committerstupidon <bhupendra.siyag@gmail.com>2016-03-05 14:05:52 +0100
commitc43e532f766c3f97a34e6fad3dd990f7992e710b (patch)
tree3af3da07e7682cc404330e3d811cb3db54319dee /server/core/Compute.php
parentf4e59ee82c5947496d1810d53483c5a0afd57fe8 (diff)
added createServer and corrected certain minor bugs
Diffstat (limited to 'server/core/Compute.php')
-rw-r--r--server/core/Compute.php43
1 files changed, 25 insertions, 18 deletions
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()
{