From 804fa322d841d73ee7592885ec500dc94e91b9e6 Mon Sep 17 00:00:00 2001 From: Yoggzo Date: Sun, 27 Mar 2016 19:54:38 +0200 Subject: [PATCH] difficulties with automating --- server/core/Automating.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/server/core/Automating.php b/server/core/Automating.php index 065cf5e..7f2c654 100644 --- a/server/core/Automating.php +++ b/server/core/Automating.php @@ -51,12 +51,14 @@ class automating implements Core{ /** * Create a new image on a new server * - * @param $error the error triggered + * @param $name the name of the new image + * @param $falvor_id the id of the flavor it will be used to create the new server * * @return Image the new image created */ private function createImageOnNewServer(){ try{ + /* POURRI $image = new Image($this->app); $compute = new Compute($this->app); @@ -81,6 +83,32 @@ class automating implements Core{ $this->app->setPostParam("flavorId", $falvor_id); $compute->action("createServer"); + */ + }catch(BadResponseError $e){ + $this->app->getErrorInstance()->BadResponseHandler($e); + }catch(UserInputError $e){ + $this->app->getErrorInstance()->UserInputHandler($e); + }catch(BaseError $e){ + $this->app->getErrorInstance()->BaseErrorHandler($e); + }catch(NotImplementedError $e){ + $this->app->getErrorInstance()->NotImplementedHandler($e); + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + //$this->app->setOutput("Auto", $res); + } + + + /** + * Create a new image on an existing server + * + * @param $name the name of the new image + * @param $server_id the id of the server + * + * @return Image the new image created + */ + private function createImageOnServer(){ + try{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); @@ -93,7 +121,6 @@ class automating implements Core{ }catch(Exception $e){ $this->app->getErrorInstance()->OtherException($e); } - $this->app->setOutput("Auto", $res); } }